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

SBOM scan #11

Open
origooo opened this issue Aug 8, 2023 · 3 comments
Open

SBOM scan #11

origooo opened this issue Aug 8, 2023 · 3 comments

Comments

@origooo
Copy link

origooo commented Aug 8, 2023

Hi,

I'm fairly new to the concept of distroless images and I cannot seem to understand the following: How would one go about to do an SBOM scan with e.g. anchore/syft?

@astefanutti
Copy link
Owner

That's a good question. We would have to check how these tools analyse the container images, but in case of scratch-node used as a base image, the SBOM would be that of the packaged Node app, and I imagine it'd be technically possible to generate the SBOM from it.

@origooo
Copy link
Author

origooo commented Aug 8, 2023

Thanks for the quick reply. I found out a few things and I'll try to summarise them here. Ask me to clarify if needed, because this issue kinda changed direction.

First off, I started testing both anchore/syft and anchore/grype today.

In short, syft can be used to generate an SBOM file which can be fed into grype. This step is not really necessary since grype also uses syft to create an SBOM file prior to performing a vulnerability scan. Unless my image's/application's dependency tree change, that step can be sped up by feeding an SBOM file instead of having grype recreate it.

So the SBOM file will indeed include the packages I've installed. Both syft and grype catches the same packages so all seem to be fine.

A more accurate question with this in mind, would be if, and how, we can get syft and grype to pick up the binaries contained within the scratch image?

Correct me if I'm wrong, but these binaries are

bin/node
dev/console
etc/hostname
etc/hosts

@astefanutti
Copy link
Owner

Yes, the main binary is bin/node which is a static build of Node.js. I'd be curious to know how these tools handle base Node.js images. Maybe it could be applicable to scratch-node as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants