GHAGuard — GitHub Actions Supply-Chain Security Auditor
RemoteAbout GHAGuard — GitHub Actions Supply-Chain Security Auditor
GHAGuard is a deterministic security auditor for GitHub Actions workflow files, aimed at CI maintainers and repository security teams. It detects workflow injection, unsafe permissions, unpinned actions, and secrets, and can produce SARIF and Markdown reports.
Key features
- 01Detects pull request workflow risks
- 02Finds script injection and secrets
- 03Checks action pinning and permissions
- 04Audits containers and runner exposure
- 05Exports SARIF and Markdown reports
Use cases
- 01Gate workflow changes in CI
- 02Review repository workflows for supply-chain risks
- 03Create SARIF findings for code scanning
MCP support
The project is available as a remote MCP through `mcp.apify.com`; the README does not specify MCP tools or their outputs.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://mcp.apify.com/?actors=zluowa~ghaguard-workflow-auditorclaude mcp add --transport http zluowa-gha-guard-actor https://mcp.apify.com/?actors=zluowa~ghaguard-workflow-auditor{"mcpServers":{"zluowa-gha-guard-actor":{"type":"http","url":"https://mcp.apify.com/?actors=zluowa~ghaguard-workflow-auditor"}}}Open in Cursor{"servers":{"zluowa-gha-guard-actor":{"type":"http","url":"https://mcp.apify.com/?actors=zluowa~ghaguard-workflow-auditor"}}}Open in VS Code{"mcpServers":{"zluowa-gha-guard-actor":{"type":"http","url":"https://mcp.apify.com/?actors=zluowa~ghaguard-workflow-auditor"}}}{"mcpServers":{"zluowa-gha-guard-actor":{"serverUrl":"https://mcp.apify.com/?actors=zluowa~ghaguard-workflow-auditor"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
Details
From the project READMEGHAGuard — GitHub Actions Security & Supply-Chain Auditor (v1.0.0)
Zero-dependency deterministic CI/CD security gate for .github/workflows/*.yml — catches Pwn Requests (pull_request_target), script injection, unpinned third-party actions, overbroad GITHUB_TOKEN permissions, and hardcoded secrets in sub-second execution with SARIF 2.1.0 and PR Markdown scorecards.
Runs as a Zero-Install CLI, GitHub Action, and Apify Store PPE Actor (
zluowa/ghaguard-workflow-auditor) built on purenode:24-alpine(128–256 MBRAM, zero headless browser, zero LLM hallucinations).
30-Second Quick Start (Zero npm install)
1. Audit any local repository in one command
# Scan .github/workflows/*.yml and print a Markdown security scorecard
npx --yes github:Zluowa/gha-guard-actor . --markdown
# Strict mode: also flag unpinned official actions/* & github/* as HIGH severity
npx --yes github:Zluowa/gha-guard-actor . --strict-official --markdown
# Emit SARIF 2.1.0 JSON for GitHub Code Scanning
npx --yes github:Zluowa/gha-guard-actor . --sarif > ghaguard.sarif
2. Drop-in GitHub Action (Dogfooded in this repository's CI)
name: GHAGuard Security Gate
on: [push, pull_request]
permissions:
contents: read
security-events: write
jobs:
ghaguard:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: Zluowa/[email protected]
with:
target: '.'
strict-official: 'true'
sarif-file: 'ghaguard.sarif'
fail-on-findings: 'true'
Real Scan Output Examples (Before vs. After Hardening)
Catching a Vulnerable PR Automation Workflow (exit 1)
## GHAGuard Security & Supply-Chain Report — FAIL
- **Target**: `.github/workflows/pr-bot.yml`
- **Security Score**: **0/100** (Grade **F**)
- **Findings**: 6 total (3 CRITICAL, 1 HIGH, 1 MEDIUM, 1 LOW)
| Severity | Rule | Location | Issue |
|---|---|---|---|
| **CRITICAL** | `GHA004` | `.github/workflows/pr-bot.yml:4` | Explicit "permissions: write-all" grants full read/write GITHUB_TOKEN privileges across all scopes. |
| **CRITICAL** | `GHA001` | `.github/workflows/pr-bot.yml:11` | Workflow triggers on pull_request_target and checks out untrusted PR head code, allowing arbitrary code execution with write GITHUB_TOKEN & repo secrets (Pwn Request). |
| **CRITICAL** | `GHA002` | `.github/workflows/pr-bot.yml:13` | Untrusted GitHub context "${{ github.event.pull_request.title }}" is interpolated directly inside a shell run: block, enabling command injection. |
| **HIGH** | `GHA003` | `.github/workflows/pr-bot.yml:12` | Third-party action "thirdparty/auto-label@main" is pinned to mutable ref "main" instead of a 40-char commit SHA. |
| **MEDIUM** | `GHA003` | `.github/workflows/pr-bot.yml:9` | Official action "actions/checkout@v4" is pinned to mutable ref "v4" instead of a 40-char commit SHA. |
| **LOW** | `GHA010` | `.github/workflows/pr-bot.yml:1` | No job declares "timeout-minutes:", inheriting GitHub Actions 360-minute (6h) default which risks runaway runner cost. |
Dogfood Self-Scan on This Repository (--strict-official, exit 0)
## GHAGuard Security & Supply-Chain Report — PASS
- **Target**: `.github/workflows/ci.yml`
- **Security Score**: **100/100** (Grade **A**)
- **Findings**: 0 total (0 CRITICAL, 0 HIGH, 0 MEDIUM, 0 LOW)
No supply-chain, injection, or permission issues detected.
10 Deterministic Supply-Chain & CI/CD Rules
| Rule | Severity | What It Catches |
|---|---|---|
GHA001 | CRITICAL | pull_request_target + untrusted PR head checkout (head.sha, head.ref, refs/pull/.../merge) — Pwn Request RCE |
GHA002 | CRITICAL | Shell script injection via ${{ github.event.issue.title / pr.body / comment.body / head_ref }} directly in run: |
GHA003 | HIGH / MEDIUM | Unpinned third-party (and optionally official via --strict-official) Actions not pinned to a 40-char commit SHA |
GHA004 | CRITICAL / HIGH / MEDIUM | permissions: write-all, multiple global write scopes, or missing explicit top-level permissions: |
GHA005 | CRITICAL | Hardcoded API keys, GitHub PATs, AWS keys, Stripe/Slack tokens, or URL credentials in workflow YAML |
GHA006 | CRITICAL / HIGH | Unverified `curl |
GHA007 | HIGH | self-hosted runner exposed to externally triggerable pull_request / issue_comment events |
GHA008 | HIGH | Privileged workflow_run downloading untrusted artifacts or checking out workflow_run.head_sha |
GHA009 | HIGH | Untrusted event input redirected directly to GITHUB_ENV / GITHUB_PATH |
GHA010 | MEDIUM / LOW | Unpinned container / docker:// images (:latest or missing digest) and missing timeout-minutes |
Apify Cloud Actor & Remote MCP (mcp.apify.com)
Public on Apify as zluowa/ghaguard-workflow-auditor (Pay-per-event, Limited permissions); the local CLI and GitHub Action remain free.
| Action | PPE Event | Price (USD) | Capabilities |
|---|---|---|---|
| (Platform Start) | apify-actor-start | $0.001 | Platform auto-billed start event unlocking the 5-second free compute window (never manually charged by actor code). |
audit-workflow-bundle (Primary) | workflow-bundle-audit | $0.05 | Pass githubRepo: "owner/repo" for one-click live scanning of public .github/workflows/*.yml (up to 25 files, strict SSRF host pinning, $0 charge on 404/429), OR pass up to 100 offline workflow files -> 0–100 score, SARIF 2.1.0 & Markdown. |
audit-workflow | workflow-security-audit | $0.025 | Audits a single workflow YAML file -> 0–100 Security Score, Grade A–F, SARIF 2.1.0 & Markdown. |
{
"action": "audit-workflow-bundle",
"githubRepo": "Zluowa/gha-guard-actor",
"includeSarif": true,
"includeMarkdown": true
}
Local Development & Verification
git clone https://github.com/Zluowa/gha-guard-actor.git
cd gha-guard-actor
npm test
node cli/ghaguard.mjs . --strict-official --markdown
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.