You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SECURITY] Run the production container as a non-root user #833
The final app stage starts from ubuntu:22.04 and contains no USER instruction (Dockerfile). Thus a build from this Dockerfile runs the default server as root unless the caller overrides it. This source state is unchanged from the distribution concern in lab finding 21530.
Root magnifies filesystem/credential impact of server defects. It is not, by itself, a container escape. This review inspected the current Dockerfile and did not rebuild/pull a production image; the lab inspected a published image at its earlier tested version.
Required outcome
Create a dedicated runtime user/group, give it only the required writable application/cache locations, and set USER in the production stage.
Keep secrets/config read-only where practical and document volume ownership/user overrides.
Preserve CLI and authenticated server use; do not change build/test utility stages unnecessarily.
Validation and acceptance
Build the production image, inspect Config.User, and run CLI plus pgwire/MCP smoke tests as non-root with fresh and mounted cache volumes. Verify registry installation, audit output and credential-file access with intended permissions. Include supported-platform image checks.
Scope and related work
The default unauthenticated server command and published-port behavior are covered by the listener issue. This separate issue is privilege reduction and can be delivered independently.
Activity