forked from semgrep/semgrep
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'dockerfile' as a Dockerfile file name (semgrep#7819)
Dockerfiles can be called `dockerfile` as well as `Dockerfile`. Support both. Closes semgrep#7824 Test plan: see tests PR checklist: - [x] Purpose of the code is [evident to future readers](https://semgrep.dev/docs/contributing/contributing-code/#explaining-code) - [x] Tests included or PR comment includes a reproducible test plan - [x] Documentation is up-to-date - [x] A changelog entry was [added to changelog.d](https://semgrep.dev/docs/contributing/contributing-code/#adding-a-changelog-entry) for any user-facing change - [x] Change has no security implications (otherwise, ping security team) If you're unsure about any of this, please see: - [Contribution guidelines](https://semgrep.dev/docs/contributing/contributing-code)! - [One of the more specific guides located here](https://semgrep.dev/docs/contributing/contributing/) --------- Co-authored-by: Emma Jin <--get> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Jambon <[email protected]>
- Loading branch information
1 parent
36b46c9
commit d167b01
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
When scanning with `-l dockerfile`, files named `dockerfile` as well as `Dockerfile` will be scanned. |
88 changes: 88 additions & 0 deletions
88
...t_spacegrep/test_spacegrep/rulesspacegrepdockerfile.yaml-spacegrepdockerfile/results.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"errors": [], | ||
"paths": { | ||
"_comment": "<add --verbose for a list of skipped paths>", | ||
"scanned": [ | ||
"targets/spacegrep/dockerfile" | ||
] | ||
}, | ||
"results": [ | ||
{ | ||
"check_id": "rules.spacegrep.double-root", | ||
"end": { | ||
"col": 10, | ||
"line": 3, | ||
"offset": 43 | ||
}, | ||
"extra": { | ||
"engine_kind": "OSS", | ||
"fingerprint": "0x42", | ||
"is_ignored": false, | ||
"lines": "USER root", | ||
"message": "'USER' is specified twice\n", | ||
"metadata": {}, | ||
"metavars": { | ||
"$ROOT": { | ||
"abstract_content": "root", | ||
"end": { | ||
"col": 10, | ||
"line": 3, | ||
"offset": 43 | ||
}, | ||
"start": { | ||
"col": 6, | ||
"line": 3, | ||
"offset": 39 | ||
} | ||
} | ||
}, | ||
"severity": "ERROR" | ||
}, | ||
"path": "targets/spacegrep/dockerfile", | ||
"start": { | ||
"col": 1, | ||
"line": 3, | ||
"offset": 34 | ||
} | ||
}, | ||
{ | ||
"check_id": "rules.spacegrep.double-root", | ||
"end": { | ||
"col": 10, | ||
"line": 7, | ||
"offset": 111 | ||
}, | ||
"extra": { | ||
"engine_kind": "OSS", | ||
"fingerprint": "0x42", | ||
"is_ignored": false, | ||
"lines": "USER root", | ||
"message": "'USER' is specified twice\n", | ||
"metadata": {}, | ||
"metavars": { | ||
"$ROOT": { | ||
"abstract_content": "root", | ||
"end": { | ||
"col": 10, | ||
"line": 7, | ||
"offset": 111 | ||
}, | ||
"start": { | ||
"col": 6, | ||
"line": 7, | ||
"offset": 107 | ||
} | ||
} | ||
}, | ||
"severity": "ERROR" | ||
}, | ||
"path": "targets/spacegrep/dockerfile", | ||
"start": { | ||
"col": 1, | ||
"line": 7, | ||
"offset": 102 | ||
} | ||
} | ||
], | ||
"version": "0.42" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM alpine | ||
# ruleid: double-root | ||
USER root | ||
RUN apk install curl | ||
CMD ["/hello"] | ||
# ruleid: double-root | ||
USER root | ||
CMD ["ls -ltr"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters