ci: harden workflows for OpenSSF Scorecard - #435
Merged
Conversation
Address Dangerous-Workflow, Pinned-Dependencies, and Token-Permissions
findings from the OpenSSF Scorecard.
- update-image-tags.yml: fix script injection. github.head_ref /
github.base_ref are attacker-controllable PR inputs; move them out of
inline ${{ }} in run:/github-script into env vars referenced as quoted
"$HEAD_REF"/$BASE_REF (shell) and ${process.env.BASE_REF} (JS).
- Pin all GitHub Actions to commit SHAs (# vX comments; Dependabot keeps
them current).
- Pin runner/Dockerfile base images to multi-arch manifest-list digests
(golang:1.26-alpine, alpine:3.23).
- Add top-level `permissions: contents: read` to runner-image.yaml and
runner-lint-test.yaml (the only workflows still defaulting to write-all);
job-level packages:write escalation preserved.
There was a problem hiding this comment.
Code Review
This pull request updates the base images in the Dockerfile to pin them to specific SHA256 digests. The reviewer pointed out that the specified Go version (1.26) and Alpine version (3.23) do not exist, which will cause build failures, and recommended correcting these version tags and digests.
blue4209211
previously approved these changes
May 29, 2026
Default-setup CodeQL doesn't pick up the runner because Linguist classifies this repo as Go Template + Shell (the Helm chart dominates). Explicit workflow scans runner/ Go code and the workflow files themselves on push, PR, and weekly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
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. |
blue4209211
approved these changes
May 29, 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.
Addresses OpenSSF Scorecard findings on
main.Changes
Dangerous-Workflow — fix script injection (
update-image-tags.yml)github.head_ref/github.base_refare attacker-controllable PR inputs (the PR branch/target name). They were interpolated inline via${{ }}intorun:shell and anactions/github-scriptbody. A PR from a branch named e.g.$(...)could execute arbitrary code on the runner. Moved them intoenv:vars and reference as quoted"$HEAD_REF"/$BASE_REF(shell) and${process.env.BASE_REF}(JS). The checkoutwith: ref:is left as-is — an action input, not a shell-injection sink.Pinned-Dependencies
# vXcomments. Dependabot (github-actionsecosystem, already configured) keeps them current.runner/Dockerfilebase images pinned to multi-arch manifest-list digests:golang:1.26-alpine(1.26.3-alpine3.23) andalpine:3.23(3.23.4).Token-Permissions
The 5 chart/release workflows already had top-level
permissions: contents: readonmain(the scorecard report was stale here). Added the same top-level block torunner-image.yamlandrunner-lint-test.yaml, which were still defaulting to write-all. Job-levelpackages: writeescalation inrunner-image.yamlis preserved.Verification
uses:references SHA-pinned (verified, none left on a@vNtag).${{ github.head_ref }}/${{ github.base_ref }}remaining in anyrun:orgithub-scriptbody.Not included (separate follow-ups)
govulnchecktriage + bumps inrunner/.