Skip to content

Address BOOSTSP-795 - Trivy silently failing#308

Closed
Franck-Boost wants to merge 2 commits into
mainfrom
BOOSTSP-795
Closed

Address BOOSTSP-795 - Trivy silently failing#308
Franck-Boost wants to merge 2 commits into
mainfrom
BOOSTSP-795

Conversation

@Franck-Boost

Copy link
Copy Markdown
Collaborator

Problem statement:

When an error during a Trivy scan, the error reported to the dashboard doesn't include any meaningful information (see below). Even if the log level of the scanning is increased there is no additional information provided to the dashboard.

14:57:26 [ERROR] boost.app: command 'sh -ec $SETUP_PATH/trivy fs  --cache-dir=/tmp...' exited with non-zero exit status: 1
Error: Process completed with exit code 1.

What it is in this PR:

This PR modify Trivy based scanner modules to do the follow (boost-sca, trivy-fs, trivy-sbom, trivy-image, trivy-image-sbom):

  • Increase the output level of Trivy to debug.
  • Capture the Trivy output to a scanner log file.
  • Output the scans results to a report file.
  • Check if the Trivy scan fail. If it fails output the scanner logs to stdout. If it pass output the report file to stdout.

@Franck-Boost
Franck-Boost requested a review from lindycoder July 17, 2026 16:39

@lindycoder lindycoder left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution solves the hardfailure, but it regresses for an unpinned requirement.txt, an empty requirements.txt and an unparseable lockfile.

Additionnally, there are these changes without a note on the pr description

  • the default additional args have been changed for SCA
  • We introduce a TRIVY_CACHE_DIR where there was none before

Here's an alternate version that takes into consideration that the exit code only reads STDERR and that the post processer needs stderr and stdout to correctly process the data or detect there's no file

@Franck-Boost

Copy link
Copy Markdown
Collaborator Author

Closing but will open another one to address :

  • TRIVY_ADDITIONAL_ARGS
  • TRIVY_CACHE_DIR

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.

2 participants