Security Edition コマンド

antivirus config

antivirus config

antivirus config

マルウェア・ウイルス検索時のスキャン対象ディレクトリを変更します。

使用例

kusanagi antivirus config --template wp-content kusanagi_html

オプション

マルウェア・ウイルス検索対象ディレクトリのテンプレート(必須)

--template {documentroot,drupal,wp-content,wp-uploads}

マルウェア・ウイルス検索時のスキャン対象となるディレクトリのテンプレートを指定します。
テンプレートごとの対象となるディレクトリは以下の通りです。

  • documentroot : /home/kusanagi/{profile}/DocumentRoot/
  • drupal : /home/kusanagi/{profile}/DocumentRoot/sites/
  • wp-content : /home/kusanagi/{profile}/DocumentRoot/{wp}/wp-content/
  • wp-uploads : /home/kusanagi/{profile}/DocumentRoot/{wp}/wp-content/uploads/

{profile} には、コマンド実行時に指定したプロファイル名が設定されます。
{wp} には、指定したプロファイル名の配下にある WordPress のサブディレクトリが設定されます。
そのため、1つのプロファイル内に複数の WordPress が存在する場合は、その全ての WordPress がスキャン対象となります。

プロファイル名

[profile]

デフォルト : カレントディレクトリのプロファイル

profile を指定した場合、指定したプロファイルのスキャン対象ディレクトリを変更します。
また、カレントディレクトリがプロファイルではない場合はエラーになります。

実行例

# kusanagi antivirus config --template wp-content kusanagi_html
antivirus completed.

スキャン対象設定ファイル

※ : こちらは高度な設定になりますので、変更する際には十分注意してください。

antivirus config コマンドではマルウェア・ウイルス検索時のスキャン対象ディレクトリを変更しますが、その設定は以下のパスの設定ファイルに記載されています。

  • /etc/opt/kusanagi/clamav/scan.yaml

設定されている内容例は以下になります。

target:
- /tmp/
- /var/tmp/
- /dev/shm/
include: []
include-dir: []
exclude: []
exclude-dir:
- /proc/
- /sys/
- /boot/efi/
- /usr/libexec/fwupd/efi/
- /usr/lib/firmware/
- /usr/share/fwupd/
- /var/opt/kusanagi/lib/clamav
---
kusanagi_html:
  target:
  - /home/kusanagi/kusanagi_html/DocumentRoot/wp-content/uploads

yaml 形式での設定になっており、それぞれの項目を以下に説明します。

  • 最上位項目は共通設定となります
    • target : スキャン対象ディレクトリ/ファイル
    • include : スキャン対象とするファイル(正規表現を利用可能)
    • include-dir : スキャン対象とするディレクトリ(正規表現を利用可能)
    • exclude : スキャン除外対象とするファイル(正規表現を利用可能)
    • exclude-dir : スキャン除外対象とするディレクトリ(正規表現を利用可能)
  • プロファイル名はプロファイルごとの設定となります
    • target : スキャン対象ディレクトリ/ファイル

target で指定したディレクトリ全てがスキャンの対象となります。
include(-dir) および exclude(-dir) その対象となったディレクトリに対しての指定となります。
inculde(-dir) と exclude(-dir) の条件が衝突した場合は、 exculde の方が優先されます。

超高速CMS実行環境 KUSANAGI
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.