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

Re-enable scanning for SBOM records in Docker image #111

Closed
nycnewman opened this issue Dec 4, 2024 · 4 comments
Closed

Re-enable scanning for SBOM records in Docker image #111

nycnewman opened this issue Dec 4, 2024 · 4 comments
Assignees
Labels
kind/bug Something isn't working

Comments

@nycnewman
Copy link

In a slightly dated Docker Blog post, it was highlighted that you could add SBOM details for any binaries added manually to a Docker image:

https://www.docker.com/blog/generate-sboms-with-buildkit/

This was broken some time back apparently and the blog also references a snippet that does not work (need to be a full SBOM package record).

Syft maintainers suggested a minor fix to re-enable this feature:

result, err := syft.CreateSBOM(context.Background(), src, syft.DefaultCreateSBOMConfig().WithCatalogerSelection(pkgcataloging.NewSelectionRequest().WithDefaults(pkgcataloging.ImageTag)))

syft.CreateSBOM(context.Background(), nil, syft.DefaultCreateSBOMConfig().
WithCatalogerSelection(pkgcataloging.NewSelectionRequest().
WithDefaults(pkgcataloging.ImageTag).

  •   	WithAdditions("sbom-cataloger"),
    
    ),
    )

Full discussion with Syft is here:

anchore/syft#3490 (comment)

@jedevc
Copy link
Collaborator

jedevc commented Dec 4, 2024

Hm, we should also have had tests for this case.

@nycnewman
Copy link
Author

Tried to create a PR but hit a ton of issues (as I'm not a GoLang expert) with Syft and case of "microsoft" vs "Microsoft" in Syft dependencies. Since this project pulls in both github.com/Microsoft and github.com/microsoft, it picks capitalized version and fails on syft dependencies.

@nycnewman
Copy link
Author

Similar issue to anchore/syft#2026

@cdupuis
Copy link
Collaborator

cdupuis commented Dec 10, 2024

This is now fixed in master via #115.

@cdupuis cdupuis closed this as completed Dec 10, 2024
crazy-max pushed a commit to crazy-max/buildkit-syft-scanner that referenced this issue Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants