-
Notifications
You must be signed in to change notification settings - Fork 593
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 relationships to ELF packages #2715
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I've updated the unit tests and SA on this PR - there are maybe 2 more cases to cover, but we're very close. The one issue in particular I'm keen on testing is if the relationships are still created IF an RPM package shadows/overrides an ELF binary package. We need a way to pass the import paths discovered up to the RPM package so that these don't get dropped |
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Brian Ebarb <[email protected]>
Signed-off-by: Brian Ebarb <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
…uive base path Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
From my perspective there is one final TODO on this PR: A case needs to be covered where syft does some clean up during Example: if ELF Package (a) is a part of RPM Package (b), then ELF Package (a) is deleted as a duplicate from the SBOM... this means that RPM Package (b) should all get all of ELF Package (A)s relationships. I'm working on this now as the final addition. If @wagoodman could look at the whole PR and give his final thoughts on if we're missing anything else that would be very much appreciated |
Signed-off-by: Christopher Phillips <[email protected]>
ec71fb9
to
6bf7ca2
Compare
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
cmd/syft/internal/test/integration/package_binary_elf_relationships_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
This PR adds
DependencyOf
relationships when ELF packages have been discovered by the binary cataloger. The discoveredfile.Executable
type has a[]ImportedLibraries
that's read from the file when discovered by syft. By mapping these imported libraries back to the package collection, syft is able to create relationships showing which packages are dependencies of other packages by just reading metadata from the ELF executable.Testing
The integration test found under
cmd/syft/internal/test/integration/package_binary_elf_relationships_test.go
covers a sample image where the following graph is true:The above data structure can be read as
glibc IS A DEPENDENCY OF syfttestfixture
For more information about the fixture see this document:
https://github.com/anchore/syft/blob/4fe0c98d0fe85417be596836d8798b7b10d43b1f/syft/pkg/cataloger/binary/test-fixtures/elf-test-fixtures/README.md