github-actions-hardening
Skill0 starsChanged 12 days agoMITView on GitHub
Audit and harden GitHub Actions workflows — pwn-request patterns (pull_request_target/workflow_run with untrusted checkout), script injection from github.event fields, unpinned third-party actions, GITHUB_TOKEN permissions, OIDC to cloud, self-hosted runner risk — with a bundled tested auditor plus zizmor/actionlint. Use when reviewing CI workflows, responding to a compromised action, or setting org-wide Actions policy.
- Reads credentials
7 other projects use a version of this.
Adopted by
Most recently taken up by
- taixuann/development-spacetheir own version, first seen Nov 8, 2026
- docdyhr/simplenote-mcp-servertheir own version, first seen Nov 1, 2026
- github/awesome-copilottheir own version, first seen Oct 25, 2026
- sb-dev/narrative-production-skillstheir own version, first seen Oct 20, 2026
- z-Zihan/Evirtheir own version, first seen Oct 13, 2026
- exelearning/exelearningtheir own version, first seen Oct 8, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- github/awesome-copilot★ 41ksame name
- exelearning/exelearning★ 153same name
- docdyhr/simplenote-mcp-server★ 21same name
- z-Zihan/Evir★ 11same name
- sb-dev/narrative-production-skills★ 2same name
- taixuann/development-space★ 1same name
- RorroRojas3/maf-agents★ 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 repository273 other files it gives its agents.
- ad-attack-path-analysisSkill
- adcs-security-reviewSkill
- ad-privileged-access-reviewSkill
- dcsync-detectionSkill
- gpo-security-reviewSkill
- kerberos-attack-detectionSkill
- agent-tool-permission-reviewSkill
- ai-incident-responseSkill
- llm-gateway-controlsSkill
- llm-security-evaluationSkill
- mcp-server-security-reviewSkill
- model-artifact-securitySkill
- prompt-injection-reviewSkill
- rag-security-reviewSkill
- api-abuse-detectionSkill
- api-authorization-testingSkill
- api-inventorySkill
- api-schema-securitySkill
- dast-baselineSkill
- sast-triageSkill
- sca-dependency-riskSkill
- secure-code-reviewSkill
- security-requirementsSkill
- threat-modelingSkill
- asset-criticality-tieringSkill
- asset-inventory-reconciliationSkill
- external-attack-surface-reviewSkill
- shadow-it-discoverySkill
- aws-credential-compromiseSkill
- aws-iam-reviewSkill
- aws-org-guardrailsSkill
- cloudtrail-investigationSkill
- guardduty-triageSkill
- s3-exposure-reviewSkill
- azure-activity-investigationSkill
- azure-rbac-reviewSkill
- conditional-access-reviewSkill
- entra-audit-investigationSkill
- entra-signin-investigationSkill
- backup-assuranceSkill
- critical-service-mappingSkill
- ransomware-recoverySkill
- recovery-exerciseSkill
- cloud-exposure-reviewSkill
- cloud-incident-responseSkill
- cloud-logging-baselineSkill
- cloud-posture-assessmentSkill
- audit-evidence-packageSkill
- continuous-control-monitoringSkill
- control-mappingSkill
- control-testing-samplingSkill
- container-incidentSkill
- dockerfile-hardeningSkill
- image-scanningSkill
- runtime-detection-falcoSkill
- db-audit-loggingSkill
- db-exfiltration-investigationSkill
- db-hardeningSkill
- db-privilege-reviewSkill
- data-classificationSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
0
Distinctive
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 44
Never use repo:my-org/* or wildcard sub for deploy roles.
- Very specific: line 48
Search all repos for the action and affected SHAs (gh search code "uses: org/action" --owner my-org or org-wide code search), review …
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Actions Hardening
Audit
python3 scripts/gha_audit.py .github/workflows/ # bundled heuristic auditor, JSON output, exit 1 on high/critical
python3 scripts/gha_audit.py wf.yml --fail-on medium
zizmor .github/workflows/ # dedicated Actions security linter (more complete)
actionlint # syntax + shellcheck of run blocksThe bundled auditor is line-based (no YAML parser): treat it as a fast first pass and confirm with zizmor.
Key risks and fixes
| Risk | Fix |
pull_request_target / workflow_run + checkout of PR head → untrusted code with secrets and write token | Use pull_request for untrusted code; if pull_request_target is needed, never check out/execute PR code; split into unprivileged build + privileged comment job with artifacts treated as untrusted |
Script injection: run: echo "${{ github.event.pull_request.title }}" | Pass via env: and reference "$TITLE"; never interpolate event fields into run |
Unpinned actions (@v4, @main) — tag hijacks (e.g. tj-actions/changed-files, March 2025) | Pin to full commit SHA with a version comment; update via Dependabot/Renovate; restrict allowed actions at org level |
Over-privileged GITHUB_TOKEN | Org default to read-only; per-workflow permissions: least privilege |
| Long-lived cloud keys in secrets | OIDC federation (id-token: write) with tight trust conditions on sub (repo, branch/environment) |
| Self-hosted runners on public repos | Don't; use ephemeral, isolated runners (ARC, just-in-time) with no persistent credentials |
| Secrets exposure in logs/artifacts | Mask, avoid set -x, scan artifacts; environments with required reviewers for deploy secrets |
| Cache poisoning | Don't share caches between untrusted PR and privileged workflows |
AWS OIDC trust policy condition example
"Condition": {
"StringEquals": { "token.actions.githubusercontent.com:aud": "sts.amazonaws.com" },
"StringLike": { "token.actions.githubusercontent.com:sub": "repo:my-org/my-repo:environment:production" }
}Never use repo:my-org/* or wildcard sub for deploy roles.
Incident: compromised third-party action
Search all repos for the action and affected SHAs (gh search code "uses: org/action" --owner my-org or org-wide code search), review workflow run logs in the window for leaked secrets, rotate every secret available to those workflows, pin to a known-good SHA or remove.
Related skills
pipeline-threat-model, source-control-hardening, secret-leak-response, slsa-provenance
References
- GitHub security hardening for Actions: https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions
- GitHub Security Lab "Preventing pwn requests": https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
- zizmor: https://docs.zizmor.sh/
- actionlint: https://github.com/rhysd/actionlint
- CISA alert on tj-actions/changed-files (CVE-2025-30066): https://www.cisa.gov/news-events/alerts/2025/03/18/supply-chain-compromise-third-party-tj-actionschanged-files-cve-2025-30066-and-reviewdogaction
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.

