ozontech / ozontech/seq-db

Container Runs as Root User in Dockerfile

Open
#452 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
131
Forks
16
Avg merge
2d 4h
Merged PRs (30d)
11

Description

Location: build/package/Dockerfile (missing USER instruction)

Description:
The Dockerfile at build/package/Dockerfile does not specify a USER instruction, causing the container to run as root (UID 0) by default. This constitutes a critical security issue as it violates the principle of least privilege.

Risk:

  • If any vulnerability (e.g., RCE) in the application is successfully exploited, the attacker gains full root privileges inside the container, significantly simplifying further attacks on the host system. The root user has complete access to all processes, files, and network stacks within the container, providing the attacker with greater latitude for lateral movement.

  • Non‑compliance with CIS Docker Benchmark (4.1), OWASP Docker Security, and Kubernetes Pod Security Standards (Restricted profile).

Recommendations:

  1. In the Dockerfile: Create a non‑privileged user and switch to it using the USER instruction. The user must have read/write permissions on the required directories (/seq-db-data, /var/log/seq-db).
  2. In Kubernetes: Configure securityContext in deployment/k8s/helm-chart/templates/seq-proxy/deployment.yaml:
securityContext:
  runAsNonRoot: true
  runAsUser: 1001

Additionally, at the container level, add allowPrivilegeEscalation: false.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with build/package/Dockerfile and inspect how /seq-db-data and /var/log/seq-db are created and used. Then read deployment/k8s/helm-chart/templates/seq-proxy/deployment.yaml and verify the requested pod and container security settings. Done means the image runs as a non-root user with required directory access, and the deployment disallows privilege escalation.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, kubernetes
Domain
devops, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.