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
This assumes that you have a key vault named example-vault with a secret named example-secret. It also assumes that the Managed Identity running in the cluster has read access to secrets in your key vault.
Apply your manifests using kubectl apply -f manifests.yaml
Get a shell on your pod, e.g. using k9s.
Run the command cat /proc/1/environ | xargs -0 -L1 | sort | grep -i "example_secret"
Expected output:
I have no name!@example-deployment-6bc6b4d5dc-xpkwh:/$ cat /proc/1/environ | xargs -0 -L1 | sort | grep -i "example_secret"
EXAMPLE_SECRET=example-secret@azurekeyvault
Actual output:
I have no name!@example-deployment-6bc6b4d5dc-xpkwh:/$ cat /proc/1/environ | xargs -0 -L1 | sort | grep -i "example_secret"
EXAMPLE_SECRET=this-is-a-secret
The text was updated successfully, but these errors were encountered:
Moortiii
changed the title
[Question] Clarification regarding secret visiblity in container
[Question] Clarification regarding secret visibility in container
Feb 28, 2025
Question
The FAQ section states the following:
I've created an image that runs its workloads as a non-root user with little to no privileges, as recommended by Docker.
However, using the command
cat /proc/1/environ | xargs -0 -L1 | sort
, I am still able to read the injected secrets from the environment.Am I doing something wrong, or does the FAQ need to be updated?
Steps to reproduce
manifests.yaml
with the following contents to create a minimally reproducible example:This assumes that you have a key vault named
example-vault
with a secret namedexample-secret
. It also assumes that the Managed Identity running in the cluster has read access to secrets in your key vault.kubectl apply -f manifests.yaml
cat /proc/1/environ | xargs -0 -L1 | sort | grep -i "example_secret"
Expected output:
Actual output:
The text was updated successfully, but these errors were encountered: