-
Notifications
You must be signed in to change notification settings - Fork 186
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
Enable inventory of Distroless images #864
Comments
From looking at the referenced comment, I think a sample script would be something like: files=$(ls var/lib/dpkg/status.d)
for f in $files; do grep -oP "^Package: \K.*$" var/lib/dpkg/status.d/$f; done Running this in an unpacked layer of
and the version equivalent for f in $files; do grep -oP "^Version: \K.*$" var/lib/dpkg/status.d/$f; done yields
etc. for the other commands. |
@nishakm I've been looking into implementing this. You mentioned about using the tern/tern/analyze/default/command_lib/base.yml Lines 12 to 17 in 11fc8a3
However, the implementation only appears to be there for Lines 78 to 87 in 11fc8a3
|
@JamieMagee What I meant was that The place to implement this is in https://github.com/tern-tools/tern/blob/main/tern/analyze/default/collect.py#L22 Here we also need to add a new function |
@nishakm I think we're on the same page. It wasn't clear to me whether As for the issue of Windows and Mac hosts, I would defer that question for now and assume that we have a Linux host. Let's get something working first, then worry about crossplatform support afterwards. |
It's hacked together right now, but I've proven the concept:
|
@rnjudge I think we may remove the distroless issue from GSoC? What do you think we can substitute it with? |
@JamieMagee Feel free to submit a PR with what you have. I can either review it with changes or work on top of it. Whatever works for you. |
|
Describe the Feature
Distroless provides runtime container images. It doesn't have a shell and therefore not as straightforward to enable inventorying via a binary. However, there is a manifest within the rootfs that can read, so inventorying can still be done.
Use Cases
See ossf/wg-supply-chain-integrity#20
We also have difficulty running file level static analysis to get an SBoM for this kind of rootfs, so a deterministic method would be very useful.
Implementation Changes
See comment: ossf/wg-supply-chain-integrity#20 (comment)
The "host" method invokes a host command or script on the working directory without the
unshare -pf
which you would get from theinvoke_in_chroot
.The text was updated successfully, but these errors were encountered: