Skip to content

docker-compose: Set no-new-privileges on every service - #1463

Merged
marcleblanc2 merged 1 commit into
mainfrom
add-no-new-privileges
Nov 10, 2026
Merged

marcleblanc2 merged 1 commit into
mainfrom
add-no-new-privileges

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Adds security_opt: [no-new-privileges:true] to every service in the compose files, so a process in a container can't gain privileges through setuid or setgid binaries.

Why it's safe: the Helm chart already runs these images with allowPrivilegeEscalation: false, the Kubernetes equivalent. The services Helm doesn't cover that way (caddy, the Postgres exporters, cadvisor) start fine in the CI smoke test.

Review notes

  • The diff is the same two lines, 29 times: the 26 services in docker-compose.yaml, jaeger, and the pgsql / codeintel-db copies in db-only-migrate.docker-compose.yaml. Nothing else changes.
  • cadvisor keeps privileged: true, as its comment explains.
  • The executor compose file is untouched; it runs privileged as root to control the Docker daemon.
  • The value uses : rather than = because the Semgrep rule matches that exact text.

Addresses the 25 sg-infra-no-new-privileges code scanning alerts. GitHub code scanning has had no Semgrep upload since 2025-07-10, so they need dismissing by hand after merge.

Checklist

  • All images have a valid tag and SHA256 sum (no image references changed)

Test plan

  • CI (build 16771): docker-compose config validates the file, and the smoke test starts the full stack, checks every container stays running, and checks the frontend responds.
  • Ran the Semgrep rule locally over docker-compose/: 30 findings before, 1 after (the executor, left as is).

Adds `security_opt: [no-new-privileges:true]` to every service that
defines an image, so processes cannot gain privileges through setuid,
setgid, or file-capability binaries. The Helm chart already runs the
same images with `allowPrivilegeEscalation: false`.

Addresses the 25 open sg-infra-no-new-privileges code scanning alerts.

Amp-Thread-ID: https://ampcode.com/threads/T-01a13cfb-9756-7111-8b29-381a841065e1
Co-authored-by: Amp <amp@ampcode.com>
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

@marcleblanc2
marcleblanc2 requested a review from a team November 10, 2026 04:05
@marcleblanc2
marcleblanc2 merged commit 422b060 into main Nov 10, 2026
4 checks passed
@marcleblanc2
marcleblanc2 deleted the add-no-new-privileges branch November 10, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants