Loading...
Loading...
Compare original and translation side by side
.github/workflows/concurrency.github/workflows/.gitlab-ci.yml.github/workflows/concurrency.github/workflows/.gitlab-ci.ymlsecurity-audit| This skill | |
|---|---|
| Performance, spend, and gating correctness | The security surface |
| Cache hit rate — key derivation, fallbacks | Cache poisoning and cross-branch scope |
| Whether a required check can fail the run | Whether a workflow can be made to run attacker code |
| Job graph, matrix design, artifact flow | |
| — | Action pinning: SHA vs tag vs branch, with severities |
security-auditgh apisecurity-audit| 本技能 | |
|---|---|
| 性能、成本开销与门控正确性 | 安全面 |
| 缓存命中率——键值推导、降级策略 | 缓存投毒与跨分支作用域 |
| 必填检查是否能终止流水线运行 | 工作流是否可被攻击者利用执行恶意代码 |
| 作业图、矩阵设计、制品流转 | |
| — | Action版本固定:SHA、标签、分支对比及风险等级 |
security-auditsecurity-auditgh apici auditgithub actionsworkflow performanceactions minutesci slowparallelize cici cachingrequired checkci auditgithub actionsworkflow performanceactions minutesci slowparallelize cici cachingrequired check.github/workflows/*.yml.github/workflows/*.yamlNo GitHub Actions workflows found.fdSearch path is not a directory.github/workflows/fd[ -d .github/workflows ] && ls .github/workflows/*.y*ml 2>/dev/nullyq -r '.jobs | to_entries | map(.key + " <- " + ((.value.needs // []) | tostring)) | .[]' <file>
yq -r '[.on | keys | join(",")] | join("")' <file>
yq -r '.concurrency // "none"' <file>concurrencyneedsstrategy.matrixtimeout-minutesgh run list --workflow <file> --limit 20 --json databaseId,conclusion,createdAt,updatedAt
gh run view <id> --json jobs --jq '.jobs[] | "\(.name) \(.startedAt) \(.completedAt) \(.conclusion)"'.github/workflows/*.yml.github/workflows/*.yamlNo GitHub Actions workflows found.fd.github/workflows/Search path is not a directoryfd[ -d .github/workflows ] && ls .github/workflows/*.y*ml 2>/dev/nullyq -r '.jobs | to_entries | map(.key + " <- " + ((.value.needs // []) | tostring)) | .[]' <file>
yq -r '[.on | keys | join(",")] | join("")' <file>
yq -r '.concurrency // "none"' <file>concurrencyneedsstrategy.matrixtimeout-minutesgh run list --workflow <file> --limit 20 --json databaseId,conclusion,createdAt,updatedAt
gh run view <id> --json jobs --jq '.jobs[] | "\(.name) \(.startedAt) \(.completedAt) \(.conclusion)"'references/checks.md| Family | Covers |
|---|---|
| A. Gating correctness | Matrix jobs with no stable fan-in gate, jobs that cannot fail the run, gates on noisy signals, required names nothing produces |
| B. Critical path | Serialized independent steps, no cheap head gate, expensive jobs on every event, setup repeated instead of artifacts consumed, push and pull-request double runs |
| C. Caching | Keys not derived from the lockfile, missing |
| D. Spend and hygiene | Missing |
timeout-minutesif: always()cancel-in-progress: falsereferences/checks.md| 类别 | 涵盖范围 |
|---|---|
| A. 门控正确性 | 无稳定聚合门控的矩阵作业、无法终止流水线的作业、基于噪声信号的门控、无对应工作流的必填检查名称 |
| B. 关键路径 | 串行执行的独立步骤、无轻量前置门控、每次事件都运行的高成本作业、重复执行的初始化步骤而非复用制品、推送和拉取请求重复运行 |
| C. 缓存 | 未基于锁文件生成的缓存键、缺失 |
| D. 成本开销与卫生性 | 缺失 |
timeout-minutesif: always()cancel-in-progress: falseundefinedundefined
Drop any section with no findings. Do not pad a clean result — a workflow set with nothing wrong is a
real outcome, and `Already right` carries it.
`references/ci-template.yaml` is an optimized pnpm workflow with parallel jobs, path filters and
concurrency control; `references/ci-template-vp.yaml` is the Vite+ (`voidzero-dev/setup-vp`) variant.
Offer them when a repository is starting from nothing, not as a target to converge every pipeline on.
删除没有问题的章节。不要为无问题的结果凑内容——工作流完全没有问题是真实的结果,“已有的正确实践”部分可以支撑这份结论。
`references/ci-template.yaml`是经过优化的pnpm工作流,包含并行作业、路径过滤和并发控制;`references/ci-template-vp.yaml`是Vite+(`voidzero-dev/setup-vp`)的变体。当仓库从零开始搭建CI时可以推荐这些模板,但不要将其作为所有流水线的统一目标。permissions:security-auditpermissions:security-audit| Situation | Action |
|---|---|
No | Print |
| Same message. A directory with only a README is not a pipeline |
Workflows exist but only | Audit them, and say nothing runs automatically |
| A workflow fails to parse | Report the parse error as the first finding and audit the rest |
| Read the YAML directly, and say the job graph was derived by reading |
| Audit statically, and mark every timing an estimate |
A reusable workflow ( | Audit the caller's graph; say the callee was not read unless it is in this repository |
| A composite action in the repository | Read it — its steps are on the critical path too |
| Only one job, doing everything | Still audit families A, C and D. A single job is not automatically wrong |
| 场景 | 操作 |
|---|---|
无 | 输出 |
| 输出相同信息。仅包含README的目录不算流水线 |
工作流仅设置 | 正常审核,并说明无自动运行的流水线 |
| 工作流解析失败 | 将解析错误作为第一个问题报告,继续审核其余工作流 |
| 直接读取YAML文件,并说明作业图是通过阅读推导得出 |
| 执行静态审核,并将所有耗时标记为估算值 |
可复用工作流(作业级 | 审核调用方的依赖图;仅当被调用方在当前仓库时才读取其内容 |
| 仓库内的复合Action | 读取其内容——其步骤也属于关键路径的一部分 |
| 仅包含一个作业,执行所有任务 | 仍需审核A、C、D类检查。单个作业并非一定存在问题 |