Skip to content

fix: backport Go and dependency security fixes to production - #161

Open
dustin-decker wants to merge 2 commits into
release/69f3ab6from
hotfix/go-1.26.10-from-69f3ab6
Open

dustin-decker wants to merge 2 commits into
release/69f3ab6from
hotfix/go-1.26.10-from-69f3ab6

Conversation

@dustin-decker

@dustin-decker dustin-decker commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

SYNOPSIS

Backport Go 1.26.10 and fixed dependencies onto the exact deployed revision, 69f3ab6.

PURPOSE

Production's binary was built with Go 1.26.5 and has reachable dependency advisories. Current main uses OPA v1 and rejects production's Rego v0 policies, so this hotfix preserves the deployed application code and Rego v0 parsing.

DESCRIPTION

Pin both setup-go workflows and go.mod to Go 1.26.10. Upgrade x/net to v0.60.0 for GO-2026-6603, GO-2026-6610, GO-2026-6611, GO-2026-6612, and GO-2026-6617. Upgrade OPA to the first fixed v0 release, v0.68.0 (GO-2024-3141), gRPC to v1.83.2 (GO-2026-6061, GO-2026-6348, and GO-2026-6443), and OpenTelemetry SDK to v1.45.0 (GO-2026-6505 and GO-2026-6616). gRPC requires protobuf v1.36.11, which also fixes GO-2024-2611. Other module changes follow these requirements.

Add an opt-in test that loads an external production policy snapshot through the engine. It requires cloud-sql-connect.rego, evaluates the compiled rules with an empty input, and decodes the results the same way the engine does for each message. A package-level value such as allowed := ["a"] therefore fails the test, because the engine cannot decode it as a list of violations. Production policy contents remain outside this public repository.

NOTES

  • Base: release/69f3ab6 points exactly at the deployed commit. No established hotfix branch convention was found. This PR targets that release branch, not main; main's separate update is fix: update Go and HTTP dependencies for security fixes #160.
  • Validation: GOTOOLCHAIN=go1.26.10 LOGWARDEN_POLICY_TEST_DIR=/tmp/logwarden-go-evidence/warden-policies/gcp go test ./... passes. OPA v0.68.0 passes all 57 tests in the current warden production policy snapshot. Both Linux release architectures build with CGO_ENABLED=0 and report go1.26.10. GOTOOLCHAIN=go1.26.10 govulncheck ./... reports zero called and zero imported-package vulnerabilities, with two unused module advisories.
  • Remaining scope: the unused OPA server API injection advisory GO-2025-3660 requires OPA v1.4.0; this application embeds evaluation and does not run that server. The unmaintained, unused x/crypto/openpgp advisory has no fix. The inherited lint action installs a linter built with Go 1.24 and fails before analysis on the Go 1.26.10 target (run). A modern linter exposes 13 existing errors; those application/lint repairs remain separate.
  • Runtime defaults: raising the go directive from 1.19 to 1.26.10 drops the Go 1.20 compatibility GODEBUG settings, so runtime defaults change even though no application source changes. GOMAXPROCS now follows the Cloud Run CPU limit instead of the host CPU count. TLS clients now offer X25519MLKEM768 and no longer offer RSA key exchange, 3DES, or SHA-1 signatures; Google APIs support these defaults. The timer, HTTP mux, and nil-panic defaults also change. Review found no application code that depends on the old timer or HTTP mux behavior.
  • Pub/Sub retry timing: Pub/Sub moves from v1.33.0 to v1.50.1. In v1.50.1 a nacked message can be redelivered only after up to one ack deadline (20 s on the production subscription) instead of immediately. The subscription's 10 s minimum backoff already delays redelivery, and messages are not lost.
  • Release: merging does not build an image. Build the merged release branch with Go 1.26.10, publish a new digest, then update warden's digest pin and run its manual logwarden-prod workflow under separate deployment authorization. Do not push a v* tag from release/69f3ab6. The tag-triggered release.yml cannot build from this branch: it installs the latest GoReleaser, and GoReleaser v2 rejects its --rm-dist flag. It also publishes only to GHCR, not the production registry. Build the production image manually.
  • Rollback: revert this PR on release/69f3ab6 before an image release. No image, deployment, or production state changes are included.

Note

Cursor Bugbot is generating a summary for commit 51a2007. Configure here.

dustin-decker and others added 2 commits October 25, 2026 21:48
The snapshot test only checked that the policy set evaluates. The engine
also decodes every rule in data as a list of violations, so a
package-level value such as `allowed := ["a"]` passed the test while
making every message fail to decode. Call evaluate with an empty input
so the test covers decoding too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 51a2007. Configure here.

if err != nil {
t.Fatal(err)
}
if err := eng.evaluate(context.Background(), map[string]interface{}{}); err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test can hang without alert consumer

Medium Severity

TestProductionPoliciesCompile now calls evaluate with a non-cancellable context and no Alert consumer. evaluate blocks on the unbuffered results channel whenever a policy produces a violation, so any production rule that matches empty input will hang the test until the Go test timeout.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 51a2007. Configure here.

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.

1 participant