-
Notifications
You must be signed in to change notification settings - Fork 615
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
Include go binary h1 digests in SPDX #1261
Comments
Thanks @kzantow . I understand the hesitation. I figure there has to be somewhere for that to go. Would it fit within the purl? |
We try to only include information in the PURL that is explicitly defined in the spec (although we do deviate from this out of necessity: to add required information for Grype to function properly). Looking at the PURL spec again, the qualifiers section is probably what you're referring to, and we'd like to stick to known qualifiers. The good news is it looks like there is a The other hesitation about using this information in the PURL is, the spec also says this about qualifiers:
Sorry, I was confusing this a bit with another issue at first... SPDX does have a package checksum. However, this has the same issue as the PURL -- the format is lowercase hex encoded, and also a specific set of algorithms that can be used... if the |
Aha! According to https://go.dev/ref/mod#go-sum-files
So, this looks like a pretty simple translation: Would it be a problem for you if you don't see |
According to the go modules reference, h1 indicates sha256, and the hash itself is base64-encoded. So essentially Which would be the right format? 🤷♂️ Maybe package checksum would be better? |
Haha, crossed wires! We found it at the same time. 😁 I don't see it as an issue. The very reason you include an algorithm is so that you are explicit about how to use the content. |
Yeah, this looks like a pretty simple change. I'll add it to the backlog and we should be able to knock this one out pretty quickly. 👍 |
Cool, thank you! |
What would you like to be added:
Syft captures some metadata when cataloging go binaries, including the h1 digests. This information is currently output in Syft and CycloneDX (as a property) but not SPDX. There is a request to include the h1 digest information in SPDX format.
Based on the go mod docs, it appears we can put this information in the package checksum field after translation:
h1
->SHA256
andhex.Encode(base64.Decode(value))
.Why is this needed:
To align data between the formats and provide digest information for SPDX users.
Additional context:
This was originally reported by @deitch and has a little more context here: #546 (comment)
The text was updated successfully, but these errors were encountered: