Repository navigation
docker-compose: Set no-new-privileges on every service - #1463
Merged
Merged
Conversation
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>
michaellzc
approved these changes
Nov 10, 2026
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.
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
docker-compose.yaml,jaeger, and thepgsql/codeintel-dbcopies indb-only-migrate.docker-compose.yaml. Nothing else changes.cadvisorkeepsprivileged: true, as its comment explains.:rather than=because the Semgrep rule matches that exact text.Addresses the 25
sg-infra-no-new-privilegescode scanning alerts. GitHub code scanning has had no Semgrep upload since 2025-07-10, so they need dismissing by hand after merge.Checklist
Test plan
docker-compose configvalidates the file, and the smoke test starts the full stack, checks every container stays running, and checks the frontend responds.docker-compose/: 30 findings before, 1 after (the executor, left as is).