Skip to content

feat: enable govulncheck security scanner - #10204

Open
Artur Khantimirov (r2k1) wants to merge 10 commits into
devfrom
r2k1-go-vulnerability-check
Open

Artur Khantimirov (r2k1) wants to merge 10 commits into
devfrom
r2k1-go-vulnerability-check

Conversation

@r2k1

@r2k1 Artur Khantimirov (r2k1) commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: f69b156099212b960b12c961d62b2e91576ee53c

Dimension Assessment Rationale
Change confidence 8/10 ↑ aks-live-patching builds, tests pass, and govulncheck reports no reachable findings after the x/net bump.
↑ actionlint passes locally; zizmor passed on earlier revisions of this workflow.
↑ SARIF path rewrite checked on real output and on a synthetic ../ case.
↓ The scheduled SARIF upload runs only from the default branch, so it is untested until merge.

What this PR does / why we need it:

AgentBaker has no Go vulnerability scanner. A local govulncheck run found 4 reachable vulnerabilities in golang.org/x/net v0.58.0 in aks-live-patching (GO-2026-6617, GO-2026-6612, GO-2026-6611, GO-2026-6603).

  • Bump golang.org/x/net to v0.60.0 (with x/sys v0.48.0 and x/text v0.42.0) in aks-live-patching.
  • Add .github/workflows/govulncheck.yml: daily (and manual) scan of each Go module on the default branch; uploads SARIF to Security → Code scanning (one category for each module). Paths are rewritten to be repository-relative. Scanner errors fail the job.
  • No PR trigger, so no PR run holds a write-scoped token.
  • Why: Dependabot uses only the GitHub Advisory Database, which has no advisories for the 4 x/net CVEs above (published in the Go vulnerability database on 2026-10-08).

Notes:

  • Scheduled workflows run on the default branch (dev now, main later), so the scan follows the default branch without changes.
  • The module list is fixed. Add new Go modules to the matrix.

Testing:

  • go build ./... && go test ./... in aks-live-patching: passed.
  • govulncheck ./... for all modules (GOOS=linux): no reachable findings after the bump.
  • actionlint .github/workflows/govulncheck.yml: passed.

Which issue(s) this PR fixes:

AB#40920245

Bump golang.org/x/net to v0.60.0 in aks-live-patching to fix 4 reachable
vulnerabilities (GO-2026-6617, GO-2026-6612, GO-2026-6611, GO-2026-6603).
Add a daily govulncheck workflow that scans each Go module on main and
uploads SARIF results to code scanning.

AB#40920245

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   21 suites   1m 25s ⏱️
817 tests 817 ✅ 0 💤 0 ❌
844 runs  844 ✅ 0 💤 0 ❌

Results for commit f69b156.

♻️ This comment has been updated with latest results.

AB#40920245

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Module-relative SARIF paths misattribute nested-module alerts to the root go.mod and can direct call-trace links to the wrong files.

1 open issue
What changed in this PR

Adds scheduled Go vulnerability scanning for AgentBaker’s released code and updates live-patching dependencies to address reported vulnerabilities.

Changes:

  • Runs govulncheck daily against six Go modules on main.
  • Uploads SARIF reports to GitHub code scanning with a separate category per module.
  • Updates live-patching dependencies: x/net to v0.60.0, x/sys to v0.48.0, and x/text to v0.42.0.
File Description
aks-live-patching/​go.sum Updates checksums for the upgraded dependencies.
aks-live-patching/​go.mod Selects the updated networking and supporting dependencies.
.github/​workflows/​govulncheck.yml Adds daily module scans and SARIF uploads for main.

Review effort: Balanced

Comment thread .github/workflows/govulncheck.yml Resolved
Copilot AI balanced review requested due to automatic review settings November 26, 2026 22:48
AB#40920245

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A same-repository PR can rewrite the workflow to misuse its write-scoped GitHub token, leaving a critical security risk unresolved.

3 open issues
1 resolved since last review

Review effort: Balanced

Comment thread .github/workflows/govulncheck.yml Resolved
Comment thread .github/workflows/govulncheck.yml Resolved
Comment thread .github/workflows/govulncheck.yml Resolved
Copilot AI balanced review requested due to automatic review settings November 26, 2026 22:56
AB#40920245

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The PR-controlled workflow grants write-capable tokens, allowing same-repository PRs to modify pull requests or code-scanning results before review.

3 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Scanner failures are swallowed and reported as findings

.github/​workflows/​govulncheck.yml:59

🟡 Medium Risk — 🔧 Script Logic: Any go run failure sets found=true, including scanner-download and package-loading errors. The || echo also makes the failed scan succeed, so it posts a vulnerability comment even though no assessment completed. Install the pinned scanner separately, invoke it directly, and treat only its vulnerability exit code (3) as non-blocking; let other errors fail the step.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 26, 2026 23:02
Drop PR comments: a pull_request run with write scopes can be abused by
a same-repo PR, and Dependabot PRs get a read-only token.

AB#40920245

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The PR-controlled vulnerability workflow exposes write-scoped tokens to misuse, while Dependabot comment authorization failures cause the intended non-blocking scan to fail.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 26, 2026 23:07
The PR scan runs read-only and uploads a report artifact. A trusted
workflow_run workflow (same pattern as go-test-publish.yml) posts a
sticky comment and deletes it when findings are fixed.

AB#40920245

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the recurring vulnerability scans and live-patching dependency updates.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 26, 2026 23:11
AB#40920245

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The vulnerability workflow can miss Go-source-only changes, publish incomplete results from failed or cancelled scans, and let superseded scans overwrite or delete newer reports.

3 open issues

Review effort: Balanced

Comment thread .github/workflows/govulncheck-pr.yml Resolved
Copilot AI balanced review requested due to automatic review settings November 26, 2026 23:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The publisher can overwrite or delete valid vulnerability warnings using incomplete results from failed or cancelled scans or stale results from older PR revisions because it lacks success and current-head checks.

3 open issues

Review effort: Balanced

Remove the separate PR scan and workflow_run publisher. The comment
step tolerates Dependabot's read-only token.

AB#40920245

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The workflow swallows scanner failures other than exit code 3, allowing dependency PRs to receive a green check without a completed scan.

1 open issue
3 resolved since last review

Review effort: Balanced

Comment thread .github/workflows/govulncheck.yml Resolved
Run govulncheck only on schedule and manual dispatch, so no PR run
holds a write-scoped token.

AB#40920245

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the vulnerability-scanning workflow and dependency updates.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

run: |
# govulncheck reports paths relative to the module (e.g. "go.mod", "../pkg/x.go" in e2e).
# Make them relative to the repository root so alerts link to the correct file.
go run golang.org/x/vuln/cmd/govulncheck@v1.10.0 -C "$MODULE" -format sarif ./... |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we're required to use commit SHAs rather than version tags - as the version tag can change without us knowing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And will the go vunl check pick up vunerabilities in go vunl check when it's invoked in the pipeline in this way? We should make sure it scans itself :)

Drop the main pin; scheduled runs scan the default branch, which will
become main.

AB#40920245

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
test 0% ❌
windows 27% ❌
parts_windows Package 1 74% ➖
staging_cse_windows Package 1 72% ➖
debug 0% ❌
provisioningscripts 2% ❌
Summary 40% (2077 / 7284) ❌

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block approval of the Go vulnerability monitoring and dependency updates.

No open issues 🎉

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 30% ❌
Summary 30% (5129 / 16918) ❌

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
github.com/Azure/agentbaker/aks-live-patching/pkg/status 100% ✔
github.com/Azure/agentbaker/apiserver 52% ❌
github.com/Azure/agentbaker/cmd 0% ❌
github.com/Azure/agentbaker/cmd/starter 0% ❌
github.com/Azure/agentbaker/fuzz/api 0% ❌
github.com/Azure/agentbaker/hotfix/render-nodecustomdata 35% ❌
github.com/Azure/agentbaker/pkg/agent 79% ➖
github.com/Azure/agentbaker/pkg/agent/datamodel 78% ➖
github.com/Azure/agentbaker/pkg/agent/toggles 0% ❌
github.com/Azure/agentbaker/pkg/vhdbuilder/datamodel 87% ✔
github.com/Azure/agentbaker/aks-node-controller 73% ➖
github.com/Azure/agentbaker/aks-node-controller/common 100% ✔
github.com/Azure/agentbaker/aks-node-controller/helpers 68% ➖
github.com/Azure/agentbaker/aks-node-controller/parser 88% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/gpu 100% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/nodeconfigutils 91% ✔
github.com/Azure/agentbaker/aks-node-controller/utils 0% ❌
Summary 84% (6297 / 8227) ✔

This branch was successfully deployed

1 active deployment
test — f69b1560 Deployed Nov 27, 2026 by r2k1 via auto-tidy #879
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.

4 participants