Skip to content
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 support for CBL-Mariner distroless images #1045

Merged
merged 3 commits into from
Jun 21, 2022

Conversation

tofay
Copy link
Contributor

@tofay tofay commented Jun 14, 2022

Fixes #1044

Mariner distroless images don't contain an RPM database, but contain a file containing the
output of an rpm --query --all ... command: https://github.com/microsoft/CBL-Mariner/blob/main/toolkit/docs/how_it_works/5_misc.md#rpm-manifest-file

This PR adds support to syft for detecting that file and extracting package information from it. This is not as much information as syft extracts from a normal RPM database (a couple of examples being file information and signing algorithm) but it is enough information for subsequent CVE analysis.

@tofay tofay force-pushed the mariner-distroless-support branch from c6d8402 to 0f42494 Compare June 14, 2022 11:37
These don't contain an RPM database, but contain a file containing the
output of an `rpm --query --all ...` command.

Signed-off-by: Tom Fay <tomfay@microsoft.com>
@tofay tofay force-pushed the mariner-distroless-support branch from 0f42494 to be67d83 Compare June 14, 2022 11:52
Copy link
Contributor

@wagoodman wagoodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL about RPM manifests; thanks for the contribution! (I added a comment for a small update, but that looks to be the only blocker from me)

@wagoodman wagoodman self-assigned this Jun 15, 2022
rather than not parse anything

Signed-off-by: Tom Fay <tomfay@microsoft.com>
Signed-off-by: Tom Fay <tomfay@microsoft.com>
@tofay
Copy link
Contributor Author

tofay commented Jun 15, 2022

Thanks for the quick review! I've made the suggested change and one more thing I saw in passing (making parsing resilient to fields being added in future).

@tofay tofay requested a review from wagoodman June 15, 2022 18:15
@spiffcs spiffcs merged commit 3f6afd5 into anchore:main Jun 21, 2022
spiffcs added a commit to jonasagx/syft that referenced this pull request Jun 27, 2022
* main: (70 commits)
  fix: add php catalogers to all catalogers (anchore#1065)
  feat: add use-all-catalogers flag (anchore#1050)
  Updates parsing of `yarn.lock` to use `resolved` URLs that are pulled from yarn and npm registries (anchore#926)
  remove OSS Meetup message (anchore#1057)
  add pom.xml cataloger (anchore#1055)
  Add support for CBL-Mariner distroless images (anchore#1045)
  Add catalogers configuration (anchore#1038)
  add template output (anchore#1051)
  update stereoscope to latest version (anchore#1052)
  update zip_read_closer to incorporate zip64 support (anchore#1041)
  Add pacman (alpm) parser support (anchore#943)
  Update of README.md (anchore#1027)
  bump cosign to v1.9.0 to resolve reporting of GHSA-66x3-6cw3-v5gj (anchore#1025)
  add workflows to test new project automation (anchore#1023)
  improve LanguageByName and add unit tests (anchore#1034)
  Read Description from dpkg status files (anchore#996)
  Add announcement for Anchore OSS Virtual Meetup (anchore#1033)
  add main module field to go bin metadata (anchore#1026)
  Add filters to package cataloger (anchore#1021)
  change draft to false for release process (anchore#1016)
  ...

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
aiwantaozi pushed a commit to aiwantaozi/syft that referenced this pull request Oct 20, 2022
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add support for Mariner distroless images
3 participants