namshi / docker-smtp

SMTP docker container
MIT License
548 stars 198 forks source link

Docker container should'nt run as root #72

Open menardorama opened 4 years ago

menardorama commented 4 years ago

As a security measure, the Dockerfile should have a USER directive in order to run using a non privileged user account.

Can you add it ?

GitJamz commented 4 years ago

This is absolutely true.. Please can we have this feature added as soon as possible!

ebuzzz commented 3 years ago

The container starts up exim (the actual SMTP agent) and that process drops root privileges. I guess the only way to fix this would be to add a new user (apart from Debian-exim) to the image, and chmod all files that exim needs at the startup. I've checked other images that use Exim4, but none of them seem to use this practice. Which leads me to suspect that there is an issue with my thought.

laimison commented 3 years ago

Anyone modified it to avoid root account? If so, can you send what you did in a Dockerfile? If privileged port is the problem, maybe setcap can be used or converting the custom port inside the container to 25 outside of container.

laimison commented 3 years ago

Here is the rootless Dockerfile that could be merged into this solution https://github.com/industrieco/docker-exim-relay

guidoffm commented 3 years ago

Here is the rootless Dockerfile that could be merged into this solution https://github.com/industrieco/docker-exim-relay

The link gives 404 now.

katuka2 commented 9 months ago

@laimison, this link is giving 404 now https://github.com/industrieco/docker-exim-relay