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

Support images minified with DockerSlim #355

Closed
endrec opened this issue Jan 3, 2020 · 2 comments · Fixed by #476
Closed

Support images minified with DockerSlim #355

endrec opened this issue Jan 3, 2020 · 2 comments · Fixed by #476
Labels
kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation.

Comments

@endrec
Copy link

endrec commented Jan 3, 2020

DockerSlim minifies docker images by removing unused packages and files.
It would be nice to support images created using DockerSlim, similarly to distroless images.

Currently trivy fails with an Unknown OS error (tested with 0.3.1).

@endrec endrec added the kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. label Jan 3, 2020
@rcomanne
Copy link

Is there any status update on this issue?
I would love for this to work.

@knqyf263
Copy link
Collaborator

I've implemented that Trivy handled images minified with DockerSlim gracefully. Note that it means Trivy can detect vulnerabilities of libraries used by a programming language, but can't detect vulnerabilities of OS packages in the image. Trivy uses a status file like /lib/apk/db/installed and /var/lib/dpkg/status. If they don't exist in the image, Trivy can't know the versions of installed packages. If you want to scan OS packages, you need to include those files. They are small, so I think it doesn't increase the image size.

This is a case of debian.

$ docker-slim build --include-path "/etc/debian_version" --include-path "/var/lib/dpkg/status" nginx

alpine:

$ docker-slim build --include-path "/etc/alpine-release" --include-path "/lib/apk/db/installed" nginx:alpine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants