Skip to content
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

Query "Curl or Wget Instead of Add" wrongly detects some filenames as urls #5699

Closed
malte-laukoetter opened this issue Aug 15, 2022 · 1 comment · Fixed by #5706
Closed
Labels
bug Something isn't working community Community contribution

Comments

@malte-laukoetter
Copy link

Expected Behavior

File names like "httpd-foreground" or "./drop-http-proxy-header.conf" are not detected as URLs.

Actual Behavior

The following ADD statements are wrongly detected as smelly by this query:

ADD ./drop-http-proxy-header.conf /etc/apache2/conf-available
ADD httpd-foreground /usr/local/bin/

The query seems only to check if the sequence "http" or "https" can be found anywhere in the ADD statement not if it is actually an URL. It might be better to check if it also includes :// directly afterward. (see https://github.com/Checkmarx/kics/blob/master/assets/queries/dockerfile/curl_or_wget_instead_of_add/query.rego#L18)

Specifications

  • Version: snapshot-34973e9d
  • Platform: Docker
  • Subsystem: Dockerfiles
  • Query: 4b410d24-1cbe-4430-a632-62c9a931cf1c
@cxMiguelSilva
Copy link
Collaborator

Hi @Lergin, I hope you are doing Great!!
I am happy to tell you that there is already a PR to improve the RegEx rule in this Security Query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community Community contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants