-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WARN] 4.1 - Ensure a user for the container has been created #437
Comments
Hi @yaminisridaran, I haven't tested the script in a K8s environment and it wasn't really written with that in mind, but could you share the commands used when creating the container?
|
|
@konstruktoid I tried the above mentioned both the commands. |
And what does |
@konstruktoid$ docker inspect --format 'User={{.Config.User}}' $(docker ps -q) |
So the test works when doing it manually, you only got three containers with a non-root user defined. |
@konstruktoid Yes. But these 3 container are in single pod. But the docker bench tool shows this pod running as ROOT |
@yaminisridaran, the script isn't in anyway K8s aware so pods et al isn't taken into consideration, only Docker commands and settings. |
@konstruktoid but as per the docker commands and settings these containers should not be displayed in the output. |
I see the same issue with memory restriction docker benchmark. Have configured memory restriction and I am able to see the memory restriction using command |
Could you do |
@konstruktoid The log output has my container image names. I think I will not be able to upload with the names. |
Any other way to debug this issue |
well, you can redact the names. |
@konstruktoid dbs.log has some many containers from my cluster. changing all those name takes time. Do we have a simpler way to verify this? |
Can't you just script the redaction? |
@konstruktoid I executed /usr/local/bin # docker-bench-security.sh -c container_images &> ./dbs.log Below I have mentioned the output. But I did not notice any separate logs output dbs.log screenshot |
@konstruktoid Found out the issue. Pause container in pod it is considering as root user. |
@yaminisridaran Thanks for looking into this, and that's a kind of funny result. Basic Docker:
|
@konstruktoid User=0 needs to be considered as root user. |
@konstruktoid I am using the below mention comment to launch and I noticed the 4_container_images.sh is not the latest. looks like latest changes in 4_container_images.sh is not reflecting in the docker image of docker-bench. Am I missing anything here?
|
Ah yes, see #405... It's a classic. |
@konstruktoid I would like to do the signing, publish the docker image. Can you please guide me how to do it. |
See #405 (comment) |
Closing since we're all waiting for the Docker organization. |
[WARN] 4.1 - Ensure a user for the container has been created
I am deploying my container in Kubernetes using deployment and configured security context to runAsUser: 1000
When I execute the docker bench tool that pod is displayed with warning Running as root.
$ docker inspect --format 'User={{.Config.User}}' 81ab3f4a5a87
User=1000
Can anyone please help me with this issue
The text was updated successfully, but these errors were encountered: