trivy icon indicating copy to clipboard operation
trivy copied to clipboard

refactor: include/exclude dev deps in analyzers

Open DmitriyLewen opened this issue 1 year ago • 10 comments

Description

Move dev(test) dependencies inclusion/exclusion in analyzers. See #7476 for more details.

Related issues

  • Close #7476

Checklist

  • [x] I've read the guidelines for contributing to this repository.
  • [x] I've followed the conventions in the PR title.
  • [x] I've added tests that prove my fix is effective or that my feature works.
  • [ ] I've updated the documentation with the relevant information (if needed).
  • [ ] I've added usage information (if the PR introduces new options)
  • [ ] I've included a "before" and "after" example to the description (if the PR is a user interface change).

DmitriyLewen avatar Sep 11 '24 05:09 DmitriyLewen

@DmitriyLewen https://github.com/aquasecurity/trivy/commit/2d97700d10665142d2f66d7910202bec82116209 caused a major regression for us, in that it appears --include-dev-deps was never wired through, and maven test dependencies are therefore included by default. Will it be fixed in this PR? IMO it's worthy of a hotfix as we had to downgrade to stop all of our builds producing hundreds of test CVEs

coheigea avatar Sep 11 '24 08:09 coheigea

Hello @coheigea yeah, this PR contains fix for that (https://github.com/aquasecurity/trivy/pull/7484/commits/dba9f9f7f03afe6dd3cb111e3a14bcb050233303)

Can you test these changes in your project?

DmitriyLewen avatar Sep 11 '24 09:09 DmitriyLewen

Thanks @DmitriyLewen , with the PR it doesn't scan test dependencies by default any more.

coheigea avatar Sep 11 '24 09:09 coheigea

This PR is stale because it has been labeled with inactivity.

github-actions[bot] avatar Nov 13 '24 00:11 github-actions[bot]

This PR is stale because it has been labeled with inactivity.

github-actions[bot] avatar Jan 13 '25 00:01 github-actions[bot]

This PR is stale because it has been labeled with inactivity.

github-actions[bot] avatar Mar 15 '25 00:03 github-actions[bot]

We need to take the flag into account for cache key calculation.

I didn't change the key for the cache - because all analyzers don't work for the image mod. But since we are now talking about the ability to enable/disable analyzers (#3987) - this will be useful, thanks. updated in https://github.com/aquasecurity/trivy/pull/7484/commits/18c4b678b9ccbf98307c1575098cea0a9077d0da

Also, some more analyzers support development dependencies now.

Updated missing analyzers.

DmitriyLewen avatar Mar 19 '25 09:03 DmitriyLewen

This PR is stale because it has been labeled with inactivity.

github-actions[bot] avatar May 27 '25 00:05 github-actions[bot]

This PR is stale because it has been labeled with inactivity.

github-actions[bot] avatar Jul 27 '25 00:07 github-actions[bot]

This PR is stale because it has been labeled with inactivity.

github-actions[bot] avatar Oct 18 '25 00:10 github-actions[bot]

This PR is stale because it has been labeled with inactivity.

github-actions[bot] avatar Dec 20 '25 00:12 github-actions[bot]