Repository navigation
Description
Task
T-127· Milestone M10 — Evaluation · Size S · Priority P1 · Epic #10Implements NFR-SEC-002
Branch
ci/t-127-container-hardening-non-root-read— one task = one branch = one PR (doc 32 §6)
Summary
Harden all compose services: read_only: true + tmpfs, cap_drop: [ALL], security_opt: no-new-privileges, mem/cpu limits from .env, healthchecks for every service, Postgres not published beyond localhost.
Context / motivation
Doc 31 §3 container-escape and DoS mitigations.
Scope
In scope
- CI check (
docker compose config+ policy script) asserting hardening keys present.
Implementation guidance
- For every compose service:
read_only: truewithtmpfsfor/tmp(and nginx cache/run dirs);cap_drop: [ALL](anycap_addmust be proven necessary and documented);security_opt: ["no-new-privileges:true"]; non-rootuser:;mem_limit/cpusfrom.envvariables (ROBOPROBE_API_MEM,ROBOPROBE_WORKER_MEM, …, new) with defaults in.env.example;pids_limit; healthchecks everywhere; restart policies. - Postgres published only on
127.0.0.1(or not at all in the app profile); secrets viasecrets:files, never env literals. scripts/check_compose_policy.pyparsesdocker compose config --format jsonfor each profile and asserts the rules; CI step.- Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff
PLR2004); public APIs typed (mypy strict) and documented.
Acceptance criteria
- Stack runs with hardening; policy check in CI.
- Policy script green for profiles core, app, gazebo and observability.
- Stack passes E2E with hardening enabled.
- Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
- Docs, config reference and CHANGELOG
Unreleasedupdated where behaviour, keys or interfaces changed. - Definition of Done (doc 32 §3) satisfied.
Tests required
scripts/check_compose_policy.pyin CI.
Dependencies
Blocked by: #185 (T-116), #200 (T-095), #97 (T-047)
Blocks: no other task (leaf)
Parallelization notes
Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:
- docker/compose.yaml (service options)
scripts/check_compose_policy.py.env.example
Touches compose service options — coordinate (sequenced after T-116/T-095).
Definition of Done
Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-127 (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.
References
Design docs: doc 31 §3 · doc 17 §4 · doc 29 §4
Requirements: NFR-SEC-002 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
Activity
/config.json, CSP & security headers, composewebservice #185docker/gazebo/Dockerfile): pinned Jazzy/Harmonic/Nav2, ros_ws build, worker venv, composegazeboprofile #200make demo#97