ci: add workflow-security.yaml (zizmor + actionlint) (#191) - #257
Merged
Conversation
Lints the GitHub Actions workflow YAML for security anti-patterns that CodeQL / DevSkim / SAST tools don't catch: untrusted-input injection into `run:` blocks, missing / overly-permissive permissions blocks, secret leaks via expression-context expansion, unpinned actions, dangerous triggers. Two tools, complementary rule sets: - actionlint (Go, downloaded from upstream install script) — syntax + shellcheck + expression-syntax analysis. - zizmor (Python, pip install zizmor) — security-focused audit rules configurable via .github/zizmor.yml. Trigger: PR (paths-filtered to .github/workflows|.github/actions| .github/zizmor.yml) + push to main + workflow_dispatch. actionlint fails on any finding; zizmor gates on HIGH-severity via `--min-severity=high`. zizmor SARIF also uploads to Code Scanning (Security tab) so low/medium findings are visible for triage without gating merge. `.github/zizmor.yml` baseline: - unpinned-uses DISABLED across every workflow file. Try-Pattern currently uses tag refs (@v7 etc.) for ~48 action references; fleet convention (feedback_actions_sha_pin memory) is to SHA-pin every one of them but that hasn't caught up here yet. Explicit TODO in the config points at a future PR to SHA-pin + remove the suppression. - dangerous-triggers IGNORED for pr.yaml. That workflow uses pull_request_target deliberately (workflow YAML executes from main, mitigating malicious-PR modifications); design + mitigations are documented in docs/WORKFLOW_SECURITY.md. Local run confirms 0 high / 0 medium / 0 low after baseline — gate stays green on main today, fires only on NEW findings a PR introduces. Closes #191
|
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. |
This was referenced Jul 15, 2026
This was referenced Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
Workflow SecurityCI job per #191. Complements CodeQL / DevSkim / Gitleaks (which scan the code) and OSSF Scorecard (which scores the repo config) — this one lints the GitHub Actions YAML for security anti-patterns those tools don't catch: template injection inrun:, overly-permissivepermissions:, secret leaks via expression expansion, unpinned actions, dangerous triggers.Changes
.github/workflows/workflow-security.yaml— two jobs onubuntu-latest:--min-severity=high. Uploads SARIF to Code Scanning for triage of low/medium/informational findings that don't gate..github/workflows/**+.github/actions/**+.github/zizmor.yml) + push to main +workflow_dispatch..github/zizmor.yml— baseline suppressions with explicit TODOs to remove:unpinned-usesdisabled across all workflow files. Try-Pattern uses tag refs (@v7etc.) for ~48 action references today; fleet convention (feedback_actions_sha_pin) is to SHA-pin all of them, but that hasn't been done here yet. Config comment points at a future SHA-pin PR that removes this suppression.dangerous-triggersignored forpr.yaml. That workflow usespull_request_targetdeliberately (workflow YAML executes from main, mitigating malicious-PR modifications); design documented indocs/WORKFLOW_SECURITY.md.Baseline verification
Local
zizmor --min-severity=high .github/workflows/reports:Gate stays green on main today; fires only on NEWLY-introduced high findings.
Protected-file note
Adds a new workflow file.
Detect .NET Projectswill fail as expected → admin-bypass at merge.After merge
.github/workflows/**triggers the new job and confirms both tools run clean against the current baseline.pr.yaml,release.yaml,benchmarks.yaml,build-all-versions.yaml,codeql.yaml,docfx.yaml,scorecard.yml,stryker.yaml, and the newworkflow-security.yaml. Then delete theunpinned-usesblock from.github/zizmor.yml. Local re-run should show0 ignoredon that rule.Test plan
.github/zizmor.ymlsuppressions.github/zizmor.ymllists every current workflow file (with a comment reminding to add new ones)Closes #191