Misconfiguration: False positive when using ADD with a URL in Dockerfiles #7791
Closed
nicwortel
started this conversation in
False Detection
Replies: 2 comments 5 replies
-
As a side note, there might be more cases where using |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @nicwortel ! I think you're right. We should improve this check so that it doesn't trigger for ADD specific sources:
/cc @simar7 |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
IDs
AVD-DS-0005
Description
The
ADD instead of COPY
check reports Dockerfiles which useADD
whereCOPY
could have been used.However, it also reports
ADD
commands which download a URL, which is not supported by theCOPY
command.I believe this is a false positive, and the check should not report
ADD
commands which download a URL.The check already rules out uses of the
ADD
command where the arguments contain.tar
. I believe this should be extended with checking whether the arguments containhttp://
,https://
orgit@
, and in that case not report the failure:If someone can verify that this is the correct approach, I'd be happy to submit a pull request.
Reproduction Steps
Dockerfile
with anADD
command which downloads a file from a URL:trivy config Dockerfile
ADD
command)Target
Filesystem
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