misconfig: HIGH: There are X duplicate CMD instructions falsely #7320
Closed
candrews
started this conversation in
False Detection
Replies: 1 comment 2 replies
-
I believe this is due to the fact that Trivy scans the final merged layer for any problems. In this case the dockerfile doesn't contain the issues you are looking at but most likely the base image (and it's layers) do. Correct me if I'm wrong @knqyf263. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
IDs
ds016
Description
Trivy misconfiguration scan incorrectly reports duplicate CMD instructions for some docker images.
Trivy seems to be looking for
CMD
instructions in all of the layers of the docker image. Instead, it should only be looking at the final image.Here's an example:
The
Dockerfile
for this image can be seen at https://catalog.redhat.com/software/containers/ubi8/python-312/657c12cade3664622a12ed50?container-tabs=dockerfile - it contains exactly 1CMD
so it does not violate the https://avd.aquasec.com/misconfig/ds016 rule.Reproduction Steps
Target
Container Image
Scanner
Misconfiguration
Target OS
No response
Debug Output
Version
Checklist
-f json
that shows data sources and confirmed that the security advisory in data sources was correctBeta Was this translation helpful? Give feedback.
All reactions