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

Dockerfile user #763

Merged
merged 2 commits into from
Mar 28, 2023
Merged

Dockerfile user #763

merged 2 commits into from
Mar 28, 2023

Conversation

JChopinRevel
Copy link
Contributor

Just a few add to create a nitter user and avoid to have a container running as root.

@dennis1248
Copy link
Contributor

dennis1248 commented Mar 5, 2023

There is little benefit to doing this, this containerized root user is not truly root. Under Docker (by default) the container still runs as (the real) root regardless of the user used within the container.

The only benefit from doing this would be to avoid this "root" user from running amok within the container itself if the application were to be compromised. But if the app was compromised to allow for remote execution switching to the root user should be trivial.

@mikroskeem
Copy link
Contributor

But if the app was compromised to allow for remote execution switching to the root user should be trivial.

Can you elaborate?

this containerized root user is not truly root

That's quite big misconception - that user is true root, just running with strict seccomp profile. I'd say there's a bigger chance for sandbox escape when app is run as root, compared to setting up an unprivileged user and using that.

While Docker does support user namespaces now, this feature is still not enabled by default - now that'd make this addition unnecessary.

Setting up a separate non-privileged user is low hanging fruit, so it does not hurt to do this. https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html#rule-2-set-a-user

@TommyTran732
Copy link
Contributor

There is little benefit to doing this, this containerized root user is not truly root. Under Docker (by default) the container still runs as (the real) root regardless of the user used within the container.

The only benefit from doing this would be to avoid this "root" user from running amok within the container itself if the application were to be compromised. But if the app was compromised to allow for remote execution switching to the root user should be trivial.

If it is a container running as root without "userns-remap" then the root inside it is the actual root user.

@zedeus zedeus merged commit e93de59 into zedeus:master Mar 28, 2023
@zedeus
Copy link
Owner

zedeus commented Mar 28, 2023

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

5 participants