跳到主要内容
版本:v0.21

容器镜像

项目维护的镜像发布在 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

该命令将 report.html 写入 amwscan-output。请在浏览器中打开该文件以查看扫描结果。

从源代码构建

测试本地源代码副本时,请构建项目附带的镜像:

docker build --tag amwscan .

要使用本地构建,请将扫描命令中的 Docker Hub 镜像名称替换为 amwscan

有关 CI 集成,请参阅 GitHub ActionsJenkinsGitLab CI