Skip to content

chore(security): bump Go to 1.25.10, go-jose v4.1.4, add govulncheck CI#742

Open
UtkarshBhatthere wants to merge 4 commits into
mainfrom
chore/govulncheck-bumps
Open

chore(security): bump Go to 1.25.10, go-jose v4.1.4, add govulncheck CI#742
UtkarshBhatthere wants to merge 4 commits into
mainfrom
chore/govulncheck-bumps

Conversation

@UtkarshBhatthere
Copy link
Copy Markdown
Contributor

@UtkarshBhatthere UtkarshBhatthere commented May 27, 2026

Summary

  • Bumps Go directive microceph/go.mod from 1.25.7 → 1.25.10, clearing 8 Go stdlib vulnerabilities (net, crypto/x509, crypto/tls, net/http http2, archive/tar, os, net/url) reachable from microceph code paths.
  • Upgrades github.com/go-jose/go-jose/v4 from v4.1.3 → v4.1.4, clearing GO-2026-4945 / CVE-2026-34986 (JWE decryption panic).
  • Wires govulncheck into CI via a reusable composite action + two thin workflows (PR-diff gating, daily scheduled full scan).

govulncheck delta

Before: 13 called-path vulnerabilities (10 HIGH, 2 MEDIUM/MODERATE, 1 LOW).
After: 4 called-path vulnerabilities, all in github.com/canonical/lxd (no upstream fix available):

ID Module Status
GO-2026-4595 canonical/lxd no fix upstream
GO-2025-4121 canonical/lxd no fix upstream
GO-2025-4003 canonical/lxd no fix upstream
GO-2025-3999 canonical/lxd no fix upstream

These four require an upstream LXD release. Filing/tracking is a follow-up.

CI design

.github/actions/govulncheck — composite action. Installs Go + libdqlite (cgo), runs govulncheck -format json ./..., emits the JSON output and a count of called-path findings. fail-on-vuln input lets callers either gate (cron) or collect output silently (PR diff).

.github/workflows/vuln-scan-pr.yml — PR-time job. Paths-filtered on microceph/go.{mod,sum} and the action itself: GitHub skips the workflow entirely when no dep change is in the PR. When it does run, it scans both PR HEAD and base ref via the composite action and diffs the called-path OSV ID sets — failing only on net-new findings. Existing unfixed LXD vulns therefore don't block unrelated PRs.

.github/workflows/vuln-scan-cron.yml — daily 06:00 UTC scan of the full module on main, plus workflow_dispatch. On any called-path finding it opens (or comments on) a single tracking issue titled [vuln-scan] govulncheck found called-path vulnerabilities and auto-closes it when the next run is clean.

The earlier ad-hoc vuln-scan job that lived in tests.yml is removed in favour of the dedicated workflows above.

Test plan

  • govulncheck ./... rerun locally — 13 → 4 called vulns, all remaining are LXD-only with no fix
  • go build ./... clean
  • go test -short ./... passes (api, ceph, cmd, common, dsl, logger all OK)
  • jq extractor validated against real govulncheck -format json output (returns exactly the 4 LXD IDs, no false positives from module-only finding summaries)
  • CI vuln-scan-pr job: paths-filter triggers it (go.{mod,sum} touched in this PR); diff vs main should report only the unchanged 4 LXD vulns and pass (no net-new)
  • CI vuln-scan-cron job: workflow_dispatch trigger from main after merge should fail and open the tracking issue
  • CI static-checks + unit-tests green on this PR

🤖 Generated with Claude Code

@UtkarshBhatthere UtkarshBhatthere force-pushed the chore/govulncheck-bumps branch 2 times, most recently from 3f7a778 to 6373680 Compare May 27, 2026 11:58
Clears 9 of 13 govulncheck-called vulnerabilities on the microceph
module:

