deis / postgres

A PostgreSQL database used by Deis Workflow.
https://deis.com
MIT License
36 stars 22 forks source link

Run as non-root user #42

Closed krancour closed 8 years ago

krancour commented 8 years ago

This is a best practice that we should follow wherever we can. In this case, it's probably pretty easy since it would appear that all the processes are already owned by user postgres.

bacongobbler commented 8 years ago

We already are running as non-root. Closing!

krancour commented 8 years ago

@bacongobbler the processes that are running may be running as root, but if you exec into the container, you are root. That's not good.

bacongobbler commented 8 years ago

The only way an attacker can exec into the container are through two points: postgres itself and kubernetes. With the former, you're always running as the postgres user so the attack surface there is reduced to the database, but an attacker should not be able to gain root priveleges in the container. If an attacker is able to access kubernetes, then you've got bigger problems because that should not be exposed to the internet.