audit-container-iac
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/audit-container-iac
/audit-container-iac
Audit the current working directory for the Container & IaC Security dimension.
Paths in this file are relative to this skill's own directory (the folder that
contains this SKILL.md), not to the repository being audited. Run all detection
commands in the repository being audited (the current working directory).
审计当前工作目录的容器与 IaC 安全维度。
本文件中的路径相对于此 skill 自身的目录(包含此 SKILL.md 的文件夹),而不是被审计的仓库。在被审计的仓库(当前工作目录)中运行所有检测命令。
Inputs
输入
- Optional (JSON) injected by the orchestrator.
discovery_context - Optional output path (from the orchestrator): write the JSON there instead of printing it.
- Flags: (emit JSON only, no markdown summary).
--json
- 可选的 (JSON),由 orchestrator 注入。
discovery_context - 可选的输出路径(由 orchestrator 提供):将 JSON 写入该路径,而不是直接打印。
- 标志:(仅输出 JSON,不附加 markdown 摘要)。
--json
Steps
步骤
- Discovery: if was NOT injected, follow
discovery_contextand build it. If injected, use it as-is (do not re-run discovery).references/discovery.md - Filter: read . Drop any checklist item whose
references/detection/10-container-iac.mdshares no archetype withapplies_to→ emit it withdiscovery_context.archetypes.status: "skipped" - Detect (two-stage, spec §5a.2 / §9a.4):
a. For each applicable item, run its (ripgrep) to get candidate
signals. Prefer external-tool output if available. Do NOT read the whole repo. b. Read only candidate snippets; apply each item'sfile:linerule. Assign severity honoring any severity floors. Consultconfirmonly when a candidate is ambiguous.references/detection/examples/10-container-iac.md - Emit: produce one JSON object conforming to
AuditResultwithreferences/schema.json,audit: "container_iac", the checklist (with statuses), and findings. Leaveiso_characteristic: "Portability"asscore— the engine computes it.0- If an output path was given: write ONLY the JSON object to it (UTF-8), then reply
with one line: .
<audit key>: <n> findings -> <path> - With or as a subagent without an output path: output ONLY the JSON.
--json - Standalone: also print a short markdown summary (counts + top findings).
- If an output path was given: write ONLY the JSON object to it (UTF-8), then reply
with one line:
When invoked as a subagent, return only valid JSON — or, when an output path was
given, only the one-line confirmation.
- 发现:如果未注入 ,则遵循
discovery_context并构建它。如果已注入,则原样使用(不要重新运行发现过程)。references/discovery.md - 筛选:读取 。对于
references/detection/10-container-iac.md与applies_to不共享任何 archetype 的检查清单项,将其从适用项中移除 → 以discovery_context.archetypes输出。status: "skipped" - 检测(两阶段,spec §5a.2 / §9a.4):
a. 对每个适用项,运行其 (ripgrep)以获取候选
signals。如果可以使用外部工具的输出,优先使用该输出。切勿读取整个仓库。 b. 仅读取候选代码片段;应用每个检查项的file:line规则。确定严重性时,遵循所有 severity 下限。仅当候选项存在歧义时,才查阅confirm。references/detection/examples/10-container-iac.md - 输出:生成一个符合 的
references/schema.jsonJSON 对象,其中包含AuditResult、audit: "container_iac"、检查清单(包含各项状态)及 findings。将iso_characteristic: "Portability"保留为score——由 engine 计算。0- 如果提供了输出路径:将仅包含该 JSON 对象的文件以 UTF-8 写入该路径,然后回复一行:。
<audit key>: <n> findings -> <path> - 使用 或作为 subagent 且未提供输出路径时:仅输出 JSON。
--json - 独立运行时:另打印一份简短的 markdown 摘要(计数 + 主要 findings)。
- 如果提供了输出路径:将仅包含该 JSON 对象的文件以 UTF-8 写入该路径,然后回复一行:
作为 subagent 调用时,仅返回有效的 JSON;如果提供了输出路径,则仅返回一行确认信息。