-
Notifications
You must be signed in to change notification settings - Fork 594
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 h1 digest to SPDX #1265
Conversation
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
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.
Just a small comment about FilesAnalyzed
Signed-off-by: Keith Zantow <[email protected]>
Thanks @spiffcs . How do I find that output? I cloned the repo, ran |
@deitch -- you can find the hashes in the "checksums": [
{
"algorithm": "SHA256",
"checksumValue": "33d5c1b2232c970da56f66738250b44ce9013cae4d422d3f9e852b767a05c148"
} These have been converted from the |
Huh, you are right, it is there. I guess I didn't find it on the larger one I ran. I had better figure out why. Likely my error, but if not, I will open an issue. |
It looks like it is finding some but not all. Is that possible? And I cloned latest (checked that it has this commit) ran Am I doing something wrong? |
Ah -- this was implemented only for go binaries at the moment! Are you running against the source directory with |
It didn't even occur to me that this was for compiles binaries. How funny! So I should run it against an actual binary? Also, curiously, what happens if I run it against an OCI image? Does it find the go binaries in there and scan them too? Or do I need to be explicit? |
@deitch Syft does find go binaries when you do container scans, you shouldn't need to do anything special to enable this 👍 -- it should be noted, only binaries compiled using go mod will have this information, though. If you |
Actually, I see 2 What I don't see is all of the dependencies. Take a look at the gist.
|
@deitch this is a little nuanced -- the information included in the go binary is for everything included in the binary. What that means is: depending on the actual code paths the binary includes, it may or may not include all the dependencies in the As for scanning the source, this is a different question! I don't see any digests included in the source scan (did you scan the directory with the binary still present?). This is something we should probably add, but it explains the discrepancy between only seeing 2 dependencies with the binary and 3 in the |
Huh, maybe I did. I just reran it and am getting no checksums. Go figure. PEBKAC.
meaning that the actual binary only uses 2 even if go.mod has 3 and go.sum has 7?
That is somewhat surprising. Wouldn't you expect the |
btw, I just ran it on a complex binary, the results showed |
Exactly. Go mod uses a minimal version selection algorithm to determine dependencies that should be included. There is more information in the
This is still dependent on various things -- the version of go used to compile, build time flags. Basically, if the h1 digests are included in the go binary build info section, Syft should be picking those up now. You can see if that information is included by running:
|
How interesting. I ran it for my other binary, it shows go 1.18.6 and all of the |
This PR adds support for go binary h1 digest support being output to the SPDX checksum field.
Fixes #1261