Skip to content

feat: Add config option to enable vex-support for trivy#34

Merged
reasonerjt merged 2 commits intogoharbor:mainfrom
hteichmann-strato:feat/add-vex-support
Dec 22, 2025
Merged

feat: Add config option to enable vex-support for trivy#34
reasonerjt merged 2 commits intogoharbor:mainfrom
hteichmann-strato:feat/add-vex-support

Conversation

@hteichmann-strato
Copy link

This PR introduces support for Trivy's VEX (Vulnerability Exploitability eXchange) functionality, allowing users to suppress vulnerabilities by setting the new SCANNER_TRIVY_VEX_SOURCE environment variable. This value, which can be "oci" or "repo", is passed directly to Trivy's --vex flag. To ensure a complete implementation, the Helm chart has been updated to expose this setting.

@hteichmann-strato
Copy link
Author

Hi @Vad1mo, would it be possible to check the PR? I'm happy to answer any questions.

@reasonerjt
Copy link

@hteichmann-strato please sign-off the commit.

@hteichmann-strato
Copy link
Author

hteichmann-strato commented Oct 28, 2025

@reasonerjt yeah, done, pls check it. Sorry for the delay
Update: had use the wrong mail address, fixed.

Signed-off-by: Henrik Teichmann <teichmann@strato-rz.de>
@hteichmann-strato
Copy link
Author

@Vad1mo I accidentally f'ed up the commit sign-off, but that is fixed now and DCO-Bot is happy. Pls let me know if something else is missing. Thanks!

"SCANNER_TRIVY_OFFLINE_SCAN": "true",
"SCANNER_TRIVY_GITHUB_TOKEN": "<GITHUB_TOKEN>",
"SCANNER_TRIVY_TIMEOUT": "15m30s",
"SCANNER_TRIVY_VEX_SOURCE": "oci",

Choose a reason for hiding this comment

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

nit: I checked the doc https://trivy.dev/docs/latest/supply-chain/vex/oci/#discover-vex-attestation-in-oci-registry

It seems the user should never set "--vex oci", instead, it should be "--vex oci $image".
Could you update the testcase to avoid confusion?

Copy link
Author

Choose a reason for hiding this comment

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

The named argument --vex oci and the seperate positional argument $image are independent and don't need to be adjacent :) so it should be all good.

@reasonerjt
Copy link

@hteichmann-strato

  1. Could you please check the failure in test?
  2. I find there's also a parameter "--skip-vex-repo-update". Does it make sense to also expose this setting along with "--vex"?
  3. I also left an inline comment.

…s.yaml, fix tests

Signed-off-by: Henrik Teichmann <teichmann@strato-rz.de>
@hteichmann-strato
Copy link
Author

@reasonerjt done, skip-vex-repo-update is now exposed as well, I don't error on the combination of VEXSource=oci and SkipVEXRepoUpdate=true because trivy also silently ignores this. Happy for any Feedback!

@reasonerjt reasonerjt merged commit 7af8c0a into goharbor:main Dec 22, 2025
2 checks passed
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.

3 participants