Repository navigation
feat(#10559): add zizmor static analysis for GitHub Actions CI security - #10837
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. |
mrjones-plip
left a comment
There was a problem hiding this comment.
This PR is looking pretty close to being ready! Some minor suggestions on cooldown for new section and as well, please respond to all the security call outs on the PR.
Finally, please open a parallel PR in docs repo to document how this works and how the hashes get updated via the cron job. Maybe in the static analysis section? don't feel strongly!
|
Hi @mrjones-plip, done! Opened PR medic/cht-docs#2185 with the zizmor documentation in the static analysis section. It covers:
Ready for review again. |
mrjones-plip
left a comment
There was a problem hiding this comment.
Hey @vikrantwiz02 - sorry for the delay in getting back to you with review feedback.
I think this is good to go, but there's a small conflict on two of the files. Can you resolve the conflict we should be able me merge the change this week.
Thanks!
|
Hii @mrjones-plip, thanks for the review. I resolved the conflict. |
mrjones-plip
left a comment
There was a problem hiding this comment.
sorry- we were so close to merging!! Josh beat is in with some changes that I think we should be more gentle with on how we merge them in our branch.
see below
…entials and remove Dependabot cooldown settings
…secrets-outside-env rule
mrjones-plip
left a comment
There was a problem hiding this comment.
Thanks for iterating on this @vikrantwiz02
Please check build.yml again though - both the build-generated-docs section and Restore generated docs section feel too invasively refactored for this PR which is mainly supposed to harden variable use, reduce permission scope and pin to hashes.
… steps Removes the standalone publish-generated-docs job introduced during the merge conflict resolution. Restores the original build-generated-docs job and the inline Restore/Publish docs steps inside publish, matching master's structure exactly. Only adds SHA pins and permissions: contents: read.
|
Hi @mrjones-plip, fixed in ef47b71. Here's exactly what changed vs master now:
No structural changes, the only delta from master is SHA pins and permissions: contents: read on build-generated-docs. |
mrjones-plip
left a comment
There was a problem hiding this comment.
Thanks for working through my feedback and making CHT CI more secure \o/
Description
Integrates zizmor — a GitHub Actions static analysis tool — into CHT Core CI, and remediates all findings it surfaces across our 9 existing workflows.
Closes #10559
What zizmor found
Running
zizmor --offline .github/workflows/against our repo surfaced:@v4tags instead of commit SHAs) — supply-chain risk if a third-party action's tag is silently moved to a malicious commitpermissions:block, givingGITHUB_TOKENbroad write access by defaultrelease-notes.yml— the free-textworkflow_dispatchinputmilestonewas interpolated directly in arun:shell command:node index.js ${{ github.event.inputs.milestone }}stale-prs.ymlhadactions: writewhich is not needed for marking PRs stale@v6typos inrelease-notes.yml(v6 does not exist foractions/checkoutoractions/setup-node)What this PR does
New files:
.github/workflows/zizmor.yml— zizmor runs on every PR (offline to avoid rate limits), every push tomaster, and weekly on Sundays. Results upload to the GitHub Security tab as SARIF (Code Scanning)..github/zizmor.yml— suppression config. One finding is accepted rather than fixed(see suppression rationale below).Security fixes across all existing workflows:
release-notes.yml— fixed script injection:milestoneinput now goes through a quoted env var ("$MILESTONE") instead of raw template interpolation in the shell commandstale-prs.yml— removedactions: write(onlypull-requests: writeneeded)permissions:blocks scoped to minimum requiredwith the version tag preserved as a comment (e.g.
@abc123... # v4)Dependabot:
github-actionsecosystem todependabot.yml— will open weekly PRs whenpinned action versions are superseded, keeping SHAs current without manual effort
Suppression rationale
release-notes.yml—template-injectiononskip_commit_checksis suppressed in.github/zizmor.ymlbecause:choice, constrained to['', '--skip-commit-validation']— no shell metacharacters possible in either valueworkflow_dispatchis only triggerable by org members with Actions write permission — not accessible to external actorsmilestoneinput (free-text string) was fixed, not suppressedCode review checklist
Test plan
Verified locally (pre-merge)
zizmor --offline .github/workflows/locally — all findings remediated or documented in.github/zizmor.ymlLicense
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.