* 8 Go stdlib vulns (net, crypto/x509, crypto/tls, net/http http2,
  archive/tar, os, net/url) - fixed by Go toolchain bump 1.25.7 -> 1.25.10
* GO-2026-4945 (CVE-2026-34986) JWE decryption panic in go-jose/v4
  - fixed by upgrade v4.1.3 -> v4.1.4

The remaining 4 vulnerabilities (GO-2026-4595, GO-2025-4121,
GO-2025-4003, GO-2025-3999) are in github.com/canonical/lxd with no
upstream fix available yet.

Also wires up govulncheck in CI via a reusable composite action:

* .github/actions/govulncheck - composite action that installs Go +
  libdqlite, runs `govulncheck -format json ./...`, and emits the JSON
  output plus a count of called-path vulnerabilities. Configurable via
  `fail-on-vuln` so callers can either gate or just collect output.
* .github/workflows/vuln-scan-pr.yml - PR-time job, paths-filtered on
  microceph/go.{mod,sum} and the action itself. Scans PR head and base
  ref, diffs called-path OSV IDs, fails only on net-new findings. This
  keeps existing unfixed LXD vulns from blocking unrelated PRs while
  still catching new vulns introduced by dependency changes.
* .github/workflows/vuln-scan-cron.yml - daily 06:00 UTC scan of the
  full module on main, plus workflow_dispatch. On any called-path
  finding it opens (or comments on) a single tracking issue titled
  "[vuln-scan] govulncheck found called-path vulnerabilities", and
  auto-closes it when the next scan is clean.

The earlier ad-hoc vuln-scan job in tests.yml is removed in favour of
the dedicated workflows above.

Signed-off-by: Utkarsh Bhatt <utkarsh_bhatt@outlook.com>
Assisted-by: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@sabaini sabaini left a comment

Choose a reason for hiding this comment

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

Hey, some comments inline.

Comment thread .github/workflows/vuln-scan-pr.yml
Comment thread .github/workflows/vuln-scan-pr.yml
Comment thread .github/actions/govulncheck/action.yml Outdated
Comment thread .github/workflows/vuln-scan-cron.yml Outdated
UtkarshBhatthere and others added 2 commits May 29, 2026 14:23
- vuln-scan-pr: extend paths filter to include microceph/**/*.go so
  source changes that open new called-path vulns trigger the diff scan
- vuln-scan-pr: base scan now uses ./base/.github/actions/govulncheck
  so the scanner comes from the already-merged base ref, not from the
  PR head being evaluated
- govulncheck action: drop || true from jq call so a corrupt/missing
  output file fails loudly instead of producing a silently-clean result

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Utkarsh Bhatt <utkarsh.bhatt@canonical.com>
…rom vulns

vuln-scan-pr: post new called-path vuln findings as a PR comment instead
of failing the CI run. Adds pull-requests: write permission.

vuln-scan-cron: set fail-on-vuln: false and remove continue-on-error so
the job only fails on real infra errors. Gate issue open/close on
called-count output (string comparison) rather than step outcome, so an
infra failure never opens or suppresses a vuln tracking issue.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Utkarsh Bhatt <utkarsh.bhatt@canonical.com>
@UtkarshBhatthere UtkarshBhatthere force-pushed the chore/govulncheck-bumps branch from 2dc3d85 to 23b586d Compare May 29, 2026 10:08
Copy link
Copy Markdown
Collaborator

@sabaini sabaini left a comment

Choose a reason for hiding this comment

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

Hey, 2 questions left

Comment thread .github/workflows/vuln-scan-pr.yml Outdated
Comment thread .github/workflows/vuln-scan-pr.yml Outdated
Move ${{ github.event.pull_request.* }} expressions from inline bash
strings into named env vars to avoid mixing GHA template syntax inside
multiline shell strings. Add exit 1 after posting the PR comment so the
workflow job fails when new called-path vulnerabilities are found.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Utkarsh Bhatt <utkarsh.bhatt@canonical.com>
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