跳转到正文
报告库
用途分类 / 其他用途

Multi Stage Dockerfile Skill 安全审计

作者说它能做什么(原文)

Create optimized multi-stage Dockerfiles for any language or framework

第三方安全检查结论

发现安全风险

已检查文件
1
发现的风险
1
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。发现 1 项风险
中风险

版本标签并不能保证基础镜像可复现

原文依据:1 处
发现了什么

Skill 声称 `python:3.11-slim` 这样的版本标签能够确保可复现构建,但容器标签通常可被发布方重新指向不同镜像。这里没有要求固定不可变的镜像摘要。

为什么需要注意

同一 Dockerfile 在不同时间可能拉取不同代码和系统包;如果上游标签被错误更新或供应链遭到破坏,构建还可能执行未预期的基础镜像内容。

该指引把 `python:3.11-slim` 之类的标签描述为能够“确保”可复现构建,但此类标签不是不可变标识:发布方更新对应镜像后,相同 Dockerfile 可能获取不同内容。若用户依赖这一说法进行供应链或漏洞审计,构建结果可能在未修改 Dockerfile 时发生变化。用户可要求作者改为固定镜像摘要(digest),并说明标签仅用于版本约束。

SKILL.md:19来自说明文档打开原文件
- Start with official, minimal base images when possible- Specify exact version tags to ensure reproducible builds (e.g., `python:3.11-slim` not just `python`)- Consider distroless images for runtime stages where appropriate
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。未发现风险
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。未发现风险
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

5 个说明模块

该 Skill 指导将构建、依赖安装和测试放入前置阶段,并只把运行所需产物复制到最终镜像,以减少最终镜像包含的工具和文件。

查看原文
SKILL.md:10来自说明文档打开原文件
- Use a builder stage for compilation, dependency installation, and other build-time operations- Use a separate runtime stage that only includes what's needed to run the application- Copy only the necessary artifacts from the builder stage to the runtime stage- Use meaningful stage names with the `AS` keyword (e.g., `FROM node:18 AS builder`)- Place stages in logical order: dependencies → build → test → runtime

它建议使用官方精简基础镜像、非 root 用户、限制文件权限,并避免把构建工具和构建秘密带入最终镜像。

查看原文
SKILL.md:18来自说明文档打开原文件
- Start with official, minimal base images when possible- Specify exact version tags to ensure reproducible builds (e.g., `python:3.11-slim` not just `python`)- Consider distroless images for runtime stages where appropriate- Use Alpine-based images for smaller footprints when compatible with your application- Ensure the runtime image has the minimal necessary dependencies
SKILL.md:34来自说明文档打开原文件
- Avoid running containers as root - use `USER` instruction to specify a non-root user- Remove build tools and unnecessary packages from the final image- Scan the final image for vulnerabilities- Set restrictive file permissions- Use multi-stage builds to avoid including build secrets in the final image
从这里开始 · 工作说明SKILL.md
multi-stage-dockerfile
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。
文件与检查记录1 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明
读取了多少行
47
文件校验值(用于核对版本)
e4ea8df9d1f0f65f43afd84b10e1aee86c820eef1091781e7225b8df3288eae6