File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
frontend/dockerfile/docs/rules Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,17 @@ Potentially sensitive data should not be used in the ARG or ENV commands
13
13
14
14
## Description
15
15
16
- While it is common in many local development setups to pass secrets to running
17
- processes through environment variables, setting these within a Dockerfile via
18
- the ` ENV ` command means that these secrets will be committed to the build
19
- history of the resulting image, exposing the secret. For the same reasons,
20
- passing secrets in as build arguments, via the ` ARG ` command, will similarly
21
- expose the secret. This rule reports violations where ` ENV ` and ` ARG ` key names
22
- appear to be secret-related.
16
+ While it is common to pass secrets to running processes
17
+ through environment variables during local development,
18
+ setting secrets in a Dockerfile using ` ENV ` or ` ARG `
19
+ is insecure because they persist in the final image.
20
+ This rule reports violations where ` ENV ` and ` ARG ` keys
21
+ indicate that they contain sensitive data.
22
+
23
+ Instead of ` ARG ` or ` ENV ` , you should use secret mounts,
24
+ which expose secrets to your builds in a secure manner,
25
+ and do not persist in the final image or its metadata.
26
+ See [ Build secrets] ( https://docs.docker.com/build/building/secrets/ ) .
23
27
24
28
## Examples
25
29
You can’t perform that action at this time.
0 commit comments