Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a Python script to generate severity-sorted Markdown reports from Trivy JSON output and includes a new document tracking potential security vulnerabilities. Additionally, it hardens cgroup path validation in src/nxt_conf_validation.c by rejecting embedded NUL bytes and using snprintf, with a corresponding test case added. Review feedback suggests enhancing the Markdown escaping logic to handle backslashes and removing redundant severity normalization in the sorting process.
|
Reworked. The C-hardening half of this draft (cgroup/rootfs embedded-NUL + Deliberately not carried over:
This draft can be closed once both land. |
|
The Trivy half is now reworked as freeunitorg/freeunit#99 (report-only by default, With the C validation fix in freeunitorg/freeunit#95 and the workflow in freeunitorg/freeunit#99, this draft is fully superseded and can be closed once both land. |
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>
Motivation
Description
.github/scripts/sort-trivy-results.pywhich parses Trivy JSON output, sorts vulnerabilities by severity and CVSS v3 score, renders a Markdown report, and can exit non-zero when a configured severity threshold is met..github/workflows/security-audit.ymlGitHub Action to run Trivy (JSON and SARIF), upload SARIF, generate the sorted Markdown report, append it to the step summary, and upload thesecurity-audit/artifact.docs/security-audit-findings.mddocumenting candidate findings from a manual review of the new audit/workflow and adjacent code paths.src/nxt_conf_validation.cfor cgroup paths by rejecting empty strings and embedded NUL bytes, replacing asprintfwithsnprintfto avoid unsafe formatting, and preserving the existing ".." path check.test/test_python_isolation.pyto include a test case that asserts a cgroup path containing an embedded NUL ('scope\0python') is treated as invalid.Testing
test/test_python_isolation.py::test_python_isolation_cgroup_invalidwas run and the new case for embedded NULs passed.Codex Task