Skip to content

ci: CodeQL, dependabot coverage, x/mod advisory bump (Scorecard) - #49

Merged
deadpoets merged 2 commits into
mainfrom
scorecard-hardening
Aug 17, 2026
Merged

ci: CodeQL, dependabot coverage, x/mod advisory bump (Scorecard)#49
deadpoets merged 2 commits into
mainfrom
scorecard-hardening

Conversation

@deadpoets

Copy link
Copy Markdown
Owner

Three fixes from a local OpenSSF Scorecard preview (aggregate 6.6/10, run via the official container against the GitHub API — nothing published).

  • CodeQL workflow (SAST: 0/10 — no analysis runs found on any of the last 30 commits). build-mode: none because autobuild stops at the first go.mod and this repo has four; source-only scanning covers all of them in one job. Both actions SHA-pinned per repo convention. Weekly cron keeps the default branch from going stale between merges.
  • secmem-lint: x/mod v0.38.0 → v0.40.0 (Vulnerabilities: 7/10). Clears GO-2026-6179 and GO-2026-6180 (sumdb transparency-log verification fixes). x/tools moves to v0.49.0 alongside. Built and tested under GOWORK=off.
  • dependabot: add /secmem-lint and /examples to the gomod ecosystem. Their omission is exactly how the x/mod lag survived two releases of a published advisory unnoticed.

Not addressed, deliberately:

  • GO-2026-5932 ("openpgp is unmaintained") has no fixed version and flags any module graph containing x/crypto at all — unclearable while secmem-crypto exists. Caps Vulnerabilities at 9.
  • gorelease@latest at ci.yml:335 stays unpinned; the in-file rationale (x/exp publishes no tags, a pseudo-version pin rots invisibly) predates and outranks the Scorecard point. Accepted -1 on Pinned-Dependencies.
  • Branch-Protection: 5/10 is capped by enforce_admins: false, which is the bypass that permits solo self-merge past the required review. Owner's call, not a PR.

SAST scores over the last 30 commits, so the check climbs gradually after this merges rather than jumping to 10.

🤖 Generated with Claude Code

@github-advanced-security

Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@deadpoets
deadpoets force-pushed the scorecard-hardening branch from 755bd43 to 0b91876 Compare August 16, 2026 22:24
deadpoets added a commit that referenced this pull request Aug 17, 2026
… of them (#50)

`apicompat.sh` treated **every** non-zero `gorelease` exit as a tool
failure.
Two conditions observed in one week are not tool failures, and both
produced a
red required check on PRs whose content had nothing to do with them.

## 1. Transient module resolution

Publishing a version puts it on the git remote immediately, but on
`proxy.golang.org` and `sum.golang.org` only after a propagation delay.
In that
window anything resolving the module 404s.

The `retract` directive added in #47 makes this **worse**, not better:
retractions live in the *latest* version's `go.mod`, so every resolution
path
must now fetch exactly the version that was just published.

Today that failed `apicompat` on both open PRs simultaneously — #48
(gitignore
patterns) and #49 (CodeQL) — neither of which touched Go code:

```
gorelease: go: loading module retractions for …@v0.0.0-gorelease:
  verifying go.mod: …@v0.3.2/go.mod:
  reading https://sum.golang.org/lookup/…@v0.3.2: 404 Not Found
```

## 2. "Cannot suggest a release version"

A legitimate `gorelease` result, not an error — it declines when the
base isn't
the most recent version of the major, which is exactly the state a
dependency
floor-raise PR is in. This is the same deadlock the script's own header
already
describes for API breaks, and it deserves the same treatment.

It failed PR #44 and was worked around with an admin merge.

## The change

Both become warnings with actionable titles. **Anything else non-zero
still
exits 1** — a parse error, a missing binary, or an auth failure must not
pass
silently. The script's one failing path is only worth having if it means
something.

Not retried on the transient path: the propagation window is minutes to
tens of
minutes, far longer than a job should sit spinning.

## Verification

Classifier tested against eight cases, including the two **real**
failure
outputs captured from CI:

| input | verdict |
|---|---|
| sumdb 404 / unknown revision *(today's failure)* | WARN transient |
| "Cannot suggest a release version" *(PR #44's failure)* | WARN
inconclusive |
| clean run | pass |
| compatible additions | pass |
| incompatible API change | WARN *(existing behavior, unchanged)* |
| network failure (`no such host`) | WARN transient |
| `go.mod` parse error | **ERROR, exit 1** |
| `gorelease: command not found` | **ERROR, exit 1** |

Also run live against the real condition. It correctly errored on a
genuine
precondition failure (uncommitted changes in the tree) before the
commit, and
returned a clean comparison after — `Suggested version: v0.3.3`.

---------

Co-authored-by: Chris Fink <7587613+deadpoets@users.noreply.github.com>
Three findings from an OpenSSF Scorecard run (aggregate 6.6):

- CodeQL workflow, build-mode none — the only mode that covers all four
  modules in one job. Satisfies the SAST check, which found no analysis
  runs on any recent commit.
- secmem-lint: x/mod v0.38.0 -> v0.40.0 (fixes GO-2026-6179 and
  GO-2026-6180, sumdb transparency-log verification), x/tools v0.49.0
  alongside. Tooling-only exposure, but two releases stale.
- dependabot: cover /secmem-lint and /examples. Their omission is how
  the x/mod lag went unnoticed.

The remaining flagged vulnerability (GO-2026-5932, "openpgp is
unmaintained") has no fixed version and flags any graph containing
x/crypto; it is not actionable here.
The Go extractor supports only autobuild and manual; init fails fast on
none. Manual reuses the same go.work union as CI so one root build
covers core, crypto and lint, with examples built under GOWORK=off.
Go version comes from go.mod, not a second pin site.
@deadpoets
deadpoets force-pushed the scorecard-hardening branch from 0b91876 to 48feb95 Compare August 17, 2026 00:38
@deadpoets
deadpoets merged commit c6ef0f7 into main Aug 17, 2026
41 of 42 checks passed
@deadpoets
deadpoets deleted the scorecard-hardening branch August 17, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants