ci(security): close OSSF Scorecard Dangerous-Workflow and Pinned-Dependencies findings#137
Merged
Merged
Conversation
- e2e-smoke.yml: pin actions/checkout and actions/setup-go to full SHAs matching build.yml (closes #60, #61). - Dockerfile: document why alpine:3.23 is intentionally not digest-pinned (multi-arch manifest list; dependabot tracks weekly). Alert #58 to be dismissed in the UI as Won't Fix. - build.yml: add Resolve and verify build SHA step in build-and-push and merge-manifest jobs. The step asserts workflow_run.head_sha is reachable from main (or is the tip of a v* tag) before checkout/imagetools consume it via steps.resolve_sha.outputs.sha. Narrows the trust boundary and avoids Scorecards dangerous-workflow pattern (targets #57). - .gitleaksignore: add working-tree fingerprint variant for the e2e fixture meta.json so go-pre-commit's local scan honors the same exemption that the committed-history scan already had.
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.
What Changed
.github/workflows/e2e-smoke.yml— pinnedactions/checkout@v4andactions/setup-go@v5to the same full SHAs already used bybuild.yml(actions/checkout@de0fac2…v6.0.2 /actions/setup-go@4a36011…v6.4.0). Closes the two Pinned-Dependencies Scorecard alerts one2e-smoke.yml:35ande2e-smoke.yml:38.Dockerfile— added a comment aboveFROM alpine:3.23explaining why the base image is intentionally not digest-pinned (multi-arch manifest list consumed by the matrixamd64+arm64build; Dependabot'sdockerecosystem already tracks weekly). No functional change. Targets the Pinned-Dependencies Scorecard alert onDockerfile:13(to be dismissed in the UI as Won't Fix)..github/workflows/build.yml— added aResolve and verify build SHAstep at the top of bothbuild-and-pushandmerge-manifest. The step:workflow_runevents, falls through to${{ github.sha }}.workflow_runevents, assertsworkflow_run.head_shais either reachable frommain(gh api compare/main...<sha>returnsidenticalorbehind) or is the tip of av*tag (gh api git/refs/tags/<branch>matcheshead_sha). Otherwise the job fails.steps.resolve_sha.outputs.sha. The checkoutref:and theSHA_TAGenv vars inmerge-manifestnow consume that output instead of feedingworkflow_run.head_shadirectly intoactions/checkout/imagetools. Targets the critical Dangerous-Workflow Scorecard alert onbuild.yml:129..gitleaksignore— added the working-tree fingerprint variant for the existing e2e fixturemeta.jsonsogo-pre-commit's local scan honors the same exemption that the committed-history scan already had. Drive-by fix; the file was added in Add e2e tests with real block data #136 and was breaking every local commit onmain.Why It Was Necessary
OSSF Scorecard flagged 4 open code-scanning alerts on
main(1 critical Dangerous-Workflow, 3 medium Pinned-Dependencies). The repo already has strong supply-chain hygiene elsewhere —build.yml,codeql-analysis.yml, andscorecard.ymlpin every action to a full SHA, anddependabot.ymlbumpsgithub-actionsanddockerweekly. The newly-addede2e-smoke.ymland thealpine:3.23base slipped through; theworkflow_run-triggered checkout inbuild.ymlwas added in #128 to gate image publishing on GoFortress and is logically safe but matches Scorecard's static dangerous pattern.Testing Performed
actionlint .github/workflows/build.yml .github/workflows/e2e-smoke.yml→ clean.go-pre-commit run→ all 6 checks pass.docker buildwas not run — Docker daemon isn't running on this machine and the Dockerfile change is comment-only.Impact / Risk
build.ymlSHA verification: Adds twogh apicalls per build (one inbuild-and-push, one inmerge-manifest) usingsecrets.GITHUB_TOKEN. No functional change forpull_request/workflow_dispatchpaths (early-exits togithub.sha). Forworkflow_runpaths, the gate is stricter — a head_sha not reachable frommain(or not matching itsv*tag) now fails the build instead of silently being checked out. This is the intended trust-boundary tightening.e2e-smoke.ymlpins: Dependabot'sgithub-actionsecosystem will continue to bump these SHAs..gitleaksignore: local-only effect; CI scan was already passing.Caveat noted in plan: Scorecard's dangerous-workflow check is pattern-based. If the matcher only looks for
actions/checkoutinside aworkflow_runworkflow regardless ofref:source, thebuild.ymlalert may persist after re-scan. Fallback options if that happens:build.ymlto aworkflow_callreusable workflow invoked from the end of GoFortress (Scorecard does not flagworkflow_call).workflow_runand trigger directly onpushtomain/v*, relying on branch protection (GoFortress required check) for the gate.Post-merge follow-up
workflow_dispatchand confirm the twoe2e-smoke.ymlPinned-Dependencies alerts close.Dockerfile:13Pinned-Dependencies alert in the GitHub code-scanning UI: Reason: "Won't fix" — Comment: "Multi-arch base image; manifest-list pinning offers no real supply-chain benefit over weekly Dependabot bumps and complicates per-arch builds. See Dockerfile comment."workflow_run-triggered build to confirm the verification step passes for a real push tomain.build.ymlDangerous-Workflow alert persists after re-scan, escalate to theworkflow_callfallback above.Notifications