ClamAV
$ clamscan 官方出品 中风险ClamAV(clamscan)基于 Cisco Talos 特征库对文件、压缩包与目录进行木马、病毒和恶意软件扫描。默认扫描只读安全,而 --move 与 --remove 会移动或删除命中文件;首次运行前需先通过 freshclam 拉取病毒库。
brew install clamav clamscan 需在本地加载数百 MB 的病毒特征库并直接扫描磁盘文件与压缩包,无法在 MCP 中运行。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
退出码语义明确(0 正常、1 检出感染、2 扫描出错)且支持 -i 过滤,但缺少 JSON 输出,且每次冷启动加载病毒库需约 10–20 秒。
- Clear exit codes (
0/1/2) and-iinfected-only output - No
--jsonflag; slow cold-start signature load unless usingclamdscan
默认扫描为只读模式,但 --remove 会直接永久删除文件(误报可能误删合法文件)。
- Safe read-only default behavior
--remove/--movemutate the local filesystem
可通过 brew、Linux 包管理器和 Windows 安装包部署,但首次使用前必须配置 freshclam.conf 并下载特征库。
- Cross-platform binary, but requires
freshclamdatabase initialization
可靠的通用反病毒扫描引擎,但单次调用 clamscan 的内存与启动开销较高。
- Broad archive and file format unpacking for AV scanning
由 Cisco Talos(Cisco-Talos/clamav)以 GPL-2.0 协议维护,特征库每日更新。
- Official Cisco Talos repository and signature feed
docs.clamav.net 官方文档与手册详尽完善。
- Comprehensive manual at docs.clamav.net
安全边界、鉴权与放权指南
无需用户认证;本地病毒库及 freshclam.conf / clamd.conf 存放在系统或 Homebrew 配置目录中。
GPL-2.0 开源 CLI,免费且包含 Cisco Talos 每日特征库更新。
# ClamAV (clamscan) Agent Rules - Default to read-only `clamscan -r -i` and NEVER pass `--remove` automatically. - Verify `freshclam` signatures exist before scanning; exit code `1` means malware found while `2` means scan error.
Agent 高频安全命令配方
只读查询(安全推荐)
clamscan -r -i --no-summary ./downloads
递归扫描 ./downloads,通过 -i 仅打印检出项并省略末尾汇总统计。
受控写入与预演
clamscan -r -i --move=/tmp/quarantine --log=/tmp/clamscan.log ./downloads
使用 --move=/tmp/quarantine 隔离检出文件而非直接删除,并通过 --log 记录审计日志。
核心优势
- + 通过退出码清晰区分正常(
0)、感染(1)与报错(2)。 - + 原生支持解压并检测压缩包、PDF 与 Office 文档,无需额外拆包工具。
注意事项与踩坑点
- ! 新安装后需先编辑
freshclam.conf并运行freshclam下载病毒库,否则会报错退出。 - ! 不支持 JSON 输出,且每次调用
clamscan都需重新加载全部特征库,耗时与内存占用较高。