CI/CD & GitHub Actions Security Skill
Audit workflow YAML pipelines for script injection, unpinned actions, pull_request_target abuse, and OIDC leaks.
Prerequisites & Step-by-Step Installation
Copy & run inside isolated labBefore You Start (Prerequisites)
- + Claude Code CLI, Cursor IDE, Codex CLI, or compatible AGENTS.md / SKILL.md host
- + Target repository checked out locally on a read-only audit branch
- + Optional CI validator (Semgrep, PHPUnit, or Terraform CLI) to verify proposed remediations
Download SKILL.md directly into your project skills directory
mkdir -p .claude/skills/cicd-github-actions-hardening-skill
curl -fsSL "https://toolwar.com/ai-security/cicd-github-actions-hardening-skill/download?format=skill" -o .claude/skills/cicd-github-actions-hardening-skill/SKILL.md
For global reuse across all repositories, install inside ~/.claude/skills/ instead.
Alternative: Install as a Cursor Project Rule (.mdc)
mkdir -p .cursor/rules
curl -fsSL "https://toolwar.com/ai-security/cicd-github-actions-hardening-skill/download?format=skill" -o .cursor/rules/cicd-github-actions-hardening-skill.mdc
Cursor automatically indexes .cursor/rules/*.mdc files inside your workspace.
Verify file contents and YAML frontmatter before loading
head -n 12 .claude/skills/cicd-github-actions-hardening-skill/SKILL.md
Inspect downloaded markdown skills before letting an assistant follow automated steps.
test -s .claude/skills/cicd-github-actions-hardening-skill/SKILL.md && grep -q 'name: cicd-github-actions-hardening-skill' .claude/skills/cicd-github-actions-hardening-skill/SKILL.md && echo 'SKILL ACTIVE'
Client Integration & Configuration Files
Review scope limits before wiring---
name: cicd-github-actions-hardening-skill
description: Audit workflow YAML pipelines for script injection, unpinned actions, pull_request_target abuse, and OIDC leaks.
---
# CI/CD & GitHub Actions Security Skill
## Authorized Defensive Scope
Apply this workflow strictly on repositories, cloud manifests, or lab systems you own or have explicit written authorization to audit.
## Workflow Protocol
1. Search .github/workflows/*.yml for pull_request_target combined with untrusted PR checkout.
2. Replace interpolated github.event inputs inside run: scripts with environment variables.
3. Pin third-party actions to full 40-char commit SHAs and set top-level permissions: read-all.
## CI/CD & GitHub Actions Security Skill (`cicd-github-actions-hardening-skill`)
> Scope: Authorized repositories, cloud manifests, or isolated staging labs only.
### Mandatory Rules for Coding Agents
1. Search .github/workflows/*.yml for pull_request_target combined with untrusted PR checkout.
2. Replace interpolated github.event inputs inside run: scripts with environment variables.
3. Pin third-party actions to full 40-char commit SHAs and set top-level permissions: read-all.
mkdir -p .claude/skills/cicd-github-actions-hardening-skill
curl -fsSL "https://toolwar.com/ai-security/cicd-github-actions-hardening-skill/download?format=skill" -o .claude/skills/cicd-github-actions-hardening-skill/SKILL.md
mkdir -p .cursor/rules
curl -fsSL "https://toolwar.com/ai-security/cicd-github-actions-hardening-skill/download?format=skill" -o .cursor/rules/cicd-github-actions-hardening-skill.mdc
curl -fsSL "https://toolwar.com/ai-security/cicd-github-actions-hardening-skill/download?format=agents" >> AGENTS.md
How to Use & Defensive Workflow
Authorized assessment protocolTypical Scenario: Standardize repeatable defensive security checks (GitHub Actions expression injection elimination, SHA-pinned third-party actions, minimal GITHUB_TOKEN scopes, and OIDC subject claims) without relying on ad-hoc one-off prompts.
- 01. Open your target repository on a clean feature or audit branch.
- 02. Ensure the SKILL.md file resides in .claude/skills/ or .cursor/rules/.
- 03. Paste the sample defensive prompt below into your coding assistant chat.
- 04. Verify every flagged issue against deterministic tests or local linters before editing production code.
Audit .github/workflows/*.yml using cicd-github-actions-hardening-skill: flag expression injections, broad write-all tokens, and unpinned action tags, with patched YAML diffs.
Run this skill in read-only code review mode first. Never grant an automated skill unattended push access to production branches or credentials outside dedicated audit sandboxes.
Technical Architecture & Deployment Brief
Overview & Role in Security Engineering
CI/CD & GitHub Actions Security Skill (Audited Agent Skill Playbook) is engineered to support practitioners focused on GitHub Actions expression injection elimination, SHA-pinned third-party actions, minimal GITHUB_TOKEN scopes, and OIDC subject claims. Within the ToolWar ecosystem, it serves as an explicit bridge between AI reasoning layers and verifiable cybersecurity telemetry.
Technical Architecture & Data Flow
Reusable SKILL.md instruction packs standardize how coding and SecOps assistants inspect codebases without improvising ad-hoc checklists. Each phase prioritizes deterministic verification, human-in-the-loop patch approval, and reproducible test output.
Unlike ad-hoc prompt wrappers that execute unconstrained strings directly in a shell, structured integration enforces typed parameter validation, bounded scope allowlists, and explicit separation between untrusted analyzed artifacts (source files, telemetry logs, network banners, or binary samples) and system-level control instructions.
Recommended Deployment Practice
- Isolate the Execution Boundary: Deploy integrations inside ephemeral containers or dedicated analysis VMs so untrusted repositories, binaries, or HTTP responses cannot affect primary workstations.
- Enforce Least-Privilege Scoping: Use read-only filesystem mounts, non-privileged service tokens, and target CIDR allowlists before enabling interactive assistant sessions.
- Verify Outputs Deterministically: Pair this skill file with automated CI regression gates (
Semgrep,PHPUnit, orPromptfoo) so AI findings are verified programmatically before merge.
Integration & Operational Caveats
- Treat all external content ingested by an LLM (including code comments, HTML titles, log lines, and MCP responses) as potential prompt-injection vectors.
- Review configuration JSON and
SKILL.mdmanifests carefully before binding credentials or running inside automated CI/CD pipelines.