File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ $ docker build --check .
86
86
</tr>
87
87
<tr>
88
88
<td><a href="./secrets-used-in-arg-or-env/">SecretsUsedInArgOrEnv</a></td>
89
- <td>Potentially sensitive data should not be used in the ARG or ENV commands</td>
89
+ <td>Sensitive data should not be used in the ARG or ENV commands</td>
90
90
</tr>
91
91
</tbody >
92
92
</table >
Original file line number Diff line number Diff line change 1
1
---
2
2
title : SecretsUsedInArgOrEnv
3
- description : Potentially sensitive data should not be used in the ARG or ENV commands
3
+ description : Sensitive data should not be used in the ARG or ENV commands
4
4
aliases :
5
5
- /go/dockerfile/rule/secrets-used-in-arg-or-env/
6
6
---
Original file line number Diff line number Diff line change @@ -6,13 +6,17 @@ Potentially sensitive data should not be used in the ARG or ENV commands
6
6
7
7
## Description
8
8
9
- While it is common in many local development setups to pass secrets to running
10
- processes through environment variables, setting these within a Dockerfile via
11
- the ` ENV ` command means that these secrets will be committed to the build
12
- history of the resulting image, exposing the secret. For the same reasons,
13
- passing secrets in as build arguments, via the ` ARG ` command, will similarly
14
- expose the secret. This rule reports violations where ` ENV ` and ` ARG ` key names
15
- appear to be secret-related.
9
+ While it is common to pass secrets to running processes
10
+ through environment variables during local development,
11
+ setting secrets in a Dockerfile using ` ENV ` or ` ARG `
12
+ is insecure because they persist in the final image.
13
+ This rule reports violations where ` ENV ` and ` ARG ` keys
14
+ indicate that they contain sensitive data.
15
+
16
+ Instead of ` ARG ` or ` ENV ` , you should use secret mounts,
17
+ which expose secrets to your builds in a secure manner,
18
+ and do not persist in the final image or its metadata.
19
+ See [ Build secrets] ( https://docs.docker.com/build/building/secrets/ ) .
16
20
17
21
## Examples
18
22
You can’t perform that action at this time.
0 commit comments