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
Describe the bug
AKS SP is exposed using env injector and brings even bigger vulnerabillity than the problem it is trying to solve
To Reproduce
First of all this is mine initContainer yaml part. Second to that, my application container is running on user 1000 with read-only fs and drop all capabillities (do not need to tell, best practises to run securely your dockerized applications)
but if you exec into application container and ls -l / this is how it looks
user@app-6498f5f49f-7hkl6:/$ ls -l /
total 68
drwxr-xr-x 1 root root 4096 Jan 2 13:38 app
drwxrwxrwt 2 root root 80 Jan 3 08:14 azure-keyvault
drwxr-xr-x 1 root root 4096 Nov 22 08:33 bin
drwxr-xr-x 2 root root 4096 Sep 8 10:51 boot
...
The problem is with folder azure-keyvault which contains binary and json file.
if you write inside container env output is nice, like in examples, env vars are hidden, but if you do /azure-keyvault/azure-keyvault-env env you get "decrypted" env vars, but this is not the worst case.
The worst case is that json inside the directory with READ permission, which has AKS SP credentials in plain text, you can get AKS Admin with those and access every resource AKS has access to!
user@app-6498f5f49f-7hkl6:/$ ls -l azure-keyvault/
total 37008
-rwxr-xr-x 1 root root 37890317 Jan 3 08:14 azure-keyvault-env
-r--r--r-- 1 root root 1396 Jan 3 08:14 azure.json
Expected behavior
It shouldn't be such "leftovers" in application container.
Additional context
I am really surprised that is not covered in documentation and no one raised this concern.
The text was updated successfully, but these errors were encountered:
Walking through your report and doing some additional analysis, we agree this could be handled better than today.
We'll give a more detailed explanation soon, but for now, the solution we will implement basically deletes the entrire /azure-keyvault/-folder as soon as the azure-keyvault-env executable is started, including itself.
Describe the bug
AKS SP is exposed using env injector and brings even bigger vulnerabillity than the problem it is trying to solve
To Reproduce
First of all this is mine initContainer yaml part. Second to that, my application container is running on user 1000 with read-only fs and drop all capabillities (do not need to tell, best practises to run securely your dockerized applications)
but if you
exec
into application container andls -l /
this is how it looksThe problem is with folder
azure-keyvault
which contains binary and json file.if you write inside container
env
output is nice, like in examples, env vars are hidden, but if you do/azure-keyvault/azure-keyvault-env env
you get "decrypted" env vars, but this is not the worst case.The worst case is that json inside the directory with READ permission, which has AKS SP credentials in plain text, you can get AKS Admin with those and access every resource AKS has access to!
Expected behavior
It shouldn't be such "leftovers" in application container.
Additional context
I am really surprised that is not covered in documentation and no one raised this concern.
The text was updated successfully, but these errors were encountered: