-
Notifications
You must be signed in to change notification settings - Fork 2.4k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Scanning of the custom build Distroless images with Nix/Bazel #2299
Comments
@yoks thanks for your interest in |
@yoks it's a strange behavior. maybe there are some language specific problems.
$ trivy --debug image <OMITED>/<OMITED>@sha256:8702e8f30b407ed54558974fc083e6f4a020b4ad01cc6c8652e29ed05741a084
thanks a lot! ps. I've tried to build a demo image via Bazel for Go (eg: Create Container images with Bazel) and trivy can find all language and OS packages... |
@afdesk here is the debug output
I think in example you showed there has distro as a base (e.g. not real distroless image, it has base alpine_linux_amd64). In our case it is real distoless images, there is no OS. Only app and dynamic libs. Language does not matter, trivy has same behavior regardless of language, we build around 50 different images in many different languages, all show same behavior. Sample structure of the image is following:
Thats it, there is nothing more inside container, only this files, no /tmp /etc dirs. No bash or any other utlities. Just dynamic libs and executable (usualy main or node + js files). |
@yoks thanks for your report. |
@yoks sorry for the long wait.
|
related #1673 In the case of a nix built distroless image it is both "distroless" and packages are "installed by package managers" since nix is a package manager & it put them there Within the container there isn't full derivation details (unless to do a container build "with Nix DB") You could enumerate the /nix/store in the container for packages (maybe validate it's the right package) and then fetch extra details e.g. A snapshot of some of the details you can gather if you have all the derivation details (trimmed down by hand to just give an idea)
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
We have our custom build process with nix and bazel. Images we create are distroless and have libs and binaries in specific paths, there is nothing else exists inside the image. Trivy seems to ignore such images and detects no vulnerabilities, i tried to go through documentation to find how specify search paths and maybe change search patterns for lib, but did not found anything,
trivy image --help
does not answer either.Here is the example of the scan command with the latest version of trivy on nix build image.
And here one build by bazel
The text was updated successfully, but these errors were encountered: