Repository navigation
Conversation
…to contain port 8080
Owner
|
Issue I am seeing with this is that this requires a change for current installations which I would like to avoid (change port from 80 to 8080) |
|
How about an additional image like vaultls:latest-unprivileged vaultls-unprivileged:latest? Same way nginx is handling it. Furthermore breaking changes is always a risk when using latest |
Owner
|
Yeah I can see that |
Owner
|
Could you rework your PR to support this? |
Author
Sure, I will do it |
Author
I changed it and e2e test also running fine for both versions @7ritn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
The container was migrated from the standard nginx:stable image to nginxinc/nginx-unprivileged:stable, which runs the Nginx worker processes as a non-root user (UID 101 / nginx) instead of as root. The following adjustments were made to support this:
Base image: nginx:stable → nginxinc/nginx-unprivileged:stable
Port: EXPOSE 80 → EXPOSE 8080 (the unprivileged image binds to high ports by default)
Nginx config: listen 80 → listen 8080, plus pid /tmp/nginx.pid and error_log /dev/stderr so Nginx writes only to locations writable by the non-root user
User context: The container explicitly runs as the nginx user (USER nginx) rather than root
File permissions: Runtime directories (e.g. /app/data) are owned by the nginx user so the application can read and write its data
Why This Matters
Reduced Attack Surface (Principle of Least Privilege) Running as a non-root user means that even if an attacker exploits a vulnerability in Nginx or the backend, they do not automatically gain root access to the container. This significantly limits the blast radius of a compromise.
Defense in Depth The container no longer relies on root privileges for its core operation. Combined with the fact that the container can be launched with an explicit non-root user (--user apps:apps), this provides multiple layers of protection.
Better Container Security Posture Many security scanners and compliance frameworks (e.g. CIS Docker Benchmarks, Kubernetes Pod Security Standards) flag containers running as root. Running as a non-root user helps pass these checks and aligns with industry best practices.
Improved Portability The unprivileged image is designed to work in restricted environments where binding to privileged ports (<1024) is not allowed, such as Kubernetes with certain security contexts or OpenShift (which enforces random UIDs).
No Functional Impact The application behavior is unchanged — the frontend, backend, and proxy configuration work exactly as before, just without root privileges.