Dockerfile should check for `ARG`s or `ENV`s that ends with `_PSW`
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 10.3k
- Forks
- 1.5k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 48
Description
Description
The following triggers the check:
FROM ubuntu
ARG CREDENTIALS="pass"
RUN echo "${CREDENTIALS}"
Sensitive data should not be used in the ARG or ENV commands (Do not use ARG or ENV instructions for sensitive data (ARG "CREDENTIALS"))
https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
But the following does not:
FROM ubuntu
ARG SOME_PSW="pass"
RUN echo "${SOME_PSW}"
I believe all ARGs or ENVs that ends with _PSW should trigger this rule because this is how credentials are injected in Jenkins by default.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation and tests for the Dockerfile secrets-used-in-arg-or-env rule, then trace how ARG and ENV names are checked. Reproduce the examples from the issue, including SOME_PSW, and update the behavior so the reported _PSW case is detected. Done means the new case is covered by a passing test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dockerfile, go
- Domain
- build-system, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100