Dockle
$ dockle 社区开源 低风险Dockle 对照 CIS Docker 基准检查容器镜像(来自 Docker 守护进程、OCI tar 包或远程仓库),识别以 root 运行、镜像层密钥泄露及冗余 apt 缓存等问题。支持通过 -f 输出 JSON 或 SARIF,并提供 --ignore 与 --no-color。
brew install goodwithtech/r/dockle dockle -f json 直接通过 Docker/OCI 接口检查本地镜像层与 tar 包,无需经由 MCP 传输动辄数 GB 的镜像数据。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
确定性的无头镜像检查器,支持 -f json|sarif、--ignore、--exit-code、--no-color 与 --input tar 包模式。
- Supports
-f json,-f sarif,--ignore,--no-color, and--input
严格只读的镜像层与配置检查器,绝不启动容器或修改镜像。
- Read-only image inspection without container execution
单一 Go 二进制文件,可通过 brew install goodwithtech/r/dockle 与 GitHub Releases 安装,支持无守护进程运行。
- Homebrew tap, binary releases, and daemonless
--inputtar support
与 Trivy/Grype 等 CVE 扫描器互补,快速发现 Dockerfile 配置缺陷与镜像层密钥残留。
- Fast CIS Docker Benchmark + secret layer checks
Goodwithtech 出品的成熟开源工具,功能稳定,近期迭代节奏相对放缓。
- Maintained at goodwithtech/dockle
GitHub README 清晰列出了所有 CIS-DI-* 与 DKL-* 检查项及 .dockleignore 用法。
- Checkpoint catalog in GitHub README
安全边界、鉴权与放权指南
通过本地 Docker 套接字或 ~/.docker/config.json / DOCKER_CONTENT_TRUST 访问私有镜像仓库。
100% 免费开源(Apache-2.0)。
# Dockle Agent Rules - Always pass `-f json --no-color` for machine parsing and prefer `--input <tar>` when no Docker daemon is running. - Use `--ignore <checkpoint-id>` only for documented exceptions rather than raising `--exit-level` blindly.
Agent 高频安全命令配方
只读查询(安全推荐)
dockle -f json --no-color nginx:latest
对照 CIS 容器规则检查 nginx:latest 并向 stdout 打印结构化 JSON 结果。
dockle --input image.tar --ignore CIS-DI-0001 -f sarif -o dockle.sarif
无需 Docker 守护进程即可审计本地 image.tar 归档,忽略 CIS-DI-0001 并写入 SARIF 报告。
核心优势
- + 无守护进程
--input image.tar模式配合-f json/-f sarif可在沙箱 CI/Agent 中干净运行。 - + 能捕获 CVE 扫描器忽略的容器卫生问题(root 用户、
ADD替代COPY、环境变量泄露)。
注意事项与踩坑点
- ! Homebrew 需使用
goodwithtech/r/dockleTap 安装。 - ! 上游发版频率相较新版 Trivy 配置检查有所放缓。