-
Notifications
You must be signed in to change notification settings - Fork 416
Add go binary scanning #1011
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
Add go binary scanning #1011
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1011 +/- ##
==========================================
+ Coverage 65.14% 65.25% +0.11%
==========================================
Files 149 150 +1
Lines 12338 12401 +63
==========================================
+ Hits 8037 8092 +55
- Misses 3849 3855 +6
- Partials 452 454 +2 ☔ View full report in Codecov by Sentry. |
} | ||
|
||
// Any other path can be a go binary | ||
return true |
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.
Does this incur much performance penalty when scanning a container filesystem?
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.
This sort of depends on whether the DepFile passed into this extractor has the ReaderAt interface. If it does, then the performance cost is relatively minimal, as it checks the headers to see if it's a relevant file (e.g. has ELF header, various magic bytes, has go debug info...etc) and returns early if it isn't.
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.
Ack, I think it's reasonable to expect ReaderAt in most cases.
Add go binary scanning extractor, and use it in image scanning.
This shows quite a few false positives that can be resolved with call analysis, which will be implemented in a followup PR.