Open lossurdo opened 2 years ago
This sounds like a very good enhancement @lossurdo.
It seems to me there is a possibility that a test dependency gets hijacked and results in executing malicious code of some sort during test runs, so this information would probably be good to include by default.
But adding a flag to the Java cataloger to only include "packaged" dependencies or something of the sort might be fairly straightforward. Would this accomplish what you are looking for?
I think what we might like to do here is:
1) if scanning a jar
that has an embedded pom.xml
, we would assume this is a runtime dependency and exclude test
, provided
and maybe more
2) if scanning source, we probably want to include test
dependencies because these will be executed while running tests, perhaps we add a flag to omit these
cc: @wagoodman
Hi @kzantow!
Maybe something like this on Grype ignoring YAML:
ignore:
- pom:
scope: test
ignore:
- pom:
scope: provided
No matter if pom.xml
is found on source code or inside a WAR/EAR file.
What would you like to be added:
Some way to ignore Java test dependencies like this vulnerable-legacy log4j:
Why is this needed:
Test libs are not packaged in final JAR/WAR file. Scope "provided" is not package too.
Additional context:
Grype reporting log4j test libs: