# GitHub Actions Security Audit (`unbearable_dev/github-actions-audit`) Actor

Audits .github/workflows/\*.yml for supply-chain risks: script injection, leaked tokens, unpinned actions, broad permissions, pull\_request\_target pitfalls. MCP-native - call from Claude Desktop, Cursor, n8n, or any MCP client. Pay-per-event. Built by Unbearable Labs.

- **URL**: https://apify.com/unbearable\_dev/github-actions-audit.md
- **Developed by:** [Noel Himer](https://apify.com/unbearable_dev) (community)
- **Categories:** Developer tools, Automation, MCP servers
- **Stats:** 1 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 github actions audit calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## GitHub Actions Security Audit

> MCP server that audits `.github/workflows/*.yml` files for supply-chain risks. Catches script injection, leaked tokens, unpinned actions, broad permissions, and `pull_request_target` foot-guns — the patterns behind several 2024-2025 supply-chain incidents.

**Built by [Unbearable Labs](https://github.com/UnbearableDev). Free to use — bring your own Apify token.**

***

### Available on

- [Apify Actor Store](https://apify.com/unbearable_dev/github-actions-audit) — primary
- [Smithery](https://smithery.ai/servers/unbearabledev/github-actions-audit)

**Newsletter:** [Unbearable TechTips Weekly](https://unbearabletechtips.beehiiv.com) · **All Actors:** [github.com/UnbearableDev](https://github.com/UnbearableDev)

### What it does

Point any MCP-capable client (Claude Desktop, Cursor, n8n, Make, Zapier, custom agents) at this server, hand it a workflow YAML, and get back structured findings with:

- **Severity** — critical / high / medium / low / info
- **Affected job and step** — exact location of the problem
- **Description** — why it matters, with the actual attack vector
- **Remediation** — what to do about it
- **Fix snippet** — YAML you can paste directly

### Tools

| Tool | Purpose |
|------|---------|
| `audit_workflow(workflow_yaml? \| workflow_url?, min_severity='low')` | Run all checks |
| `check_secrets(...)` | Secret-leakage paths only |
| `check_permissions(...)` | `GITHUB_TOKEN` scope issues only |
| `check_action_pinning(...)` | Action version-pinning only |
| `check_runner_security(...)` | Self-hosted runner + script injection |
| `check_workflow_config(...)` | Timeout / config hygiene |
| `check_supply_chain_advanced(...)` | TeamPCP-class supply-chain patterns (GHA-201..208) |
| `list_checks(category?)` | Browse the catalog |

Provide exactly one of `workflow_yaml` (paste the content) or `workflow_url` (HTTPS URL — typically a GitHub raw URL to a specific workflow file).

### Example

Input:

```yaml
on:
  pull_request_target:
    types: [opened]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - uses: tj-actions/changed-files@v35
      - name: Echo title
        run: echo "${{ github.event.pull_request.title }}"
```

Output:

```json
[
  {
    "check_id": "GHA-203",
    "severity": "critical",
    "job": "build",
    "step": null,
    "message": "'pull_request_target' + checkout of PR head SHA — grants write-token access to untrusted code",
    "remediation": "Use 'pull_request' trigger instead, or do not check out the PR head when using pull_request_target"
  },
  {
    "check_id": "GHA-201",
    "severity": "high",
    "job": "build",
    "step": null,
    "message": "Third-party action 'tj-actions/changed-files' pinned to mutable semver tag '@v35'",
    "remediation": "Pin to a full commit SHA: 'tj-actions/changed-files@<40-char-sha>  # v35'"
  },
  {
    "check_id": "GHA-204",
    "severity": "high",
    "job": "build",
    "step": "Echo title",
    "message": "PR title interpolated into 'run:' — attacker can inject shell commands via crafted PR title",
    "remediation": "Move to an env var and reference $PR_TITLE in the run step"
  }
]
```

### Check catalog (v2: 21 checks)

| ID | Category | Severity | Title |
|----|----------|----------|-------|
| GHA-001 | secrets | high | Secret interpolated directly into `run:` script |
| GHA-002 | secrets | high | Secret printed via echo / set-output |
| GHA-003 | secrets | medium | Secret used in `if:` condition |
| GHA-004 | secrets | high | Hardcoded credential pattern in `env:` |
| GHA-010 | permissions | high | `permissions: write-all` granted |
| GHA-011 | permissions | medium | No top-level `permissions:` (inherits broad default) |
| GHA-013 | permissions | high | `pull_request_target` + checkout PR head = PWNing pattern |
| GHA-020 | action\_pinning | high | Third-party action pinned to mutable tag |
| GHA-021 | action\_pinning | high | Third-party action pinned to mutable branch |
| GHA-022 | action\_pinning | medium | First-party action not SHA-pinned |
| GHA-030 | runner\_security | medium | Self-hosted runner used on `pull_request` from forks |
| GHA-032 | runner\_security | high | Script injection via untrusted `github.event.*` interpolation |
| GHA-040 | workflow\_config | low | No `timeout-minutes` on job |
| GHA-201 | supply\_chain\_advanced | high | Action pinned to unpinned branch ref (@main/@master) |
| GHA-202 | supply\_chain\_advanced | high | Action pinned to mutable tag — SHA pin recommended |
| GHA-203 | supply\_chain\_advanced | critical | `pull_request_target` + checkout of PR head SHA/ref (codecov/tj-actions exploitation path) |
| GHA-204 | supply\_chain\_advanced | high | Script injection via `github.event.*` user-controlled field in `run:` |
| GHA-205 | supply\_chain\_advanced | medium | Action from non-allowlisted owner (untrusted 3rd-party) |
| GHA-206 | supply\_chain\_advanced | high | Top-level `permissions: write-all` or `contents: write` without per-job scoping |
| GHA-207 | supply\_chain\_advanced | medium | Secret logged via `echo` / `cat` in `run:` block |
| GHA-208 | supply\_chain\_advanced | low | Action uses a known-retired tag |

### Pricing

Free to use — hosted on Apify, bring your own Apify token.

### Connecting from Claude Desktop

```json
{
  "mcpServers": {
    "gha-audit": {
      "transport": "streamable-http",
      "url": "https://unbearable-dev--github-actions-audit.apify.actor/mcp",
      "headers": { "Authorization": "Bearer <YOUR_APIFY_TOKEN>" }
    }
  }
}
```

### Sibling MCPs from Unbearable Labs

- **[`docker-compose-audit`](https://apify.com/unbearable_dev/docker-compose-audit)** — `docker-compose.yml` security audit
- **[`dockerfile-audit`](https://apify.com/unbearable_dev/dockerfile-audit)** — Dockerfile security & quality
- **[`k8s-manifest-audit`](https://apify.com/unbearable_dev/k8s-manifest-audit)** — Kubernetes manifest audit
- **[`hu-postcode-validator`](https://apify.com/unbearable_dev/hu-postcode-validator)** — Hungarian postcode lookup

### What's NOT covered (yet)

- Reusable workflow auditing (multi-file resolution)
- CodeQL-grade dataflow tracking
- Marketplace-listed action reputation scoring

### Source / contact

Source: [github.com/UnbearableDev/github-actions-audit](https://github.com/UnbearableDev/github-actions-audit).
Issues + ideas: `unbearabledev@gmail.com`.

***

Built by Noel @ Unbearable Labs — more like this in the weekly newsletter: https://unbearabletechtips.beehiiv.com

# Actor input Schema

## Actor input object example

```json
{}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("unbearable_dev/github-actions-audit").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("unbearable_dev/github-actions-audit").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call unbearable_dev/github-actions-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,unbearable_dev/github-actions-audit"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/17sH9Wxal4LyWMSDl/builds/moNQfWPRFJPDd2Jiw/openapi.json
