ci-cd-security
БесплатноБез исполняемых скриптовНе проверенScan GitHub Actions workflow files for security vulnerabilities by reading the YAML and reporting findings directly — no external tools, no installation, no…
от superagent-ai★ 82 звезды на GitHubОб этом скилле
CI/CD Security Scanner
This skill turns the model into a workflow-YAML scanner. Read the file, walk the detection rules, report findings with severity and a concrete rewrite. No tools to install, no commands to run — the analysis is the model reading the YAML.
The rules encode the current consensus from Astral, OpenSSF, GitHub Security Lab, Chainguard, and the zizmor audit set. The goal is to flag the same patterns those tools would flag, without needing to run them.
Mental model
Every workflow sits on a 2x2: privileged vs unprivileged crossed with trusted vs untrusted code. Compromise happens at exactly one cell: privileged workflow running untrusted code. The rules below are ways to detect when a workflow ends up in that cell.
- Privileged = has secrets, write permissions, or produces a sensitive artifact (release, deploy, comment, label).
- Untrusted code = anything a fork PR author can influence: PR source code, PR title, PR body, commit messages, branch names, files the workflow reads, caches, artifacts produced by another untrusted workflow.
When unsure whether a value is trusted, treat it as untrusted. The cost of a false positive is a code review comment; the cost of a false negative is a supply chain compromise.
Scan procedure
For each workflow file the user provides, walk these passes in order. Each pass corresponds to a class of attack.
Pass 1: dangerous triggers
Look at the on: block. Flag immediately:
pull_request_target— P0 unless explicitly justified. Runs with secrets and write permissions, triggerable by fork PRs. The canonical pwn-request vector. Even withoutcheckoutof head, attacker input shows up in PR title, branch name, commit messages, and gets interpolated.workflow_run— P0. Same problem aspull_request_targetbut indirect, via a chainedpull_requestworkflow's artifacts or metadata.issue_comment,issues,pull_request_review,pull_request_review_comment— P1. Run with secrets, reachable by anyone who can comment. Safe only if the workflow does no template interpolation of user-controlled fields into shell.pushwith broad wildcards (branches: ['*']or no branch filter) — P2. An attacker who lands a PR can fire a privileged workflow by pushing a follow-up branch.
For each finding: name the trigger, explain why it's dangerous in this specific workflow's context, and propose the rewrite (usually pull_request, sometimes a split into two workflows, sometimes "this needs a GitHub App not Actions").
Pass 2: permissions
Look for permissions: blocks at workflow and job level.
- No top-level
permissions:block — P1. The defaultGITHUB_TOKENpermissions depend on repo and org settings; can bewrite-allon older repos. Flag with: "addpermissions: {}at top, grant per-job." permissions: write-allanywhere — P1.- Job-level
permissions:granting more than the job clearly needs — P2. e.g.contents: writeon a job that only runs tests. Recommend least privilege. - Combined with a dangerous trigger from Pass 1 — escalate severity by one level.
Pass 3: action pinning
Look at every uses: line.
- Pinned to a tag (
uses: actions/checkout@v4,@v4.1.1) — P1. Tags are mutable; an attacker who compromises the action repo can force-push the tag. - Pinned to a branch (
uses: actions/checkout@main) — P0. Worse than tag pinning; any commit to that branch flows in instantly. - Pinned to a SHA but no version comment — P3 style finding. Recommend the format
uses: owner/action@<sha> # v4.1.1so reviews of pin updates stay legible. - Pinned to a SHA that looks unusual (third-party action, suspicious owner, recently created repo) — flag for manual verification; can't confirm impostor-commit status without the GitHub API, but worth noting.
The rewrite for tag/branch pinning is always: replace with the full 40-character commit SHA of the version they intended, plus a # vX.Y.Z comment.
Pass 4: shell injection (template injection)
For every run: block, scan for ${{ ... }} substitutions.
Constant or non-attacker-controlled values are fine (e.g. ${{ matrix.os }}, ${{ secrets.MY_TOKEN }} though even that's risky in some contexts). The dangerous fields are:
github.event.pull_request.title,body,head.ref,head.sha,head.labelgithub.event.issue.title,bodygithub.event.comment.body,user.logingithub.event.review.bodygithub.head_refgithub.event.workflow_run.head_branch,head_commit.messagegithub.event.commits.*.message,author.name,author.email- Any
inputs.*fromworkflow_dispatchif the workflow runs in a privileged context - Any field that ultimately came from
actions/github-script, downloaded artifacts, or external API responses
Detection rule: if a run: block contains ${{ github.event.* }} or ${{ github.head_ref }} directly in the script body, that's P0 template injec
Установить ci-cd-security в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл ci-cd-security?
Scan GitHub Actions workflow files for security vulnerabilities by reading the YAML and reporting findings directly — no external tools, no installation, no shell execution. Use this skill whenever the user shares a `.github/workflows/` file, pastes workflow YAML, asks for a CI/CD security review, mentions `pull_request_target`, `workflow_run`, action pinning, `GITHUB_TOKEN` permissions, pwn requests, template injection, cache poisoning, secret exfiltration, supply chain risk, or any GitHub Actions hardening topic. Also trigger when the user is hardening an OSS repo, doing a CI/CD red team assessment, evaluating a target for supply-chain scanning, or writing publicly about CI/CD security. Bias toward triggering this skill rather than answering from memory — CI/CD security defaults are wrong almost everywhere and the rules are unintuitive.
Как установить скилл ci-cd-security?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ci-cd-security запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic