Skip to content

fix(security): make the Trivy output limit configurable and stop refusing captured reports - #1358

Merged
scttbnsn merged 3 commits into
dev/v1.8from
fix/v1.8-trivy-output-limit
Oct 12, 2026
Merged

scttbnsn merged 3 commits into
dev/v1.8from
fix/v1.8-trivy-output-limit

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

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 raw stdout maxBuffer length exceeded or Scanner 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

  • ✨ Added DD_SECURITY_TRIVY_MAXOUTPUTBYTES with a 64 MiB default and a validated range of 1 MiB to 1 GiB.
  • 🔧 Changed Trivy vulnerability scans and SBOM generation to use the configured limit for capturing and parsing output.
  • 🐛 Fixed oversized Trivy reports being rejected by a lower parsing limit after capture. Trivy output-limit errors now identify DD_SECURITY_TRIVY_MAXOUTPUTBYTES.
  • ✨ Added configuration, output-limit, overflow, and documentation coverage.

Concerns

  • Test execution results are not provided.
  • Current review findings and severity counts are not provided.

@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
drydock-website Ready Ready Preview Oct 12, 2026 2:49am UTC
drydockdemo-website Ready Ready Preview Oct 12, 2026 2:49am UTC

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: CodesWhat/drydock/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3397e29b-b53c-4f41-9025-ba5eb78c94de

📥 Commits

Reviewing files that changed from the base of the PR and between b93f5f4 and b955a6f.


⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md

📒 Files selected for processing (5)
  • app/configuration/index.test.ts
  • app/configuration/index.ts
  • app/security/scan.test.ts
  • app/security/scan.ts
  • content/docs/current/configuration/security/index.mdx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

Trivy’s maximum output size is configurable from 1 MiB to 1 GiB, with a default of 64 MiB. Trivy scans and SBOM generation use this limit for output capture. Trivy parsing enforces the configured limit. CLI and Docker-worker output-limit errors identify the setting. Tests and security configuration documentation cover the new behavior.


Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to b955a

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 | Passed 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn
scttbnsn merged commit 8c691e8 into dev/v1.8 Oct 12, 2026
@scttbnsn
scttbnsn deleted the fix/v1.8-trivy-output-limit branch October 12, 2026 03:19

This branch was successfully deployed

2 active deployments
Preview – drydock-website — b955a6f7 Deployed Oct 12, 2026 by vercel[bot]
Preview – drydockdemo-website — b955a6f7 Deployed Oct 12, 2026 by vercel[bot]
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.

1 participant