About secure-github-actions
A security skill for creating, reviewing, and auditing GitHub Actions workflows, intended for developers maintaining CI. It emphasizes full commit-SHA pins, least privilege, and safe handling of untrusted input, with reference files for different tasks.
Key features
- 01Pins external uses to full SHAs
- 02Keeps untrusted values out of inline shell
- 03Sets explicit least-privilege permissions
- 04Reviews trust boundaries and secret exposure
- 05Uses task-specific security references
Use cases
- 01Creating or editing GitHub Actions workflows
- 02Reviewing workflow dependencies and permissions
- 03Running a full repository security audit
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ vechain/ vechain-ai-skills --skill secure-github-actionsAfter installing, type/secure-github-actionsin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/audit-checklist.mdsecure-patterns.mdsha-pinning.mdworkflows.mdDetails
From the project READMESecure GitHub Actions
Create, review, and audit GitHub Actions workflows with supply-chain-safe defaults.
CRITICAL RULES
- Read the relevant reference files first. When the user's request involves any topic in the reference table below, read those files before doing anything else. Briefly mention which files you are reading so the user can confirm the skill is active.
- Pin every non-local
uses:reference to a full 40-character commit SHA. Treat@v*,@main,@master, branch names, and short SHAs as security debt. - Never invent SHAs. Resolve them from GitHub or ask the user; if you cannot verify the right SHA, say so explicitly instead of fabricating one.
- Do not introduce
pull_request_targetunless the user explicitly requires it and the workflow never executes untrusted code with secrets or write permissions. - Never splice untrusted context directly into shell. Move
${{ github.* }},${{ inputs.* }}, and similar values intoenv:and quote the shell variable. - Set explicit least-privilege
permissions:. Default to read-only and grant write scopes only to the specific job that needs them. - Always run the full audit checklist when asked to "audit", "harden", or "security scan" a repository.
- Never silently skip a check. If a tool is missing (gitleaks, trufflehog, zizmor), report it and suggest installation.
- After compaction or context loss, re-read this SKILL and the reference files before continuing.
Operating procedure
For writing or editing workflows
- Classify the task: new workflow, workflow edit, reusable workflow, or security review.
- Read references/workflows.md and references/secure-patterns.md.
- Audit every
uses:reference:- Local actions like
./.github/actions/fooare fine. - Step-level actions and job-level reusable workflows must use full SHAs.
- Preserve the human release label in a comment (e.g.,
# v4.3.1).
- Local actions like
- Audit the trust boundary:
- Prefer
pull_requestoverpull_request_target. - Assume forked PR data is untrusted.
- Avoid exposing secrets or write tokens to untrusted code paths.
- Prefer
- Audit every
run:step:- Pass dynamic values through
env:. - Quote shell variables.
- Prefer simple shell over adding a new third-party action when either works.
- Pass dynamic values through
- Add or update maintenance guardrails:
- Ensure Dependabot updates the
github-actionsecosystem. - Call out transitive risk: pinned actions can still reference mutable actions internally.
- Ensure Dependabot updates the
For full security audits
When asked to "audit", "harden", or "security scan" a repository:
- Read references/audit-checklist.md.
- Execute all checks, using subagents to parallelize where possible.
- Present findings grouped by severity: CRITICAL, HIGH, MEDIUM, LOW.
- End with a summary table and prioritized action list.
Reference files
| Topic | File | Read when... |
|---|---|---|
| Workflow hardening patterns | references/workflows.md | Creating, editing, or reviewing workflows |
| Secure workflow templates | references/secure-patterns.md | Writing new workflows from scratch |
| Full audit procedure | references/audit-checklist.md | Running a security audit on a repository |
| SHA pinning automation | references/sha-pinning.md | Pinning actions to commit SHAs |
Tools
The audit checks for these tools and reports missing ones:
| Tool | Purpose | Install |
|---|---|---|
gitleaks | Scan git history for secrets | brew install gitleaks |
trufflehog | Deep secrets scanning with verification | brew install trufflehog |
zizmor | Static analysis for GH Actions | brew install woodruffw/tap/zizmor |
gh | GitHub CLI for API calls | brew install gh |
Comments
Markdown supported