Skip to content
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

Running our Docker Containers as ROOT could let a user gain root access on the host #3119

Open
sameh-farouk opened this issue May 26, 2021 · 0 comments
Milestone

Comments

@sameh-farouk
Copy link
Member

sameh-farouk commented May 26, 2021

Description

Running our Docker Container as ROOT could pose a security risk.

https://github.com/threefoldtech/js-sdk/blob/8d6b956acb528da0a28af10a772544bcdadb9718/jumpscale/install/Dockerfile

even with the container is isolated, it does not prevent the attacker from exploiting other services via the network.

Version information

  • Project commit/version: js-sdk 8d6b956 11.0b4

Implementation

configuring our container to use unprivileged user is the best way to prevent privilege escalation attacks.
we can refer to this example for implementation:

Example:

FROM alpine
RUN groupadd -r myuser && useradd -r -g myuser myuser
"HERE DO WHAT YOU HAVE TO DO AS A ROOT USER LIKE INSTALLING PACKAGES ETC."
USER myuser
"THINGS DON'T REQUIRE ROOT"

Useful References

https://docs.docker.com/engine/reference/builder/#user
https://americanexpress.io/do-not-run-dockerized-applications-as-root/
https://engineering.bitnami.com/articles/why-non-root-containers-are-important-for-security.html
http://www.projectatomic.io/blog/2016/01/how-to-run-a-more-secure-non-root-user-container/

@sameh-farouk sameh-farouk added this to the later milestone May 26, 2021
@sameh-farouk sameh-farouk added this to Accepted in JS-SDK 11.6 via automation Jun 20, 2021
@sameh-farouk sameh-farouk moved this from Accepted to Backlog in JS-SDK 11.6 Jun 20, 2021
@xmonader xmonader removed this from Backlog in JS-SDK 11.6 Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant