cicd-security
Skill22 starsChanged 5 months agoMITView on GitHub
Harden GitHub Actions, GitLab CI, and similar pipelines against supply-chain attacks, secret exfiltration, and pwn-request abuse. Use when authoring or reviewing workflow files, adding a third-party action, image, or script, wiring cloud or registry credentials into CI, or triaging a suspected pipeline compromise.
- Pipes a download into a shell
- Installs packages
3 other projects use a version of this.
Adopted by
Most recently taken up by
- zyphr-labs/bounty-harnesstheir own version, first seen Aug 26, 2026
- conjure-3301/skillstheir own version, first seen Aug 17, 2026
- awarexone/Agentic-Bug-Huntertheir own version, first seen Jun 9, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- awarexone/Agentic-Bug-Hunter★ 5.3ksame name
- zyphr-labs/bounty-harness★ 1same name
- conjure-3301/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- dist/AGENTS.mdAGENTS.md
- dist/CLAUDE.mdCLAUDE.md
- dist/copilot-instructions.mdCopilot instructions
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
- api-securitySkill
- auth-securitySkill
- container-securitySkill
- cors-securitySkill
- crypto-misuseSkill
- database-securitySkill
- deserialization-securitySkill
- dynamic-verificationSkill
- electron-securitySkill
- error-handling-securitySkill
- file-upload-securitySkill
- frontend-securitySkill
- graphql-securitySkill
- iac-securitySkill
- iam-best-practicesSkill
- llm-app-securitySkill
- logging-securitySkill
- ml-securitySkill
- mobile-securitySkill
- protocol-securitySkill
- saas-securitySkill
- secret-detectionSkill
- secure-code-reviewSkill
- security-regression-testsSkill
- serverless-securitySkill
- ssrf-preventionSkill
- supply-chain-securitySkill
- template-injectionSkill
- threat-modelingSkill
- websocket-securitySkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 49
Use OIDC (id-token: write + cloud provider trust policy) for short-lived cloud credentials.
- Very specific: line 53
Treat pull_request_target, workflow_run, and any pull_request job that uses actions/checkout with ref: ${{ …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CI/CD Pipeline Security
Rules (for AI agents)
ALWAYS
- Pin every third-party GitHub Action by commit SHA (full 40-char), never by
a floating tag (
@v1,@main,@latest) — tags can be re-pushed. The tj-actions/changed-files March 2025 incident exfiltrated secrets from 23,000+ repositories specifically because consumers used floating tags. Same applies to GitLab CIinclude:references and reusable workflows. Renovate / Dependabot can keep the SHA pins fresh.<!-- pattern: { id: gha-pin-actions-by-sha, severity: high, check: deterministic } --> - Declare
permissions:at the workflow or job level and default tocontents: readonly. Grant additional scopes (id-token: write,packages: write, etc.) job-by-job, never workflow-wide.<!-- pattern: { id: gha-default-permissions-read, severity: high, check: deterministic } --> - Use OIDC (
id-token: write+ cloud provider trust policy) for short-lived cloud credentials. Never store long-lived AWS / GCP / Azure keys as GitHub Secrets.<!-- pattern: { id: gha-oidc-cloud-credentials, severity: high, check: deterministic } --> - Treat
pull_request_target,workflow_run, and anypull_requestjob that usesactions/checkoutwithref: ${{ github.event.pull_request.head.ref }}as trusted-context-on-untrusted-code — the "pwn request" pattern documented by GitHub Security Lab. Either don't run them, or run with no secrets and no write tokens. A fork's GitLab merge-request pipeline is the same shape — it runs the fork's own.gitlab-ci.ymlon your runners: isolate them, expose no protected variables.<!-- pattern: { id: gha-pr-target-no-untrusted-checkout, severity: critical, check: deterministic } --> - Echo every untrusted expression (
${{ github.event.* }}) through an environment variable first; never interpolate it directly intorun:body — that's the canonical GitHub Actions script-injection sink. The GitLab sink has the same shape:$CI_*/$TRIGGER_*interpolated intobash -coreval, where merge-request metadata carries the shell metacharacters.<!-- pattern: { id: gha-no-untrusted-script-injection, severity: critical, check: deterministic } --> - Sign release artifacts (Sigstore / cosign) and publish SLSA provenance attestations. Verify provenance in any consumer pipeline that pulls the artifact.
- Pin
runs-onto a dated runner image (ubuntu-24.04), not a floating label (ubuntu-latest) — the label moves underneath you. On GitLab, use ephemeral Docker-executor runners withprivileged: false; a shared shell runner withprivileged: truegives a compromised job root on the host. An egress firewall on runners handling secrets (StepSecurity Harden-Runner or equivalent) is defense-in-depth on top of that, not a substitute.<!-- pattern: { id: gha-harden-runner, severity: medium, check: llm } --> - Require a human reviewer on a dependency-bump PR when
supply-chain-securityraises a trust-boundary change — a maintainer or ownership change, a new or changed install hook, a registry or source transition, a provenance regression. Gate on that signal, not on the version number: a patch release that changes maintainer warrants more review than a major bump that does not. - Consult
supply-chain-securitybefore any dependency install step (npm install,pip install,docker pull) — in CI it is untrusted code execution on a runner holding your credentials. It owns install-script risk (postinstall,setup.py,build.rs) and registry pinning;container-securitynames the command that fixes the lockfile half (npm ci,--frozen-lockfile) rather than adding flags tonpm install.
NEVER
curl | bash(orwget -O- | sh) any installer script in CI. The 2021 Codecov bash-uploader compromise exfiltrated env vars to an attacker for ~10 weeks because thousands of pipelines ranbash <(curl https://codecov.io/bash). Always download, checksum, then execute.<!-- pattern: { id: gha-no-curl-pipe-bash, severity: critical, check: deterministic } -->- Echo secrets to logs, even on failure. Use
::add-mask::for any computed-at-runtime secret, and double-check with the GitHub workflow-log search. - Cache mutable state (e.g.
~/.npm,~/.cargo,~/.gradle) keyed only onos. A cache hit cross-job is a cross-tenant attack surface — key on a lockfile hash and scope to the workflow ref.<!-- pattern: { id: gha-cache-key-scope, severity: medium, check: deterministic } --> - Trust artifact downloads from arbitrary workflow runs without verifying
the source workflow + commit SHA. Build-cache poisoning works through
unscoped artifact reuse.
<!-- pattern: { id: gha-artifact-verify-source, severity: medium, check: deterministic } --> - Store secrets in repository variables (
vars.*) — they are plaintext to anyone with read access. Onlysecrets.*are gated by the secret scanning + scope rules. GitLab's equivalent: a CI/CD variable withoutprotected: true+masked: trueis exposed to every feature-branch pipeline.
KNOWN FALSE POSITIVES
- First-party actions in the same organization that you mirror or fork in-house may legitimately be pinned by tag if the org enforces signed tags + branch-protection on the action repo.
- Public-data pipelines that handle no secrets and produce no signed artifact (e.g. nightly link-checkers) don't need OIDC or SLSA provenance, and may use floating tags without practical impact.
pull_request_targetis legitimate for label / triage bots that only call the GitHub API with the minimal scopes needed, do not check out PR code, and don't expose secrets in env.
Context (for humans)
CI/CD is now the most lucrative single supply-chain target. A pipeline runs trusted code against trusted credentials and trusted registries — compromising it once gives access to every downstream consumer of every artifact it produces. The 2021 Codecov compromise, 2021 SolarWinds incident, 2024 Ultralytics PyPI release-pipeline poisoning, and the 2025 tj-actions/changed-files mass exfiltration all hinged on unauthenticated changes to CI-consumed scripts or actions.
Most of the defenses are mechanical: pin by SHA, minimize permissions, use OIDC, sign artifacts, verify provenance. The hard part is enforcing them across an organization. OpenSSF Scorecard automates checks for the mechanical defenses and integrates with branch protection.
This skill emphasizes the design-pattern weaknesses (pwn requests, script injection, curl-pipe-bash, floating tags, untrusted artifact download) because they are the patterns AI-generated workflow YAML reinvents most often.
References
references/verifying-findings.md— confirm or refute a finding, then lock itchecklists/gitlab_ci_hardening.yaml- OpenSSF Scorecard.
- SLSA v1.0 Build Track.
- GitHub Security Lab — Preventing pwn requests.
- StepSecurity — tj-actions/changed-files attack analysis.
- CWE-1395.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

