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

Docker image runs as root #2

Open
franklindyer opened this issue Jan 31, 2024 · 3 comments
Open

Docker image runs as root #2

franklindyer opened this issue Jan 31, 2024 · 3 comments
Labels
meta Changes involving setting up and hosting an instance of Agora.

Comments

@franklindyer
Copy link
Owner

This is a bad practice! Need to figure out how to allow non-root user inside of the Docker image to still be able to access the contents of volumes.

@altheaden
Copy link
Collaborator

Since the volumes are user-generated (and thus not on the repo) why is it that we need the user to run docker not as root?

@franklindyer
Copy link
Owner Author

franklindyer commented Jan 31, 2024

So when I say "not as root", I mean that the user in the docker image should not be the root user. Regardless, we will have to run docker using sudo - but inside of the docker image, there can also be multiple users, and it would be best to use a non-root user inside of the image when possible.

The reason for this is that a docker image is not quite so isolated from the OS's kernel as a virtual machine. In particular, it basically shares the kernel with the OS. This means that having "root privileges" inside of the docker image also allows you to exercise "root privileges" outside of the docker image. This means that if (somehow) our app were so insecure that it were possible for someone to execute arbitrary commands, they would not only be able to do whatever they wanted inside of the docker image, but also on the server as a whole. (Which would obviously be bad...)

Mostly I just want to adhere to the "principle of least privilege".

@altheaden
Copy link
Collaborator

That makes sense. Thank you!

@altheaden altheaden added the backend Back-end development. label Feb 19, 2024
@altheaden altheaden added docker meta Changes involving setting up and hosting an instance of Agora. and removed backend Back-end development. docker labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Changes involving setting up and hosting an instance of Agora.
Projects
None yet
Development

No branches or pull requests

2 participants