/mainframe-cobol-db2:github-actions-hardeningfrom mainframe-cobol-db2
Reviews, audits, and hardens GitHub Actions workflows against CI/CD threats including script injection, trigger escalation, token over-scoping, and secret exposure. Use for .github/workflows/*.yml security review.
Ships in mainframe-cobol-db2. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Review workflow YAML through the GitHub Actions threat model: trigger privilege, expression interpolation, token scopes, action supply chain, secret handling, and runner exposure.
${{ <expr> }} is expanded by the runner into the script before the shell executes it. In a step like run: echo "Title: ${{ github.event.issue.title }}", attacker-controlled issue text is pasted directly into the shell command. Treat every ${{ }} expression containing outside-contributor-controlled data as a code-injection sink unless it is passed through a safe intermediate environment variable or equivalent safe pattern.
on: trigger and classify the workflow privilege using references/triggers-and-privilege.md.run: block, actions/github-script script:, and custom action input for ${{ }} expressions containing attacker-controlled fields.pull_request_target and workflow_run workflows do not check out PR or fork code with ref: ${{ github.event.pull_request.head.sha }} and then run build, test, install scripts, npm install lifecycle scripts, or other untrusted code under privileged tokens.permissions: for least privilege. Missing permissions inherit repository defaults; prefer top-level permissions: {} or contents: read, then grant minimum scopes per job such as pull-requests: write only where comments are posted.uses: reference for mutable tags or branches. Third-party actions must be pinned to a full 40-character commit SHA, with a trailing comment for the human-readable version such as uses: foo/bar@<sha> # v2.1.0.$GITHUB_ENV, $GITHUB_OUTPUT, set -x, bash -x, actions/checkout persist-credentials, OIDC setup, artifact/cache poisoning, and self-hosted runner exposure.references/report-format.md; never auto-apply changes.| Trigger | Trust level | Review rule |
|---|---|---|
push | Repository-controlled | Still check token scopes, secrets, and supply chain. |
pull_request from same repo | Contributor has repository trust | Check standard injection and permissions risks. |
pull_request from a fork | Read-only token and no secrets | Do not call this dangerous merely because it runs untrusted code. |
pull_request_target | Base repo context with read/write token and secrets, triggerable by outsiders | CRITICAL if it checks out and runs fork code. |
workflow_run | Privileged follow-up context | Must consume artifacts safely and never trust unvalidated upstream output. |
issue_comment, issues | Outside contributors can trigger text-controlled workflows | High-risk for ${{ github.event.* }} injection. |
Check github.event.issue.title, github.event.issue.body, github.event.pull_request.title, github.event.pull_request.body, .head.ref, .head.label, github.event.comment.body, github.event.review.body, github.event.pages.*.page_name, github.event.commits.*.message, github.event.head_commit.*, github.head_ref, and any github.event.* field a fork author can set.
| Severity | Meaning | Example |
|---|---|---|
| CRITICAL | Token/secret theft or RCE reachable by an outside contributor | pull_request_target checking out and running fork code; privileged ${{ github.event.* }} in run: |
| HIGH | Exploitable supply-chain or scope issue | Third-party action on mutable tag/branch; write-all; injection sink on issue_comment |
| MEDIUM | Risk under conditions or chaining | Missing permissions:; secret reachable by non-fork PR author |
| LOW | Hardening gap with low direct risk | First-party action not SHA-pinned; persist-credentials default on non-privileged job |
| INFO | Observation, not a vulnerability | Version comment missing next to pinned SHA |
references/triggers-and-privilege.md: trust matrix, pull_request_target, workflow_run, issue_comment, fork secrets, read-only token, and trust boundary.references/injection.md: script injection, github.event, head_ref, issue title, env, intermediate variable, run, github-script, and action input safe patterns.references/permissions-and-tokens.md: GITHUB_TOKEN, permissions, write-all, contents: read, id-token, OIDC, and least privilege.references/supply-chain.md: SHA pinning, uses, mutable tag, Dependabot, download-artifact, cache, and self-hosted runner guidance.references/report-format.md: report, finding, summary, remediation, before, and after format.## GitHub Actions hardening — <workflow path>
| Severity | Count |
| --- | ---: |
| CRITICAL | <count> |
| HIGH | <count> |
| MEDIUM | <count> |
| LOW | <count> |
| INFO | <count> |
### Findings
#### <issue type>
**Severity:** CRITICAL | HIGH | MEDIUM | LOW | INFO
**Location:** `<workflow>:<line>`
**Evidence:**
```yaml
<offending YAML>
Risk: Fix:
<corrected YAML>
## Quality gate
- [ ] Every workflow trigger was classified by trust level.
- [ ] Every `run:`, `actions/github-script` `script:`, and custom action input was checked for unsafe `${{ }}` interpolation.
- [ ] Privileged triggers do not run untrusted fork or PR code.
- [ ] `permissions:` is least-privilege and no unjustified `write-all` remains.
- [ ] Third-party `uses:` references are pinned to full 40-character SHAs or reported.
- [ ] `$GITHUB_ENV`, `$GITHUB_OUTPUT`, secrets, OIDC, artifacts, caches, and self-hosted runners were reviewed.
- [ ] Every CRITICAL or HIGH finding has corrected YAML and no change was applied automatically.
What SKILL.md sets; muted values are Claude Code's defaults
15 skills in this plugin
/cobol-db2-analysisAnalyze COBOL programs, copybooks, PERFORM and CALL structure, file and VSAM access, embedded EXEC SQL and EXEC CICS, DB2 DDL, DCLGEN structures, cursors, and JCL job steps with source citations. Use when reading or inventorying a COBOL/DB2 legacy system before modernization./cobol-db2-contextSupply COBOL, DB2, VSAM, and JCL modernization context: corpus layout, member conventions, target stack boundaries, evidence precedence, stage flow, and security rules. Use when starting any COBOL/DB2 modernization task, before analysis, design, implementation, verification, or delivery./cobol-db2-loopRun each COBOL/DB2 modernization phase as a bounded correction loop with observable exit gates, an iteration ledger, upstream defect escalation, and an engineering graph extracted from COBOL, copybooks, JCL, and DB2 DDL. Use when opening or closing a COBOL/DB2 phase loop, deciding whether a gate passes, routing a defect to the phase that owns its root cause, or building and querying the modernization graph./cobol-legacyApplies COBOL, copybook, and JCL reading conventions for evidence, precision, occurrence semantics, and legacy immutability. Use when inspecting or citing COBOL/DB2 legacy source./code-modernizationUse this skill when the user asks to modernize legacy code with a disciplined GitHub Copilot workflow: brief, assess, map, extract business rules, reimagine architecture, transform modules, and harden with tests and security review. Trigger for COBOL, JCL, legacy Java, .NET, C++, classic ASP, monolith modernization, behavior-preserving rewrite, business-rule extraction, modernization assessment, or legacy-to-modern transformation./create-architectural-decision-recordCreate an Architectural Decision Record (ADR) as a structured Markdown document with front matter, coded consequences, alternatives, implementation notes, and references. Use when the user asks to document an architecture decision, create an ADR, capture alternatives and trade-offs, or save a decision under docs/adr.npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin mainframe-cobol-db2Other plugins' skills for the same job