security-audit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSecurity Audit
安全审计
Purpose
目的
This skill reads and reports. It never writes. No file edit, no write, no
GitHub issue, no invocation of another skill on the user's behalf. It detects security gaps
across whichever areas a repository exposes, aggregates them into one severity-ordered
report, and hands off. Every command it produces is report text for a human or a
downstream skill to run — the audit never executes one.
gh apigh apimaintain:repo-hardeninggh apiRead-only is what makes this skill safe to run anywhere, including on a repo the user does
not own. Keep it that way: a new audit area adds a checklist under and a
prompt in , never a mutation.
references/references/subagent-prompts.mdAudit areas currently implemented:
| Area | Checklist |
|---|---|
GitHub Actions workflows under | |
Release configuration ( | |
| Repository settings via the GitHub REST API (Actions defaults, rulesets, security features, immutable releases, deploy environments) | |
| Package manager and install-time controls, pnpm and bun only (lifecycle-script allowlists, release-age gates, scope→registry mapping) | |
| Application source code (injection and unsafe-execution vectors) | |
Not yet implemented: non-GitHub CI providers (CircleCI, GitLab CI), container security
(Dockerfiles, base-image pinning), committed-secret scanning beyond GitHub's native
feature, runtime config (CSP, CORS, security headers), dependency policy (license
allowlist, banned packages).
For dependency CVE scanning specifically, use , , or
directly — this skill does not duplicate that.
gh dependabot alertsnpm auditpnpm auditBoundary with . Both read , split by consequence. This skill
owns the security surface: action pinning, , ,
, OIDC, third-party action sources, and cache poisoning or cross-branch
scope. owns performance, spend, and gating correctness — the job graph, cache hit
rate, matrix design, , artifact retention, and . Action pinning is
graded here and only here, so the same line of YAML never gets two severities. When finds
a required check name that no workflow produces, it hands the observation over, because reconciling
rulesets against triggers needs the calls only this skill makes.
audit:ci-audit.github/workflows/permissions:persist-credentialspull_request_targetci-audittimeout-minutesconcurrencyci-auditgh api本技能仅读取和报告,绝不执行写入操作。 不会编辑文件、不会通过执行写入操作、不会创建GitHub Issue、不会代表用户调用其他技能。它会检测仓库各领域存在的安全漏洞,将结果汇总为按严重程度排序的报告后交付。生成的所有命令均为报告文本,供人工或下游技能执行——审计过程中绝不会自行执行这些命令。
gh apigh apimaintain:repo-hardeninggh api只读特性让本技能可在任何环境安全运行,包括用户不拥有的仓库。请保持这一特性:新增审计领域时,只需在下添加检查清单,并在中添加提示,绝不执行任何修改操作。
references/references/subagent-prompts.md当前已实现的审计领域:
| 领域 | 检查清单 |
|---|---|
| |
发布配置( | |
| 通过GitHub REST API获取的仓库设置(Actions默认值、规则集、安全功能、不可变发布、部署环境) | |
| 包管理器及安装时控制,仅支持pnpm和bun(生命周期脚本白名单、发布时长限制、作用域→注册表映射) | |
| 应用源代码(注入和不安全执行风险点) | |
**尚未实现的功能:**非GitHub CI提供商(CircleCI、GitLab CI)、容器安全(Dockerfile、基础镜像固定)、超出GitHub原生功能的已提交密钥扫描、运行时配置(CSP、CORS、安全头)、依赖策略(许可证白名单、禁用包)。
针对依赖项CVE扫描,请直接使用、或——本技能不会重复该功能。
gh dependabot alertsnpm auditpnpm audit与的边界划分两者都会读取,但关注的影响不同。本技能负责安全层面:操作固定、、、、OIDC、第三方操作源,以及缓存投毒或跨分支范围问题。负责性能、成本和正确性校验——作业图、缓存命中率、矩阵设计、、工件保留和。操作固定仅在本技能中评估,因此同一段YAML不会被标记两个严重程度。当发现某个规则集要求的检查名称没有任何工作流生成时,会将该观察结果移交本技能,因为需要通过本技能的调用来协调规则集与触发器的匹配。
audit:ci-audit.github/workflows/permissions:persist-credentialspull_request_targetci-audittimeout-minutesconcurrencyci-auditgh apiWhen to Use
使用场景
Use when the user asks to:
- "Audit security" / "security audit"
- "Check supply chain" / "review for supply-chain attacks"
- "Harden CI" or "harden actions" — audit first, then hand off to
repo-hardening - "Audit release workflow" / "audit npm publishing"
- "Harden settings" / "audit rulesets" / "audit repo settings"
- "Audit install scripts" / "audit lifecycle scripts" / "audit package manager"
Trigger phrases: , , , , , , , , , , , , , .
security auditsupply chainci hardeningharden actionsaudit releaseharden settingsaudit rulesetsaudit install scriptsaudit package managerminimum release ageallowBuildsstaged publishingpwn requestsha pinningNot for:
- Applying the fixes →
maintain:repo-hardening - Bug hunting on a diff → ; style and comment noise →
review:changes-reviewreview:code-cleanup - CI speed/parallelization →
audit:ci-audit - Dependency CVE scanning → run /
gh dependabot alertsdirectlypnpm audit
当用户提出以下需求时使用:
- "审计安全" / "安全审计"
- "检查供应链" / "审查供应链攻击风险"
- "加固CI"或"加固Actions"——先审计,再移交处理
repo-hardening - "审计发布工作流" / "审计npm发布"
- "加固设置" / "审计规则集" / "审计仓库设置"
- "审计安装脚本" / "审计生命周期脚本" / "审计包管理器"
触发关键词:、、、、、、、、、、、、、。
security auditsupply chainci hardeningharden actionsaudit releaseharden settingsaudit rulesetsaudit install scriptsaudit package managerminimum release ageallowBuildsstaged publishingpwn requestsha pinning不适用场景:
- 修复漏洞 → 使用
maintain:repo-hardening - 代码差异漏洞排查 → 使用;代码风格和注释优化 → 使用
review:changes-reviewreview:code-cleanup - CI速度/并行化优化 → 使用
audit:ci-audit - 依赖项CVE扫描 → 直接运行/
gh dependabot alertspnpm audit
Asking the User
与用户交互
Every question in this skill is written as options. Use that tool where
the host offers it, or the host's nearest structured-choice equivalent. Where the host has
neither, ask the same question in normal chat as a numbered list of 2–5 options —
recommended first, one short line of description each — and wait for the user to reply
with a number.
AskUserQuestion本技能中的所有问题均以选项形式编写。如果宿主环境提供该工具,请使用它;否则使用宿主环境最接近的结构化选择功能。如果两者都没有,请以普通聊天形式提出问题,列出2-5个带编号的选项——推荐选项放在首位,每个选项配简短描述——等待用户回复编号。
AskUserQuestionWorkflow
工作流程
Step 1: Detect Repo Layout
步骤1:检测仓库布局
Run in parallel. Every command here is a read:
bash
ls .github/workflows/ 2>/dev/null
cat .github/dependabot.yml 2>/dev/null
jq '{name, packageManager, trustedDependencies, scripts: (.scripts | keys), publishConfig, private}' package.json 2>/dev/null
ls package-lock.json pnpm-lock.yaml yarn.lock bun.lock bun.lockb 2>/dev/null
cat pnpm-workspace.yaml 2>/dev/null
cat bunfig.toml 2>/dev/null
cat .npmrc 2>/dev/null
gh api repos/<owner>/<repo>/actions/permissions 2>/dev/null
gh api repos/<owner>/<repo>/actions/permissions/workflow 2>/dev/null
gh api repos/<owner>/<repo>/rulesets 2>/dev/null
gh api repos/<owner>/<repo>/immutable-releases 2>/dev/null
gh api repos/<owner>/<repo> --jq '{private, default_branch, security_and_analysis}' 2>/dev/nullResolve from . If the API calls fail with or auth errors, note it — repo-settings findings will be skipped for that area.
<owner>/<repo>gh repo view --json nameWithOwner --jq .nameWithOwner404Extract org-scope context for Subagent D (compute in the orchestrator, then substitute):
- — derived from
org_prefixpackage.json. If the name isname:, the prefix is@<prefix>/<pkg>. If the name is unscoped, leave<prefix>empty (no org scopes will be flagged).org_prefix - — given a non-empty
org_scope_patterns, owned scopes areorg_prefixAND any scope matching@<prefix>/*(e.g., for@<prefix>-*/*:enonic,@enonic/*,@enonic-types/*).@enonic-cli/* - — union of:
already_covered_scopesfromminimumReleaseAgeExclude(usepnpm-workspace.yaml),yqfromminimumReleaseAgeExcludes,bunfig.tomlkeys fromregistries:,pnpm-workspace.yamlkeys from[install.scopes], andbunfig.tomllines from@<scope>:registry=..npmrc
These pre-approve scopes the team has already decided to trust. Subagent D treats them as covered and emits no finding for missing config.
Default posture: deny everything. Subagent D flags missing exclude/registry config only for owned scopes (matching ) that appear in the lockfile and are not in . All other scopes stay under the release-age and dependency-confusion gates — that is the intended hardening. If is empty, no scope-specific findings are emitted.
org_scope_patternsalready_covered_scopesorg_prefixExtract release-target context for Subagent B (compute in the orchestrator, then substitute):
- —
release_publishes_to_npmif any of these exist (the audit does not care WHICH non-npm publisher is used, only whether npm is involved): atrue/release.ymlinrelease.yamlcontaining a literal.github/workflows/,npm publish,npm stage publish,pnpm publish, oryarn publish; abun publishfield inpublishConfig.registry; or apackage.jsonvalue containing any of those commands.scripts.publish - — assembled from root file presence:
detected_build_systemsifnpm+ any lockfile,package.jsonifgradle/build.gradle,build.gradle.ktsifmaven,pom.xmlifcargo,Cargo.tomlifpip/requirements.txt,pyproject.tomlifdocker.Dockerfileis always added whengithub-actionsexists. This drives item 7 (dependabot ecosystem coverage) so the audit recommends the right ecosystems regardless of stack..github/workflows/
Routing. Skip the Actions subagent if is absent. Skip the Release subagent unless one of these holds: a / exists, has , or has any of , , . If is absent or , note it — release findings about provenance change severity. Dispatch the Package Manager subagent if any lockfile exists — including or , where its whole job is the one out-of-scope finding (the audit supports pnpm and bun only) rather than a tuning pass. Dispatch the Repo Settings subagent if returns HTTP 200; skip only on or auth error. An empty from is success — Subagent C treats the absence of rulesets as a finding, not a reason to skip. Skip the code subagent on a configuration-only or docs-only repo.
.github/workflows/release.ymlrelease.yamlpackage.jsonpublishConfigpackage.jsonscriptspublishreleaseprepublishOnlypackage.jsonprivate: truepackage-lock.jsonyarn.lockgh api .../actions/permissions404[]/rulesets并行执行以下命令,所有命令均为读取操作:
bash
ls .github/workflows/ 2>/dev/null
cat .github/dependabot.yml 2>/dev/null
jq '{name, packageManager, trustedDependencies, scripts: (.scripts | keys), publishConfig, private}' package.json 2>/dev/null
ls package-lock.json pnpm-lock.yaml yarn.lock bun.lock bun.lockb 2>/dev/null
cat pnpm-workspace.yaml 2>/dev/null
cat bunfig.toml 2>/dev/null
cat .npmrc 2>/dev/null
gh api repos/<owner>/<repo>/actions/permissions 2>/dev/null
gh api repos/<owner>/<repo>/actions/permissions/workflow 2>/dev/null
gh api repos/<owner>/<repo>/rulesets 2>/dev/null
gh api repos/<owner>/<repo>/immutable-releases 2>/dev/null
gh api repos/<owner>/<repo> --jq '{private, default_branch, security_and_analysis}' 2>/dev/null通过解析。如果API调用返回或认证错误,请记录该情况——对应领域的仓库设置审计结果将被跳过。
gh repo view --json nameWithOwner --jq .nameWithOwner<owner>/<repo>404为Subagent D提取组织作用域上下文(在编排器中计算后替换):
- — 从
org_prefix的package.json字段派生。如果名称为name:,则前缀为@<prefix>/<pkg>。如果名称无作用域,则<prefix>留空(不会标记任何组织作用域问题)。org_prefix - — 当
org_scope_patterns非空时,可信作用域为org_prefix以及所有匹配@<prefix>/*的作用域(例如,对于@<prefix>-*/*:enonic、@enonic/*、@enonic-types/*)。@enonic-cli/* - — 以下内容的并集:
already_covered_scopes中的pnpm-workspace.yaml(使用minimumReleaseAgeExclude提取)、yq中的bunfig.toml、minimumReleaseAgeExcludes中的pnpm-workspace.yaml键、registries:中的bunfig.toml键,以及[install.scopes]中的.npmrc行。@<scope>:registry=
这些是团队已决定信任的预批准作用域。Subagent D会将它们视为已覆盖,不会针对缺失配置发出警报。
默认策略:拒绝所有Subagent D仅针对锁定文件中存在且未包含在内的、匹配的自有作用域,标记缺失的排除/注册表配置。所有其他作用域均受发布时长限制和依赖混淆防护——这是预期的加固效果。如果为空,则不会发出任何作用域相关的审计结果。
already_covered_scopesorg_scope_patternsorg_prefix为Subagent B提取发布目标上下文(在编排器中计算后替换):
- — 如果存在以下任一情况则为
release_publishes_to_npm(审计不关心使用的是非npm的哪个发布工具,仅关心是否涉及npm):true中的.github/workflows//release.yml包含字面量release.yaml、npm publish、npm stage publish、pnpm publish或yarn publish;bun publish中有package.json字段;或publishConfig.registry的package.json值包含上述任一命令。scripts.publish - — 根据根目录文件存在情况汇总:如果有
detected_build_systems+任意锁定文件则为package.json;如果有npm/build.gradle则为build.gradle.kts;如果有gradle则为pom.xml;如果有maven则为Cargo.toml;如果有cargo/requirements.txt则为pyproject.toml;如果有pip则为Dockerfile。当docker存在时,始终添加.github/workflows/。这用于驱动第7项(dependabot生态系统覆盖),以便审计无论技术栈如何都能推荐正确的生态系统。github-actions
路由规则如果不存在,则跳过Actions子代理。仅当以下任一条件满足时才运行Release子代理:存在/、有、或的包含、、中的任意一个。如果不存在或,请记录该情况——关于发布来源的审计结果严重程度会调整。如果存在任意锁定文件(包括或,此时其唯一任务是标记一个超出范围的结果:审计仅支持pnpm和bun),则调度Package Manager子代理。如果返回HTTP 200,则调度Repo Settings子代理;仅在返回或认证错误时跳过。返回空数组视为成功——Subagent C会将规则集缺失视为审计结果,而非跳过的理由。如果是仅配置或仅文档的仓库,则跳过代码子代理。
.github/workflows/release.ymlrelease.yamlpackage.jsonpublishConfigpackage.jsonscriptspublishreleaseprepublishOnlypackage.jsonprivate: truepackage-lock.jsonyarn.lockgh api .../actions/permissions404/rulesets[]Step 2: Dispatch Audit Subagents in Parallel
步骤2:并行调度审计子代理
Read . It holds one prompt per audit area, the placeholder
substitution table, and the rule that no subagent mutates anything.
references/subagent-prompts.mdDispatch one subagent per applicable audit area, concurrently if the host allows it. If
the host has no subagent facility, run each area sequentially inline using the same prompts.
Substitute every placeholder before dispatch — in particular, since
subagents are spawned with the user's CWD and relative checklist paths will not otherwise
resolve.
{{SKILL_DIR}}As new audit areas are added under , add the matching prompt to that file. No
change to Step 3 or Step 4 is needed.
references/阅读。该文件包含每个审计领域的调度提示、占位符替换表,以及子代理不得执行任何修改操作的规则。
references/subagent-prompts.md如果宿主环境允许,为每个适用的审计领域同时调度一个子代理。如果宿主环境无子代理功能,则按顺序依次运行每个领域的审计,使用相同的提示。调度前替换所有占位符——尤其是,因为子代理在用户的当前工作目录启动,相对路径的检查清单无法自行解析。
{{SKILL_DIR}}当下新增审计领域时,在该文件中添加对应的提示即可,无需修改步骤3或步骤4。
references/Step 3: Aggregate Findings
步骤3:汇总审计结果
Wait for all dispatched subagents. Apply the four aggregation rules, then assemble the
report. Severities come from — use it to reconcile any
disagreement between subagents on the same finding shape.
references/severity-table.mdAggregation rule 1 — Pin-status cross-check (A ↔ C). Reconcile Subagent A's pin findings with Subagent C's report:
sha_pinning_required- A reports zero pin findings (every is SHA-pinned) AND C reports
uses:→ emit high: "All actions are SHA-pinned butsha_pinning_required: falseis off. Enable to prevent regression:sha_pinning_required."gh api -X PUT /repos/<owner>/<repo>/actions/permissions -F sha_pinning_required=true - A has pin findings AND C reports → do NOT additionally flag the setting. The issue is the unpinned actions (already in A's report). In "Already hardened" add: "
sha_pinning_required: falsecannot be enabled until A's pin findings are fixed — re-run the audit afterward."sha_pinning_required - C reports → "Already hardened:
sha_pinning_required: trueenforced."sha_pinning_required
Aggregation rule 2 — Required-status-check coverage (A ↔ C). For each entry in C's map, for each , for each :
{ruleset_id, protected_branches, required_checks}RULESET_REQUIRED_CHECKSrequired_checkprotected_branch- Find workflow(s) in A's whose
WORKFLOW_TRIGGER_MAPmatchesname:.required_check - If no workflow matches the name, OR none of the matching workflows trigger on (check both
protected_branchandpush_branches; treatpr_branchesas matching any branch), emit high: "Required check*on branch<check>(ruleset<branch>) is not produced by any workflow triggering on that branch. PRs to<id>will be permanently BLOCKED. Either add the branch to the workflow's<branch>/on.push.branches, or remove the check from the ruleset'son.pull_request.branches."required_status_checks
Aggregation rule 3 — Pass collation. Each subagent's report ends with a "passes" / "already hardened" section. Concatenate these into , prefixed with the source subagent: , , . For each subagent skipped per Step 1 routing, add instead: .
### Already hardened[Actions] persist-credentials: false on all checkouts[Repo Settings] secret_scanning enabled[Package Manager] minimumReleaseAge: 4320 with Strict: true[<area>] Skipped — <reason>Aggregation rule 4 — Sequencing hints. If any finding pair has a "fix A before C is actionable" relationship (rule 1's second case is canonical; the rule-2 BLOCKED-PR finding depends on the ruleset existing at all; D's fix may break installs until paired with ), surface the ordering in a final section: Render the section only if at least one relationship exists.
allowBuildsstrictDepBuilds### Sequencing1. Apply [Actions] findings → 2. Re-run audit → 3. Apply [Repo Settings] sha_pinning_required recommendation.Weighting. is the privileged target — weight findings there above equivalent findings in ordinary CI.
release.ymlReport skeleton:
markdown
undefined等待所有子代理完成。应用以下四条汇总规则,然后生成报告。严重程度来自——用于协调子代理对同一类型结果的严重程度分歧。
references/severity-table.md**汇总规则1——固定状态交叉校验(A ↔ C)**协调Subagent A的操作固定结果与Subagent C的报告:
sha_pinning_required- A报告无固定问题(所有均已通过SHA固定)且C报告
uses:→ 标记为高风险:"所有Actions均已通过SHA固定,但sha_pinning_required: false未启用。请启用以防止回归:sha_pinning_required。"gh api -X PUT /repos/<owner>/<repo>/actions/permissions -F sha_pinning_required=true - A报告有固定问题且C报告→ 不要额外标记该设置。问题在于未固定的Actions(已在A的报告中)。在"已加固项"中添加:"
sha_pinning_required: false需在修复A的固定问题后才能启用——修复后重新运行审计。"sha_pinning_required - C报告→ "已加固项:
sha_pinning_required: true已强制启用。"sha_pinning_required
**汇总规则2——必填状态检查覆盖校验(A ↔ C)**对于C的映射中的每个条目,针对每个和每个:
RULESET_REQUIRED_CHECKS{ruleset_id, protected_branches, required_checks}required_checkprotected_branch- 在A的中查找名称与
WORKFLOW_TRIGGER_MAP匹配的工作流。required_check - 如果没有匹配名称的工作流,或匹配的工作流均未在上触发(检查
protected_branch和push_branches;pr_branches视为匹配任意分支),标记为高风险:"分支*上的必填检查<branch>(规则集<check>)没有任何工作流在该分支上触发。向<id>提交PR将被永久阻止。请将该分支添加到工作流的<branch>/on.push.branches中,或从规则集的on.pull_request.branches中移除该检查。"required_status_checks
汇总规则3——通过项合并每个子代理的报告末尾都有"通过" / "已加固"部分。将这些内容合并到中,并添加来源子代理前缀:、、。对于步骤1路由中跳过的子代理,添加:。
### 已加固项[Actions] 所有checkout均设置persist-credentials: false[Repo Settings] secret_scanning已启用[Package Manager] minimumReleaseAge: 4320且Strict: true[<领域>] 已跳过——<原因>汇总规则4——修复顺序提示如果任意结果对存在"先修复A才能处理C"的关系(规则1的第二种情况为典型案例;规则2中的PR被阻止结果依赖于规则集本身存在;D的修复可能会在配合之前导致安装失败),则在最终的部分说明:仅当存在至少一个此类关系时才显示该部分。
allowBuildsstrictDepBuilds### 修复顺序1. 应用[Actions]的修复建议 → 2. 重新运行审计 → 3. 应用[Repo Settings]的sha_pinning_required建议。权重优先级是重点审计目标——该文件中的结果权重高于普通CI中的同类结果。
release.yml报告框架:
markdown
undefinedSecurity Audit Report
安全审计报告
<one-line summary: areas audited, areas skipped>
<一行摘要:已审计领域、已跳过领域>
Critical
严重
High
高风险
Medium
中风险
Low / Informational
低风险 / 信息提示
Already hardened
已加固项
- [Actions] ...
- [Release] Skipped — <reason>
- [Actions] ...
- [Release] 已跳过——<原因>
Sequencing
修复顺序
- ...
Sort findings within each severity bin worst-first (most exploitable first; policy findings after CVE-rated findings of the same severity). Keep file:line / API-path references intact from each subagent's report.- ...
每个严重程度分类内的结果按风险从高到低排序(最易被利用的排在前面;同一严重程度下,策略类结果排在CVE评级结果之后)。保留子代理报告中的文件:行号 / API路径引用。Step 4: Hand Off Findings
步骤4:交付审计结果
The audit stops here. Step 4 produces two artifacts side by side — a task queue for
downstream work, and a Planned Changes report for the user to read. Do not edit files, run
writes, create issues, or invoke ,
, , or any other skill on the user's behalf.
gh api/maintain:repo-hardening/build:fix-and-reverify/plan:issue-flowHosts differ in whether they have a task tracker; where none exists, the Planned Changes
report is the handoff and the options below collapse to option 4.
Ask, per Asking the User:
- (Recommended) — one task per finding, plus the report below
Emit tasks + planned-changes report - — same as 1, with
Emit tasks flagged for issue filingmetadataintended_action: file_issue - — one task summarising all findings, suitable for a single tracking issue
Emit a single summary task Skip — just the report
All four options render the Planned Changes report (so the user always sees the change plan and revert commands). Options 1–3 additionally emit tasks.
审计到此结束。步骤4会生成两个并行交付物——下游工作的任务队列,以及供用户阅读的计划变更报告。不得编辑文件、执行写入操作、创建Issue,或代表用户调用、、或任何其他技能。
gh api/maintain:repo-hardening/build:fix-and-reverify/plan:issue-flow不同宿主环境的任务跟踪能力不同;如果没有任务跟踪功能,计划变更报告即为交付物,以下选项将简化为选项4。
根据与用户交互规则询问:
- (推荐)——每个结果对应一个任务,加上下方的报告
生成任务 + 计划变更报告 - ——与选项1相同,但添加
生成标记为需创建Issue的任务元数据intended_action: file_issue - ——一个汇总所有结果的任务,适合作为单个跟踪Issue
生成单个汇总任务 跳过任务——仅生成报告
所有四个选项都会生成计划变更报告(因此用户始终能看到变更计划和回滚命令)。选项1–3还会额外生成任务。
Task emission rules (options 1, 2, 3)
任务生成规则(选项1、2、3)
Skip this subsection entirely when the host has no task tracker.
- One task per finding from the Step 3 report (options 1, 2). For option 3, emit a single task whose description is a numbered list of all findings.
- : short finding title (e.g., "Pin
subjectto SHA").actions/checkout@v6 - : severity (including any
descriptionqualifier), source subagent ((policy),[Actions],[Release],[Repo Settings],[Package Manager]), file:line or API path, the exact remediation snippet from the report.[Code] - : minimum set —
metadata,severity,source_area(change_kindfor file edits /codeforserver_statewrites),gh api(intended_action/fix/file_issue). Keep metadata light — the task queue is a handoff, not the audit's persistence layer.summary - Sequencing: for any pair from Step 3's section, record the downstream task as blocked by the upstream one, using whatever dependency field the host's tracker exposes. If it has none, state the ordering in the task description.
### Sequencing - Emit tasks worst-first within each severity, matching the report's order.
如果宿主环境没有任务跟踪功能,请完全跳过本小节。
- 步骤3报告中的每个结果对应一个任务(选项1、2)。对于选项3,生成一个单个任务,其描述为所有结果的编号列表。
- :简短的结果标题(例如,"将
subject固定到SHA")。actions/checkout@v6 - :严重程度(包括任何
description限定符)、来源子代理((policy)、[Actions]、[Release]、[Repo Settings]、[Package Manager])、文件:行号或API路径、报告中的具体修复代码片段。[Code] - :最小集合——
metadata、severity、source_area(change_kind表示文件编辑 /code表示server_state写入)、gh api(intended_action/fix/file_issue)。保持元数据简洁——任务队列是交付物,而非审计的持久层。summary - 修复顺序:对于步骤3部分中的任意结果对,将下游任务标记为依赖上游任务,使用宿主跟踪工具支持的依赖字段。如果没有该字段,则在任务描述中说明顺序。
### 修复顺序 - 任务按严重程度从高到低排序,与报告顺序一致。
Planned Changes report
计划变更报告
Render directly in the chat output, grouped by source area. It is the audit's plan-of-record,
not an execution transcript — phrasing matters. Use and
(never ), because the audit does not observe what actually runs.
Code edits get one line; server-state changes get three.
Recommended command:Revert command:Applied:markdown
undefined直接在聊天输出中渲染,按来源领域分组。这是审计的正式计划,而非执行记录——措辞很重要。使用和(绝不要使用),因为审计不会监控实际执行的操作。代码编辑用一行描述;服务器状态变更用三行描述。
推荐命令:回滚命令:已应用:markdown
undefinedSecurity Audit — Planned Changes
安全审计——计划变更
Plan-of-record (not an execution transcript). Render of the Step 3 findings as code edits and calls a downstream skill or human will apply.
gh api正式计划(非执行记录)。将步骤3的结果渲染为代码编辑和调用,供下游技能或人工执行。
gh api[Actions] (N planned changes)
[Actions](计划N项变更)
- — pin 6
.github/workflows/ci.ymllines viauses:pinact run - — add workflow-level
.github/workflows/release.ymlpermissions: contents: read
- — 通过
.github/workflows/ci.yml固定6个pinact run行uses: - — 添加工作流级别的
.github/workflows/release.ymlpermissions: contents: read
[Release] (N planned changes)
[Release](计划N项变更)
- (or: "No changes planned — audit area skipped per Step 1 routing")
-(或:"无计划变更——根据步骤1路由规则跳过该审计领域")
[Repo Settings] (N planned changes)
[Repo Settings](计划N项变更)
- Set on <owner>/<repo>
default_workflow_permissions: read- Recommended command:
gh api -X PUT /repos/<owner>/<repo>/actions/permissions/workflow -f default_workflow_permissions=read -F can_approve_pull_request_reviews=false - Revert command:
gh api -X PUT /repos/<owner>/<repo>/actions/permissions/workflow -f default_workflow_permissions=write -F can_approve_pull_request_reviews=true
- Recommended command:
- Enable immutable releases on <owner>/<repo>
- Recommended command:
gh api -X PUT /repos/<owner>/<repo>/immutable-releases - Revert command:
gh api -X DELETE /repos/<owner>/<repo>/immutable-releases
- Recommended command:
- 在<owner>/<repo>上设置
default_workflow_permissions: read- 推荐命令:
gh api -X PUT /repos/<owner>/<repo>/actions/permissions/workflow -f default_workflow_permissions=read -F can_approve_pull_request_reviews=false - 回滚命令:
gh api -X PUT /repos/<owner>/<repo>/actions/permissions/workflow -f default_workflow_permissions=write -F can_approve_pull_request_reviews=true
- 推荐命令:
- 在<owner>/<repo>上启用不可变发布
- 推荐命令:
gh api -X PUT /repos/<owner>/<repo>/immutable-releases - 回滚命令:
gh api -X DELETE /repos/<owner>/<repo>/immutable-releases
- 推荐命令:
[Package Manager] (N planned changes)
[Package Manager](计划N项变更)
- — add
pnpm-workspace.yaml,minimumReleaseAge: 4320minimumReleaseAgeStrict: true
- — 添加
pnpm-workspace.yaml、minimumReleaseAge: 4320minimumReleaseAgeStrict: true
Deferred or skipped (informational)
延迟处理或已跳过(信息提示)
- [Actions] finding in
pull_request_target— flagged asci-fork.yml, no fix plannedinformational - [Repo Settings] — depends on
sha_pinning_requiredpin changes per Step 3 sequencing[Actions]
**Format rules:**
- Every area gets a section, even if empty, so the user can see which areas had nothing to apply or were skipped.
- Code edits are one line: file path + short description. No `Recommended command:` block — the edit content lives in the task description.
- Server-state changes are three lines: title, `Recommended command:`, `Revert command:`. Both are the literal `gh api` invocations from the Step 3 finding.
- A `### Deferred or skipped` section captures anything not fixed (informational items, sequencing-blocked items). Nothing is silently dropped.- [Actions] 中的
ci-fork.yml结果——标记为pull_request_target,无计划修复信息提示 - [Repo Settings] ——需等待[Actions]的固定变更完成(根据步骤3的修复顺序)
sha_pinning_required
**格式规则:**
- 每个领域都要有一个章节,即使为空,以便用户了解哪些领域无需变更或已被跳过。
- 代码编辑用一行描述:文件路径 + 简短说明。无需`推荐命令:`块——编辑内容在任务描述中。
- 服务器状态变更用三行描述:标题、`推荐命令:`、`回滚命令:`。两者均为步骤3结果中的字面量`gh api`调用。
- `### 延迟处理或已跳过`章节包含所有未修复的内容(信息提示项、受顺序限制的项)。不得遗漏任何内容。Handoff line
交付提示语
After rendering the report and emitting tasks, print one of:
- Option 1: "N tasks emitted. Run for the
/maintain:repo-hardeningchanges, orgh apito walk through the file edits."/build:fix-and-reverify - Option 2: "N tasks emitted with flag. Run
file_issueper task when you're ready."/plan:issue-flow - Option 3: "Single summary task emitted. Run to file it as a tracking issue."
/plan:issue-flow - Option 4: "No tasks emitted; the report above is the full audit output."
Then stop. Do not invoke any of those skills yourself.
渲染报告并生成任务后,打印以下其中一条:
- 选项1:"已生成N个任务。如需执行变更,请运行
gh api;如需逐步完成文件编辑,请运行/maintain:repo-hardening。"/build:fix-and-reverify - 选项2:"已生成N个标记为的任务。准备就绪后,针对每个任务运行
file_issue。"/plan:issue-flow - 选项3:"已生成单个汇总任务。运行将其创建为跟踪Issue。"
/plan:issue-flow - 选项4:"未生成任务;上述报告为完整审计输出。"
然后停止操作。不得自行调用上述任何技能。
References
参考文件
| File | Contents |
|---|---|
| Dispatch prompt per audit area, plus the placeholder substitution table |
| Severity per finding shape; the release-age gate's four units |
| Detection, severity, and fix for each workflow check |
| Release trigger, provenance, staged publishing, artifact identity |
| Exact |
| Per-manager field names, units, defaults, and fix examples |
| Frozen-lockfile and |
| Injection and unsafe-execution vectors by stack |
| 文件 | 内容 |
|---|---|
| 每个审计领域的调度提示,以及占位符替换表 |
| 每种结果类型的严重程度;发布时长限制的四种单位 |
| 每个工作流检查项的检测方法、严重程度和修复方案 |
| 发布触发器、来源验证、分阶段发布、工件标识 |
| 精确的 |
| 各包管理器的字段名称、单位、默认值和修复示例 |
| 各包管理器的冻结锁定文件和 |
| 各技术栈的注入和不安全执行风险点 |