-
Notifications
You must be signed in to change notification settings - Fork 77
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
Does Anchore only analyse the first Docker image referenced in a Dockerfile #36
Comments
hi @jonico - I can provide some info that should help clarify! The anchore scan action explicitly will only scan one image per invocation, which is the actual container image passed in using the 'image-reference' parameter. It is also necessary to explicitly reference the Dockerfile that was used to generate this image, if you would like for everything to line up correctly. In other words, anchore isn't actually scanning any given Dockerfile itself, it is scanning a built and present container image, and using the dockerfile-path specified Dockerfile as additional context. Let us know if that helps clarify! |
hi @nurmi: Thanks a lot for your explanation, I now understand what is scanned. I was fooled by the fact, that the reported security alerts explicitly refer to the first line in the Dockerfile: Line one refers to an image that is only used for building, not for shipping (which would be the base image in line 27) I wonder whether it would be less confusing to either mark the entire file as relevant for the finding or refer to a line which is pointing to a base image actually used in the docker image referred to in the 'image-reference' parameter. |
hi @jonico - I agree this is something to look into. The reason we implemented it this way (as essentially a 'marker' to the beginning of the Dockerfile) is that in our initial investigations, the UI rendered oddly when the entire file (all lines) were referenced, which washed out the CVE detail element to the point where it was not viewable. There may be a way to omit line numbers entirely - we'll be able to investigate and of course if you try some options and find something that renders well and is less specific to a line in the Dockerfile, we'd love to hear back! |
@jonico the scan-action has a new release and I don't think that the new features and changes will apply to this issue. Can you try again and let us know if you are seeing similar problems? Thanks again! |
@alfredodeza: I played around with the latest version of your integration but could not get it to work, see my failed attempts here: https://github.com/Beer-Ops/Beer-Ops.github.io/runs/1209441020#step:4:16843 |
@jonico the workflow doesn't look quite right... there is an error that mentions the following:
Looking at the step:
It has to be either a path or an image. The action supports scanning a path (e.g. the current repo) or a container. Can you update to use only one of the options? Additionally, this brings light to a probable source of confusion... would love to make it more clear in the docs. Did you find an example that had both? Or a section in the docs that didn't clarify this situation? Finally... the action should've halted execution when it encountered this condition, vs. just continuing and producing massive output. I'll follow up with a fix for that |
@alfredodeza: also without path it did not work for me: https://github.com/Beer-Ops/Beer-Ops.github.io/runs/1209368959#step:4:16841 |
@jonico I think you can try the action from a branch instead of the After testing it locally, I found the issue went away. Hope it works for you as well! |
@alfredodeza: worked for me now 🎉 , but I still get a lot of verbose debug output although I set debug to |
furthermore, the new output references files that are not part of my repo and cannot be previewed: ... to me, the old format looked nicer as it referenced the line where my project was introducing the problematic docker image, especially as I cannot change the source of the problem other than upgrading to a newer docker image: |
@jonico that's great. I'll follow up with a new issue to track the verbosity (this is As for the content of the files, the problem is that the Are you OK with me closing this issue now? Again, we aren't doing anything with the Dockerfile at all in this new version. |
closing issue as the new version of Anchore do not refer to Dockerfile any more |
While scanning Dockerfiles that reference multiple Docker images, Anchore only reported findings for the first referenced Docker image used to build:
https://github.com/corona-warn-app/cwa-server/blob/7059232b48d2507d142fe683fbebdda371a98652/services/distribution/Dockerfile#L1
whereas no single finding was reported for the base of the resulting Docker image:
https://github.com/corona-warn-app/cwa-server/blob/7059232b48d2507d142fe683fbebdda371a98652/services/distribution/Dockerfile#L27
Details of the workflow run can be found in https://github.com/jonico/cwa-server/runs/763539187?check_suite_focus=true
My question is whether
a) Anchore only scans the first Docker image it finds in a Dockerfile or
b) whether the second referenced base image (gcr.io/distroless/java:11) was just flawless or
c) gcr.io/distroless/java:11 only contained a subset of the findings of the image used to build (maven:3.6.3-jdk-11) and was hence not referenced
The text was updated successfully, but these errors were encountered: