ci: pipeline-security tooling — Harden-Runner (audit) + zizmor + actionlint - #308
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider extracting the repeated Harden-Runner step into a reusable workflow or composite action to reduce duplication and make future policy changes (e.g., switching from audit to block) easier to apply consistently.
- For the zizmor and actionlint jobs that are intentionally non-blocking, you may want to add a clear TODO or comment indicating the planned criteria or timeline for flipping
continue-on-error/fail-on-errorto blocking, so the audit posture doesn’t become permanent by accident.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the repeated Harden-Runner step into a reusable workflow or composite action to reduce duplication and make future policy changes (e.g., switching from audit to block) easier to apply consistently.
- For the zizmor and actionlint jobs that are intentionally non-blocking, you may want to add a clear TODO or comment indicating the planned criteria or timeline for flipping `continue-on-error`/`fail-on-error` to blocking, so the audit posture doesn’t become permanent by accident.
## Individual Comments
### Comment 1
<location path="CHANGELOG.md" line_range="13-15" />
<code_context>
+- **Pipeline-security tooling: Harden-Runner, zizmor, actionlint.**
+ - **StepSecurity Harden-Runner** added (audit/egress-monitoring mode) as the
+ first step of every job across all workflows — captures a runtime egress
+ baseline so outbound traffic can later be allow-listed (block mode). The
+ defence against compromised-Action call-home / exfiltration.
+ - **zizmor** (`.github/workflows/actions-security.yml`) — static security
+ analysis of the Actions workflows (template injection, artifact
</code_context>
<issue_to_address>
**suggestion (typo):** Clarify sentence fragment and fix awkward hyphenation in "compromised-Action".
This line reads as a sentence fragment, and the hyphen in "compromised-Action" is awkward. Please rephrase into a full sentence and drop the hyphen, e.g. "This provides defence against compromised Action call-home / exfiltration."
```suggestion
first step of every job across all workflows — captures a runtime egress
baseline so outbound traffic can later be allow-listed (block mode). This
provides defence against compromised Action call-home / exfiltration.
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…onlint
Runtime + static hardening of the CI/CD pipeline itself, from the
CI/CD-security review.
- StepSecurity Harden-Runner added as the first step of every job across
all 7 workflows (18 jobs), in audit/egress-monitoring mode. Captures a
runtime egress baseline so traffic can later be allow-listed (block
mode). Defends against compromised-Action call-home / exfiltration.
- New .github/workflows/actions-security.yml:
- zizmor (uvx zizmor@1.9.0) — Actions static security analysis
(template injection, artifact credential persistence, over-broad
permissions) → SARIF to the code-scanning dashboard.
- actionlint (raven-actions/actionlint, SHA-pinned) — workflow linter.
- Both scanners start in reporting mode (non-blocking) to match the
Harden-Runner audit rollout; promote to blocking after triage.
All new action refs SHA-pinned. Workflows YAML-validated; zizmor run
locally (offline) as a pre-check — it already surfaces a useful baseline
(id-token scoping, persist-credentials on checkouts) for a follow-up.
Roadmap linkage: N/A — CI/supply-chain hardening.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122yLZLJ8t4W43sdN6BmTZc
5abf090 to
3ec9819
Compare
Review follow-up (#308): - Add explicit TODO(security) markers with criteria on the zizmor `continue-on-error` and actionlint `fail-on-error` so the reporting/ audit posture doesn't silently become permanent — flip to blocking once the baseline is triaged clean. - Rephrase the CHANGELOG Harden-Runner bullet from a sentence fragment ("The defence against compromised-Action…") into a full sentence. Declined the "extract Harden-Runner into a composite/reusable action" suggestion: harden-runner must be the first step (before checkout) to monitor the checkout itself, but a local composite action needs checkout to run first to be resolvable — a chicken-and-egg that leaves the checkout unmonitored. Block-mode allow-lists are per-workflow anyway. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122yLZLJ8t4W43sdN6BmTZc
|
Thanks — addressed in e93bd45:
Generated by Claude Code |
Summary
Adds the CI/CD-pipeline security controls we agreed on after reviewing the
awesome-cicd-securityand Orca lists. Everything else on those lists was already covered by your existing stack (Scorecard, CodeQL, bandit, pip-audit, Dependabot, fuzzing, signed releases, OIDC) or was offensive/audit-only tooling — the genuine gaps were runtime egress control and GitHub-Actions-specific static analysis.1. StepSecurity Harden-Runner (audit mode) — added as the first step of every job across all 7 workflows (18 jobs). In
egress-policy: auditit only monitors outbound traffic (can't block anything), capturing the egress baseline. The defence against the compromised-Action call-home/exfiltration class (tj-actions-style). Next step, once the baseline is reviewed: allow-list egress and flip the sensitive workflows (publish first) toblock.2. zizmor (
actions-security.yml) — static security analysis of the workflows (template injection, artifact credential persistence, over-broad permissions) viauvx zizmor@1.9.0→ SARIF to the code-scanning dashboard.3. actionlint — workflow linter (syntax + shell-script bugs) via SHA-pinned
raven-actions/actionlint.Both scanners start in reporting mode (findings surface, don't block), matching the Harden-Runner audit posture. Promote to blocking after triaging the baseline.
zizmor already found a useful baseline
Run locally (offline) as a pre-check — 22 findings (3 high, 11 medium), all real and worth a focused follow-up:
excessive-permissions:id-token: writeat the workflow level inpublish.yml(only the trusted-publishing jobs need it).artipacked: severalactions/checkoutsteps lackpersist-credentials: false.Kept out of this PR to keep it scoped to introducing the tooling; the new
actions-security.ymlcheckouts already setpersist-credentials: falseas the pattern to follow.This PR and #307 (SBOM/provenance/CODEOWNERS) both modify
publish.yml, so they'll conflict. Suggest merge #307 first, then I'll rebase this branch onto it (mechanical — different regions of the build job).Validation
Roadmap linkage
Advances roadmap row: N/A — CI/supply-chain hardening.
Checklist
ruff/mypy— no source changeCHANGELOG.mdupdated under[Unreleased]src/mcpg/_vendor/🤖 Generated with Claude Code
https://claude.ai/code/session_0122yLZLJ8t4W43sdN6BmTZc
Generated by Claude Code
Summary by Sourcery
Introduce CI/CD pipeline security tooling focused on GitHub Actions egress auditing and workflow analysis.
New Features:
Enhancements: