-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
RFE: Implement "scan" command to surface known package vulnerabilities #8305
Comments
Thanks for opening the issue! We recently added a new image mount type which was motivated by your use case (i.e., image scanning). Doing a So you can use the mechanism to use pretty much any scanner on any image. I have not had a look at In other words. If you have scanner and want to run it, you can put it into an image, and use it to scan other images. |
@rhatdan PTAL |
I'm not opposed to providing a native command, but ideally I'd want to design it such that multiple scanner backends were supported - a plugin system would be ideal (or, barring that, just ensuring everything is behind an interface so we can easily add new implementations). My primary concern around including a scanner directly in Podman boil down to binary size - if this ends up pushing our binary size up by 10mb, that's not really a good thing (and makes me lean more towards doing this as a plugin, though the complexity in developing a plugin interface will be significant). |
I wouldn't like a security scanner to be part of the code base. As mentioned earlier, we have the Users can easily user their security scanner of choice, Podman wouldn't ship a security scanner but only run it an image (no binary bloat, maintenance burden, ...). The image could be configurable on the CLI and via containers.conf. |
@vrothberg I like this approach --this seems like a good way to keep the grype dependencies/build process untangled from podman 👍 . |
Wonderful! Would you be interested in contributing the feature, @wagoodman ? |
I am! I think I'll be getting a bit more time in a week or so, I'll update here with a branch or draft PR closer to then. |
Great, thanks! Feel free to join #podman on IRC (Freenode) if you want to reach out. |
Hey @vrothberg , found some time today to take a stab at prototyping. I started with adding a new The draft PR is here: #8706 Things left todo:
Questions:
Let me know if this approach is OK or if I should be making some direction changes. Thanks! |
Thanks a lot, @wagoodman! Much appreciated 👍 I am going to have a look now but will comment over in #8706. |
A friendly reminder that this issue had no activity for 30 days. |
This is still being worked on. |
A friendly reminder that this issue had no activity for 30 days. |
This is still being worked on. |
A friendly reminder that this issue had no activity for 30 days. |
@wagoodman Any update? |
A friendly reminder that this issue had no activity for 30 days. |
@wagoodman Any progress? |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
I really do not see what value we are adding with podman scan other then mounting the image and potentially launching a third party app? Why wouldn't you just script this? |
It makes the life of users easier (same as The |
We did used to have the atomic scan tool, which would launch a containerized scanner with an image mounted into the container available for scanning. |
A friendly reminder that this issue had no activity for 30 days. |
@ashley-cui, a potential intern project. |
I think we would need to do a big design discussion on this one, to figure out what this even is required. |
@rhatdan are you still interested in the scan command? |
This would probably come under the banner of plugins. Making it easy for others to build a scanner plugin would be an issue. |
Will continue the conversation in the plugin issue #13461 |
Is this a BUG REPORT or FEATURE REQUEST?
/kind feature
Description
It would be ideal to have a
scan
command that surfaces known vulnerabilities for packages within container images, mimicking the newdocker scan
command.I work on a CLI tool, Grype, that is written in go that can fulfill this functionality. Today grype does not depend on shelling out to get information for packages and vulnerabilities --all functionality is contained within the grype binary, with all dependencies 100% in go (no CGO required). Between this and the fact that grype was meant from the beginning to be used as both a CLI tool and a library makes it an ideal candidate for incorporating vulnerability detection functionality for a
scan
command.There seem to be two ways to approach integrating grype and podman to provide the
podman scan
functionality:Pull in grype as an in-source-tree go dependency, embedding grype into the podman binary. I have a branch prototyping out the necessary changes.
Manage the grype binary separately. In this approach podman would download and manage the grype binary in an internal podman directory and invoke grype by shelling out to the binary and obtaining the results from
json
output.In both approaches:
ImageEngine.Save
functionality would be used within thescan
command to obtain an image archive and feed into grype.I would be happy to collaborate with folks here on the desired approach and make contributions to grype and podman as-needed!
The text was updated successfully, but these errors were encountered: