ci: scan the source code daily for vulnerable dependencies and malware #2336
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2336"
general
weight: 0.35
KaivalyaMDabhadkar
Summary
Closes #2331. Part of #2325.
Problem
The only security scan in our GitHub workflows is CodeQL, and it checks the code we write. Nothing checks the code we depend on: the Go modules listed in each
go.modfile and the Python packages listed in eachpoetry.lockfile. When one of those dependencies has a published vulnerability, nothing on GitHub tells us. Nothing checks the repository for malware either.What this PR adds
A new workflow, Daily Security Scan, runs every day at 07:30 UTC on the
mainbranch. A maintainer can also start it from the Actions tab. It runs two scans on GitHub-hosted runners:go.modandpoetry.lockfile in the repository and compares the versions in them with public vulnerability databases. The workflow reports a vulnerability only when a newer version of the dependency fixes it, so every report can be acted on.Where the results go
Both scans write their results in SARIF, a standard format for the output of analysis tools. The workflow uploads the SARIF files to GitHub code scanning, which is where CodeQL results already go. Each finding then appears as an alert in the repository's Security tab, under Code scanning. You can filter the alerts by tool (Grype or ClamAV).
An alert stays open until a later scan no longer reports it, for example after a dependency update. GitHub then closes it automatically. A maintainer can also dismiss an alert with a reason.
Grype gives each vulnerability a severity. This workflow shows medium, high and critical vulnerabilities as errors, and low and negligible ones as warnings. Both kinds are reported.
Files
.github/workflows/security-scan.yml: the daily workflow, with one job for each scan..github/actions/security-scan/action.yml: runs Grype and uploads its results. #2332 will use it again to scan our container images..github/actions/malware-scan/action.yml: runs ClamAV, converts its output to SARIF and uploads it.The two actions are based on the actions that do the same job in NVIDIA/aicr, another NVIDIA open source project. They differ in five ways:
scripts/retry.sh, which our other workflows use to try again after a network error.${{ }}expressions inside the script.What the first run will show
A test run in my fork (see Testing) reported 81 Grype alerts for 10 vulnerabilities. Most alerts are the same vulnerability in many modules, because each module has its own
go.modfile:golang.org/x/netv0.61.0 has two vulnerabilities, one high and one medium, and appears in 32go.modfiles. Version 0.62.0 fixes both.golang.org/x/cryptov0.58.0 has one vulnerability and appears in 10go.modfiles.github.com/go-jose/go-jose/v4has three vulnerabilities, one high and two medium.setuptools(two) andpygments(one) in twopoetry.lockfiles.tj-actions/changed-filesv42.1.0 in.github/workflows/lint-test.ymlhas advisory GHSA-mrrh-fwg8-r2c3, an attack in March 2025 that changed the action's version tags. Our workflow pins a commit from March 2024, so the attack does not affect us.The numbers change from day to day as the vulnerability databases are updated.
Some of these alerts come from
go.modfiles underdemos/,tilt/andtests/, which are not part of the product. #2330 adds a configuration file to exclude such paths, and a file to record vulnerabilities that do not affect NVSentinel, such as thetj-actionsadvisory.Type of Change
Component(s) Affected
Testing
Tested in my fork on a throwaway branch, because the workflow runs only from the default branch:
Checklist
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Added daily and manually triggered scans for repository vulnerabilities and malware.
Vulnerability findings for fixed issues at medium severity or higher are reported in GitHub’s Security tab. Scanner errors can fail the scan.
Malware scan results are reported in the Security tab, including files skipped because they exceed scan size limits. Detected infections or scan errors cause the scan to fail.
* Both scans let you select a path to scan, defaulting to the repository root.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->