0xMiden / 0xMiden/note-transport-service
Container runs as root, no HEALTHCHECK; compose uses :latest + hardcoded Grafana password
- Lingua principale
- Rust
- Stelle
- 3
- Fork
- 10
- Merge medio
- 2h 23m
- PR unite (30g)
- 4
Descrizione
Severity: medium.
### Summary
Deployment hardening gaps in `bin/node/docker/`.
- **Dockerfile** (`Dockerfile:18-47`): final stage has no `USER` (runs as root) and no `HEALTHCHECK` (`grpc_health_probe` not bundled).
- **docker-compose.yml**: no `restart:` on any service (a node crash leaves the stack down); images pinned to `:latest` (`otel/opentelemetry-collector-contrib`, `grafana/grafana`, `grafana/tempo`, `prom/prometheus`); `GF_SECURITY_ADMIN_PASSWORD=admin` hardcoded; sets `OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf`, which the node ignores (`logging.rs` always uses `.with_tonic()` gRPC — it only works because the endpoint is the gRPC port). No Grafana dashboards/datasources are provisioned.
- **Makefile** `docker-run-node`: mounts `-v node-db:/db` but never passes `--database-url`, so it runs `:memory:` and the volume is dead weight (adjacent to #112).
### Recommendation
Add a non-root `USER` and a HEALTHCHECK (bundle `grpc_health_probe`); add `restart: unless-stopped`; pin image tags; env-parameterize the Grafana password; remove the misleading protocol var; provision a starter dashboard; pass `--database-url /db/node.db` in the Makefile target.
Related: #112.
---
Part of #114.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Esamina il Dockerfile in bin/node/docker/ e il docker-compose.yml. Comprendi come viene costruito ed eseguito il servizio node, incluso il meccanismo di controllo dello stato (grpc_health_probe). Rivedi il target 'docker-run-node' del Makefile per vedere come viene impostato l'URL del database. Il lavoro comporta la modifica delle configurazioni Docker, delle variabili d'ambiente e possibilmente l'aggiunta del provisioning per Grafana. Il successo significa che il container viene eseguito come non-root, ha un controllo dello stato, utilizza tag di immagine fissi e il volume del database viene utilizzato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, docker-compose, grafana, prometheus
- Ambito
- devops, infrastructure, observability
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100