Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new Python script, sort-trivy-results.py, which parses Trivy JSON output and generates a severity-sorted Markdown security audit report. The review feedback identifies two potential runtime crashes: one where an explicitly null CVSS source can cause an AttributeError when fetching the V3Score, and another where a null 'Results' field can cause a TypeError during iteration. Both comments provide actionable code suggestions to make the JSON parsing more robust.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Pushed
|
Scan the tree (Cargo.lock, go.mod/sum, package-lock, requirements, Dockerfiles) with Trivy on a weekly schedule, on pushes/PRs touching dependency manifests, and on demand. Findings are uploaded as SARIF to the Security tab and rendered into a severity-sorted Markdown report (sort-trivy-results.py) appended to the job summary and artifact. Automatic runs are report-only and never fail the build; a blocking severity gate is opt-in via workflow_dispatch. security-events:write is scoped to the audit job, not the whole workflow. The report parser guards Trivy edge outputs: a CVSS source whose value is explicitly null, a null "Results" field, and a non-dict top-level report, all of which would otherwise raise. Reworked from the CI portion of andypost#26; the cgroup/rootfs config-validation fix from that draft ships separately in #95. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dbfbed2 to
0d6abc9
Compare
|
@claude review once |
|
Claude finished @TuzelKO's task in 1m 22s —— View job Review: Trivy security auditOverall this is a well-scoped, well-documented workflow. Least-privilege permissions, report-only-by-default with an opt-in gate, and the executable bit on the script ( One thing worth a second look before merge, plus a few minor notes. 🔴 Unrelated
|
There was a problem hiding this comment.
because master is never the default branch as we do all preparations in pre-1.x.y branches
Summary
Reworked from the CI portion of the stale draft andypost/unit#26. Adds a Trivy filesystem scan that catches known-vulnerable dependencies (Rust
Cargo.lock, Go modules, npm, Python requirements, Docker base images) — exactly the class of stale-lockfile CVE that had to be triaged by hand this cycle (e.g. the wasmtime 35→36 and rustls-webpki bumps)..github/workflows/security-audit.yml— runs Trivy on a weekly schedule, on push/PR touching dependency manifests, and viaworkflow_dispatch. Uploads SARIF to the Security tab and appends a severity-sorted Markdown report to the job summary + artifact..github/scripts/sort-trivy-results.py— parses Trivy JSON, sorts by severity then CVSS v3, renders the report, and can exit non-zero at a configurable threshold.What changed vs the andypost/unit#26 draft
workflow_dispatch, so a newly-disclosed lockfile CVE annotates PRs instead of turning unrelated builds red.security-events: writeis scoped to the audit job; the workflow default iscontents: read.docs/security-audit-findings.mdfile (a public list of suspected-unfixed issues — kept out of the repo for disclosure hygiene).github/codeql-action/upload-sarifto@v3(v4 does not exist) andpush.branchesto a list.Actions use major-version tags, matching the existing workflows (Dependabot manages the bumps). SHA-pinning all actions is a reasonable repo-wide follow-up but out of scope for one workflow.
Testing
sort-trivy-results.pysmoke-tested against a synthetic Trivy JSON:--fail-on-severity NONEexits 0 (report-only), an explicitHIGHgate exits 1, and rows sort CRITICAL → HIGH → LOW with CVSS as the tiebreak.🤖 Generated with Claude Code