扫描镜像前需先自行 docker pull 目标镜像;扫描容器镜像依赖挂载 /var/run/docker.sock;输出目录需挂载到容器内 /home/deepfence/output 才能取回结果
YaraHunter
deepfenceApache-2.0更新放缓基于 YARA 规则的恶意软件扫描器,可集成到 CI/CD 流水线和运行时环境中,用于云原生场景的威胁检测与 IOC 排查。
🔍🔍 Malware scanner for cloud-native, as part of CI/CD and at Runtime 🔍🔍
docker pull quay.io/deepfenceio/deepfence_malware_scanner_ce:2.5.8
docker run -i --rm --name=deepfence-yarahunter -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/home/deepfence/output quay.io/deepfenceio/deepfence_malware_scanner_ce:2.5.8 --image-name metal3d/xmrig:latest --output=json > xmrig-scan.jsonREADME 未说明具体硬件要求;以 Docker 容器形式运行,扫描镜像时需要挂载宿主机的 /var/run/docker.sock。
用 YARA 规则扫描容器镜像、运行中容器和文件系统,找出恶意软件痕迹
基于 YARA 规则的恶意软件扫描器,可集成到 CI/CD 流水线和运行时环境中,用于云原生场景的威胁检测与 IOC 排查。
核心能力
- 用 YARA 规则集匹配已知恶意软件签名
- 支持扫描构建产物、本地镜像、运行中容器和文件系统
- 以 Docker 容器形式分发,便于在任意环境运行
- 输出可解析的 JSON,便于 CI/CD 自动化处理
- 支持挂载 rules-path 缓存规则,供下次扫描复用
容易踩的坑
- v2.5.8最新正式版2026-03-07 · 2026-03-07 16:56 UTC
Full Changelog: https://github.com/deepfence/YaraHunter/compare/v2.5.7...v2.5.8
- v2.5.72025-04-24 · 2025-04-24 12:13 UTC
查看更新说明
What's Changed
- Scan non executable files, fix severity by @ramanan-ravi in https://github.com/deepfence/YaraHunter/pull/117
Full Changelog: https://github.com/deepfence/YaraHunter/compare/v2.5.6...v2.5.7
- v2.5.62025-04-05 · 2025-04-05 07:54 UTC
查看更新说明
What's Changed
- Bump version to 2.5.5 by @ramanan-ravi in https://github.com/deepfence/YaraHunter/pull/114
- Revert "Bump version to 2.5.5" by @ramanan-ravi in https://github.com/deepfence/YaraHunter/pull/115
- Bump version to 2.5.5 by @ramanan-ravi in https://github.com/deepfence/YaraHunter/pull/116
Full Changelog: https://github.com/deepfence/YaraHunter/compare/v2.5.2...v2.5.6
- v2.5.22024-12-20 · 2024-12-20 18:18 UTC
查看更新说明
What's Changed
- Ignore low severity malwares by @ramanan-ravi in https://github.com/deepfence/YaraHunter/pull/113
Full Changelog: https://github.com/deepfence/YaraHunter/compare/v2.5.0...v2.5.2
- v2.5.02024-11-15 · 2024-11-15 06:16 UTC
查看更新说明
What's Changed
- update go version by @noboruma in https://github.com/deepfence/YaraHunter/pull/106
- add support for rules download in cli mode by @gnmahanth in https://github.com/deepfence/YaraHunter/pull/107
- add support for rules download in cli mode by @gnmahanth in https://github.com/deepfence/YaraHunter/pull/109
- Bump to golang 1.23 by @ramanan-ravi in https://github.com/deepfence/YaraHunter/pull/110
- Add support for proxy server by @ramanan-ravi in https://github.com/deepfence/YaraHunter/pull/111
- set skip non executable to true by @noboruma in https://github.com/deepfence/YaraHunter/pull/112
Full Changelog: https://github.com/deepfence/YaraHunter/compare/v2.4.0...v2.5.0
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
YaraHunter
Deepfence YaraHunter scans container images, running Docker containers, and filesystems to find indicators of malware. It uses a YARA ruleset to identify resources that match known malware signatures, and may indicate that the container or filesystem has been compromised.
YaraHunter can be used in the following ways:
- At build-and-test: scan build artifacts in the CI/CD pipeline, reporting on possible indicators of malware
- At rest: scan local container images, for example, before they are deployed, to verify they do not contain malware
- At runtime: scan running docker containers, for example, if you observe unusual network traffic or CPU activity
- Against filesystems: at any time, YaraHunter can scan a local filesystems for indicators of compromise
Key capabilities:
- Scan running and at-rest containers; scan filesystems; scan during CI/CD build operations
- Run anywhere: highly-portable, docker container form factor
- Designed for automation: easy-to-deploy, easy-to-parse JSON output
YaraHunter is a work-in-progress (check the Roadmap and issues list), and will be integrated into the ThreatMapper threat discovery platform. We welcome any contributions to help to improve this tool.
Quick Start
For full instructions, refer to the YaraHunter Documentation.

Example: Finding Indicators of Compromise in a container image
Images may be compromised with the installation of a cryptominer such as XMRig. In the following example, we'll scan a legitimiate cryptominer image that contains the same xmrig software that is often installed through an exploit:
Pull the official yarahunter image:
docker pull quay.io/deepfenceio/deepfence_malware_scanner_ce:2.5.8
or Build it from source clone this repo and run below command
make docker
Scan
Pull the image that needs to be scanned for example metal3d/xmrig and scan it:
docker pull metal3d/xmrig
Scan the image:
docker run -i --rm --name=deepfence-yarahunter \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp:/home/deepfence/output \
quay.io/deepfenceio/deepfence_malware_scanner_ce:2.5.8 \
--image-name metal3d/xmrig:latest \
--output=json > xmrig-scan.json
This returns, among other things, clear indication of the presence of XMRig. Note that we store the output (xmrig-scan.json) for quick and easy manipulation:
Rules can also be cached to use next run by mounting a separate path and passing rules-path argument
docker run -i --rm --name=deepfence-yarahunter \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp:/home/deepfence/output \
-v /tmp/rules:/tmp/rules \
quay.io/deepfenceio/deepfence_malware_scanner_ce:2.5.8 \
--image-name metal3d/xmrig:latest \
--output=json \
--rules-path=/tmp/rules > xmrig-scan.json
# Extract the IOC array values. From these, extract the values of the 'Matched Rule Name' key
cat /tmp/xmrig-scan.json | jq '.IOC[] | ."Matched Rule Name"'
This returns a list of the IOCs identified in the container we scanned.
To get table formatted output omit --output=json flag
Get in touch
Thank you for using YaraHunter.
- Start with the documentation
- Got a question, need some help? Find the Deepfence team on Slack
Got a feature request or found a bug? Raise an issue
- productsecurity at deepfence dot io: Found a security issue? Share it in confidence
Security and Support
For any security-related issues in the YaraHunter project, contact productsecurity at deepfence dot io.
Please file GitHub issues as needed, and join the Deepfence Community Slack channel.
License
The Deepfence YaraHunter project (this repository) is offered under the Apache2 license.
Contributions to Deepfence YaraHunter project are similarly accepted under the Apache2 license, as per GitHub's inbound=outbound policy.
Disclaimer
This tool is not meant to be used for hacking. Please use it only for legitimate purposes like detecting indicator of compromise on the infrastructure you own, not on others' infrastructure. DEEPFENCE shall not be liable for loss of profit, loss of business, other financial loss, or any other loss or damage which may be caused, directly or indirectly, by the inadequacy of YaraHunter for any purpose or use thereof or by any defect or deficiency therein.