-
Notifications
You must be signed in to change notification settings - Fork 585
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 digest property to parent and nested java package metadata #941
Conversation
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
a53f28c
to
d957f9f
Compare
Benchmark Test ResultsBenchmark results from the latest changes vs base branch
|
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
913c9ff
to
76fc08b
Compare
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
internal/formats/common/cyclonedxhelpers/external_references.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
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.
Generally, this looks okay, but I'm a little concerned about the java/archive_parser_test.go
that these hashes are different locally vs CI, what is the reason for this?
update metadata digests to be plural and rename remove xerrors package usage update error --> warning change parse --> calculate Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
c90327d
to
2ffc85b
Compare
internal/formats/common/cyclonedxhelpers/external_references.go
Outdated
Show resolved
Hide resolved
Thanks for the feedback everyone! I'll take another stab and incorporate your comments. I committed some of the suggested changes and need to start looking at what's failing. |
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
0efa3d9
to
08ae188
Compare
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
2bd5147
to
40ee003
Compare
@wagoodman and @kzantow this has now been updated to address the last round of comments |
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 had another pass at this, I think I identified one nil pointer
panic, where there's for _, hash := range *ref.Hashes {
, I'm pretty sure ref
could be nil
if not found.
One other thing is the CycloneDX decoder is handling the hashes, it looks like but there isn't anything for SPDX decoding. You're probably not seeing any failing tests because they haven't been added to the encode-decode-encode cycle test. They should be but I suspect that would involve some work outside the scope of this PR. So know we either need a follow-on task to do this (which I would be okay with, personally, to add the spdx formats to encode-decode-encode, which would involve adding the decoding support for the digests) or add decoding support here.
internal/formats/common/cyclonedxhelpers/external_references.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
@@ -34,6 +37,11 @@ var archiveFormatGlobs = []string{ | |||
// project that we can build in CI feel free to include it | |||
} | |||
|
|||
// JavaArchiveHashes are all the current hash algorithms used to calculate archive digests | |||
var JavaArchiveHashes = []crypto.Hash{ |
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.
nit: could unexport this
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.
nice work 🙌
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
@kzantow @wagoodman I added decoding for spdx22 support can you take a look |
* main: (31 commits) reduce noise of log output (#976) add version info and remove double config call (#977) Rename syft-id to package-id (#970) update to cyclonedx-go 0.5.2 (#971) refactor command package to remove globals and add dependency injection fix: #953 Derive language from pURL - https://github.com/anchore/syft… (#957) Fix typo in CPE-parsing error (#966) Preserve syft IDs on SBOM decode (#963) Update GitHub format package_url and correlator (#961) Ensure SPDXIDs are valid (#955) Auto-PR needs to run go mod tidy (#958) Add workflow for automatic PR for new stereoscope updates (#954) Minor readme update to correct format information (#948) Update spdx22json to only take uppercase checksum algorithm (#946) add additional vendors for springframework (#945) Add digest property to parent and nested java package metadata (#941) Update write permissions and log into ghcr.io for release (#942) Retry auth URL lookup without docker credentialhelper workaround (#939) Ensure that all cyclonedx components have bom-refs (#914) Additionally publish docker images to GHCR (#934) ... Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
…re#941) Signed-off-by: rigzba21 <jonathan.velando01@gmail.com>
Summary
Adding digests to the discovered java packages will give downstream SBOM consumers more options for querying artifact registries regarding specific details surrounding SBOM content.
A followup PR in grype will be made after this to allow it to optionally consume this information for matching against an upstream Maven repository for better vulnerability match fidelity
Addtions
Todo
filesAnalyzed
switchSigned-off-by: Christopher Phillips christopher.phillips@anchore.com