Skip to content

Dockerfile should check for ARGs or ENVs that ends with _PSW #6064

Description

@felipecrs

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions