Repository navigation
fix(security): make the Trivy output limit configurable and stop refusing captured reports - #1358
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to This change makes the Trivy output limit configurable and stops rejecting reports that were already captured. No merge-blocking risk was identified. Pre-merge checks |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
A scan of a large image failed with
Trivy output is too large to parse (40313952 bytes); max supported is 20971520 bytes, which blocked that container's update (#1356).Trivy output was captured up to 50 MB but refused at a separate hardcoded 20 MB when parsed, so any report between the two was collected and then thrown away.
Capture and parse now share one limit,
DD_SECURITY_TRIVY_MAXOUTPUTBYTES: 64 MB by default, 1 MB to 1 GB. It applies to both Trivy invocations (vulnerability scan and SBOM) on the command and Docker worker backends. Going over it fails with a message that names the variable, instead of the rawstdout maxBuffer length exceededorScanner worker output exceeded N bytes, and it isn't retried as transient.Tests cover a report between the old cap and the new default, a configured higher and lower limit for both capture and parse, the overflow message on both backends, and config validation at the bounds. The Docker worker path is tested against a mocked runtime rejection, not a real worker.
Changelog
DD_SECURITY_TRIVY_MAXOUTPUTBYTESwith a 64 MiB default and a validated range of 1 MiB to 1 GiB.DD_SECURITY_TRIVY_MAXOUTPUTBYTES.Concerns