st2-dockerfiles icon indicating copy to clipboard operation
st2-dockerfiles copied to clipboard

Allow st2web container to be runable as Non-Root

Open jk464 opened this issue 1 year ago • 3 comments

It is good security practice to run containers without root and minimal privileges.

However, the st2web container attempts to expose on port 80 and 443, which are both <1000 privileged ports.

This PR changes the exposed ports to 8080 / 8443, non-privileged ports.

It also edits permissions on NGINX files, to allow nginx to run as the nginx user.

jk464 avatar Feb 05 '24 13:02 jk464

@cognifloyd I've hopefully actioned all your items - also added in some updates to the st2web README, and also note the latest nginx packages on ubuntu change the nginx user to have 999:999 uid/gid instead of 101:101 - so I've had to update that.

We probably want to pin the nginx version so it doesn't change on arbitrary image builds?

jk464 avatar May 08 '24 10:05 jk464

@cognifloyd I've hopefully actioned all your items - also added in some updates to the st2web README, and also note the latest nginx packages on ubuntu change the nginx user to have 999:999 uid/gid instead of 101:101 - so I've had to update that.

We probably want to pin the nginx version so it doesn't change on arbitrary image builds?

I don't like to manually pin versions most of the time because then someone has to manage that pin. Most of the time (in my experience at least) pins are not well documented, so no one dares to update it until there is a CVE or some other bug or missing feature that forces an update. So, I hesitate to add pinning here without a good plan for how we'll manage that.

cognifloyd avatar May 09 '24 22:05 cognifloyd

@cognifloyd that should be all the issues resolved

jk464 avatar May 15 '24 11:05 jk464