You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The secrets provided to build are not available once the container is running. They are no longer on disk, nor are they in the process environment, or in `/proc/self/environ`.
42
42
* The secrets were still useful during the build:
43
43
```bash
44
-
cat /foo_secret.txt
45
-
cat /bar_secret.txt
44
+
cat /foo_secret_hash.txt
45
+
cat /bar_secret_hash.txt
46
+
```
47
+
48
+
### Verifying that images are secret free
49
+
To verify that the build image doesn't contain build secrets, run the following:
50
+
51
+
```bash
52
+
docker pull localhost:5000/test-container:latest
53
+
docker save -o test-container.tar localhost:5000/test-container
54
+
mkdir -p test-container
55
+
tar -xf test-container.tar -C test-container/
56
+
cd test-container
57
+
# Scan image layers for secrets:
58
+
find . -type f | xargs tar -xOf 2>/dev/null | strings | grep -rin "envbuilder-test-secret"
59
+
# Scan image manifests for secrets:
60
+
find . -type f | xargs -n1 grep -rinI 'envbuilder-test-secret'
61
+
cd ../
62
+
```
63
+
64
+
The output of both find/grep commands should be empty.
65
+
To verify that it scans correctly, replace "envbuilder-test-secret" with "envbuilder" and rerun the commands.
66
+
67
+
Having verified that no secrets were included in the image, we can now delete the artifacts that we saved to disk.
0 commit comments