Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to filter out vulnerabilities of dev dependencies #1643

Open
fingeromer opened this issue Dec 24, 2023 · 3 comments
Open

Option to filter out vulnerabilities of dev dependencies #1643

fingeromer opened this issue Dec 24, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@fingeromer
Copy link

What would you like to be added:
I would like to add an option to exclude dev dependencies of being scanned.

Why is this needed:
For ecosystems like NodeJs, there are dev packages that are not relevant for running applications in production.

@fingeromer fingeromer added the enhancement New feature or request label Dec 24, 2023
@tgerla
Copy link
Contributor

tgerla commented Jan 11, 2024

Hi @fingeromer, thanks for the suggestion. We have an issue to track dependency relationships in more ecosystems, including Javascript: anchore/syft#572 -- once implemented, we could use those relationships to filter out the dev dependencies.

Are you scanning a built production image, or are you scanning a directory on disk? If you're scanning a finished image, we shouldn't be picking up the dev dependencies at all.

(Dev note: this issue seems to be asking for something similar: anchore/syft#2348)

@omerfinger
Copy link

Thank you!
I'm using it for scanning code, not image.

@spiffcs
Copy link
Contributor

spiffcs commented Jan 18, 2024

Here is a good outline of the different ecosystems and how we could organize the relationships for each one:
anchore/syft#572 (comment)

For anyone who comes across this issue and wants to pick up note that this would be a syft change first which would allow grype to key off of the relationships which would cause a package to be excluded.

@fingeromer are there cases where certain dev dependencies should be considered for analysis (vulnerabilities during build/bundling) or is the very simple YES/NO dev dependencies the only filter needed for the source scanning?

I think the feature would be OFF by default given that there are instances where dev dependencies have SOME affect on the final production artifact. A user should probably not feel 100% secure if this option is enabled and some dependency that could cause an unwanted change in the final production artifact is otherwise ignored.

There are two PRs we would expect for this issue to close:

  1. is associated with 572 that surfaces dev dependencies
  2. is the follow up in grype that has the option to filter and prune those packages based on the new dev dependency relationship

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

4 participants