Add Plumber security scan and harden workflow actions - #76
Conversation
c59d7dc to
65f8ff7
Compare
davidB
left a comment
There was a problem hiding this comment.
iirc, dependabot (our dependencies updater), is able to handle the commit SHA for the action version.
|
I added What do you prefer, "Squash and merge" or "rebase", when I'll merge the PR? |
Add an independent workflow that runs Plumber to scan the GitHub Actions workflows for CI/CD security issues on every push and pull request to main. The report is uploaded to the Security tab as SARIF. The check fails only when the Plumber Score drops below C. Publishing the score to the hosted badge service is left disabled. Signed-off-by: Thomas Boni <thomas@getplumber.io>
Pin the third-party actions used by the ci, linter and release-plz workflows to full commit SHAs, keeping the version as a trailing comment for Dependabot. A moving tag can otherwise change the code that runs in CI without any local change. Once pinned by SHA, dtolnay/rust-toolchain can no longer read the toolchain from the ref, so it is set explicitly through the toolchain input. Signed-off-by: Thomas Boni <thomas@getplumber.io>
Add .plumber.yaml based on Plumber's github defaults, with every control kept enabled so none is silently turned off. The trustedGithubActions list is extended with the third-party actions this project already relies on (mise, sccache, commitlint, release-plz and rust-toolchain) so they pass the authorized-sources control. Code owner approval is not part of this project's branch protection policy, so branchMustBeProtected.codeOwnerApprovalRequired is set to false. Signed-off-by: Thomas Boni <thomas@getplumber.io>
Turn on score-push and grant id-token: write so the workflow publishes this repository's Plumber Score to the hosted score service on pushes to main. This keeps the README badge current. It makes the repository name and score public and does not publish on pull requests. Signed-off-by: Thomas Boni <thomas@getplumber.io>
Show the repository's Plumber Score in the README badge row. The badge is served by the hosted score service and updates after the plumber workflow publishes the score on pushes to main. Signed-off-by: Thomas Boni <thomas@getplumber.io>
65f8ff7 to
da2662b
Compare
|
Thanks for the review @davidB! The DCO is now ok. I generally rebase. All the commits here are independent, but if you prefer to keep a light commit history, I can squash all of them in one commit before. |
|
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. |
|
ok, I'll rebase when ready to merge. |
|
@davidB just so you know, the 2 GHAS alerts above come from the Plumber report. The Plumber check itself passes (min score is C, the repo scores B, see report), but Plumber also pushes its findings to code scanning, and this repo requires all alerts to be resolved before merging. Both alerts are about ISSUE-714 on the About the actual risk: the code fetched by the action comes from I see 2 options:
Let me know what you prefer. |
|
rust installed on runner has no garanty to be the latest or a specific version. Using So We can switch to mise action or dismiss the alert. |
|
@davidB agreed, keeping Switching to mise would also clear the alerts, but it pulls more tooling into the release jobs, so dismissing is simpler here. I can't dismiss the alerts myself, it requires maintainer rights: you can do it directly from the GHAS annotations on this PR or from the Security tab. After that the PR should be mergeable. |
|
@thomasboni Merci |
What this does
This PR adds a workflow (
.github/workflows/plumber.yml) that runs Plumber on every push and pull request to main. Plumber scans the repository's GitHub Actions workflows for CI/CD security issues and reports them to the Security tab.Running the scan surfaced a set of pre-existing findings, so the PR also hardens the current workflows. Three commits cover the scan and the hardening:
.plumber.yamlthat keeps every control enabled and allowlists the third-party actions this project already uses (mise,sccache,commitlint,release-plz,rust-toolchain).Local scan result
With these changes the local run reports:
One finding is left as a follow-up on purpose:
dtolnay/rust-toolchainruns therustupinstaller from a moving ref. Pinning the action by SHA does not remove this, because the fetch happens inside the action itself. Fixing it means installing the toolchain from a pinned, checksum-verified source, which would change how releases install Rust. Left out of scope here. Let me know what you think about this and if you want to talk about how to fix it.score-push: this PR publishes your plumber resultThe last two commits enable
score-pushand add a Plumber Score badge to the README. When the workflow runs on main, it publishes this repository's result to the hosted service atscore.getplumber.ioover OIDC (no secret required).This makes the repository name and its A to E score publicly visible, and the README badge reflects that score (the badge will remain
unknownoremptyuntil the first push to main on the upstreamcdevents/sdk-rust).If you would rather not publish it: just tell me and I will remove the 2 last commits from the PR. The scan and the hardening keep working either way.