インストールガイド
単一ファイル版で即座に使用するか、Composerで依存関係として管理するかを選択できます。
動作環境
PHP 7.4以上が必要です。インストール前に動作環境をご確認ください。
スタンドアロンファイル
GitHubリリースページから最新の scanner をダウンロードするか、現在のバージョンを直接取得します:
curl --fail --silent --show-error --location \
--output scanner \
https://raw.githubusercontent.com/marcocesarato/PHP-Antimalware-Scanner/master/dist/scanner
バージョンを確認し、レポートのみのスキャンを実行します:
php scanner --version
php scanner /var/www/example --lite --report
スキャナー実行ファイルは、スキャン対象ディレクトリの外側に配置してください。
TLS検証を無効にしないでください
--no-check-certificate は使用しないでください。証明書エラーはネットワークや証明書チェーンの問題を示しています。
Composer
パッケージは marcocesarato/amwscan として公開されています。
プロジェクトへの導入
composer require marcocesarato/amwscan
php vendor/marcocesarato/amwscan/src/index.php /var/www/example --lite --report
グローバルインストール
composer global require marcocesarato/amwscan
php "$(composer global config home)/vendor/marcocesarato/amwscan/src/index.php" /var/www/example --lite --report
ソースコードから
git clone https://github.com/marcocesarato/PHP-Antimalware-Scanner.git
cd PHP-Antimalware-Scanner
composer install
php src/index.php /var/www/example --lite --report
Docker
メンテナンスされているイメージは Docker Hub で公開されています。
docker pull marcocesarato/php-antimalware-scanner:latest
現在の安定版には latest を使用します。自動化では 0.19.1 のような完全なリリースタグを固定してください。
スキャン対象を読み取り専用でマウントし、レポート用に別の出力ディレクトリを使用します。
docker run --rm \
--volume "/var/www/example:/scan:ro" \
--volume "$PWD/amwscan-output:/output" \
marcocesarato/php-antimalware-scanner:latest /scan \
--lite --report-only --report-format=html \
--path-report=/output/report.html \
--disable-checksum --disable-definitions-update
ローカルのソースチェックアウトにある変更をテストするには、イメージをローカルでビルドし、上記のコマンドにある Docker Hub イメージ名を置き換えます。
docker build --tag amwscan .