-
Notifications
You must be signed in to change notification settings - Fork 597
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
fix: exclude known instrumentation jars from being erroneously identified #2796
Merged
+39
−2
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ger/java/test-fixtures/jar-metadata/spring-instrumentation-4.3.0-1.0/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Manifest-Version: 1.0 | ||
Implementation-Title: com.newrelic.instrumentation.spring-4.3.0 | ||
Implementation-Version: 1.0 | ||
Illegal-Classes: | ||
Weave-Violation-Filter: METHOD_MISSING_REQUIRED_ANNOTATIONS,CLASS_MISS | ||
ING_REQUIRED_ANNOTATIONS | ||
Reference-Classes: org/springframework/core/annotation/AnnotationUtils | ||
,org/springframework/web/bind/annotation/DeleteMapping,org/springfram | ||
ework/web/bind/annotation/PatchMapping,org/springframework/web/bind/a | ||
nnotation/PostMapping,org/springframework/web/bind/annotation/PutMapp | ||
ing,org/springframework/web/bind/annotation/RequestMapping,org/spring | ||
framework/web/method/HandlerMethod,org/springframework/web/servlet/Mo | ||
delAndView | ||
Class-Required-Annotations: | ||
Method-Required-Annotations: | ||
Implementation-Title-Alias: spring_annotations | ||
Weave-Classes: org/springframework/web/bind/annotation/GetMapping,org/ | ||
springframework/web/servlet/mvc/method/AbstractHandlerMethodAdapter | ||
Weave-Methods: "handleInternal(Ljavax/servlet/http/HttpServletRequest; | ||
Ljavax/servlet/http/HttpServletResponse;Lorg/springframework/web/meth | ||
od/HandlerMethod;)Lorg/springframework/web/servlet/ModelAndView;" | ||
Implementation-Vendor: New Relic |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to skip matching on this jar entirely, or is there a similar heuristic where we could correctly find the NewRelic jar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are finding the newrelic jar, these are subcomponents of it. E.g. this PR reports:
I don't think it's especially valuable to try to identify these separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see.
I misunderstood the comment at https://github.com/anchore/syft/pull/2796/files#diff-0965089b69371402427667e60ad9d7ad5698ae0b330b5c7430e2b0c671655fe5R1356
// we expect no packages to be discovered from this
- I thought that meant we wouldn't find the New Relic jar at all.What is meant by that comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is for a manifest with the
Weave-Classes
attribute being excluded. I updated the comment to hopefully be more clear.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should note I can't seem to find any vulnerabilities reported against the Java agent or related components anywhere, though. But it seems that the vulnerabilities reported are not against individual components but rather the platform: https://nvd.nist.gov/products/cpe/search/results?namingFormat=2.3&keyword=newrelic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there are currently no known public vulnerabilities filed against the Newrelic java agent components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and there are currently no separate maven components published for the instrumentation jars, so when there are vulns in future they would likely be placed against one or multiple of the published maven jars which we are still capturing (though probably the groupie and artifact I'd may be incorrect, but that is a separate issue)