Credentials exposed as env vars instead of mounted read-only volumes

Aperta
#3,161 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
aws, kubernetes, postgresql, shell

Direzione di ricerca

Traccia dove l'operatore inietta PGPASSWORD e le credenziali AWS come variabili d'ambiente, quindi leggi spilo's entry_point.sh, che attualmente utilizza i valori AWS dall'ambiente. Verifica i requisiti indicati di WAL-E/WAL-G relativi al file delle credenziali e i requisiti di Patroni per le credenziali basate su file. Il lavoro è completato quando le credenziali elencate vengono fornite tramite file montati in sola lettura anziché tramite variabili d'ambiente e i componenti dipendenti possono ancora utilizzarle.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary
The operator injects sensitive credentials as plaintext environment variables into pod containers instead of mounting them as read-only volumes:

  • PGPASSWORD_SUPERUSER, PGPASSWORD_STANDBY
  • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY

Per OWASP's Kubernetes Security Cheat Sheet: "It is best for secrets to be mounted into read-only volumes in your containers, rather than exposing them as environment variables." Env vars are readable via /proc//environ, process listings, and are prone to leaking into logs/crash dumps.

Expected Behavior

  • AWS credentials for WAL-E/WAL-G should be mounted as a read-only credentials file (e.g. ~/.aws/credentials) instead of AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY env vars. This requires corresponding support in spilo's entry_point.sh, which currently reads these values from the environment.
  • Postgres superuser/standby/monitoring passwords should be mounted as a read-only .pgpass file (or equivalent Patroni file-based credential support) instead of PGPASSWORD_SUPERUSER/PGPASSWORD_STANDBY/POSTGRES_PASSWORD env vars.

Impact

Compromise of any of these containers, or any way to read /proc//environ, exposes long-lived AWS IAM keys (full access to the WAL backup bucket — exfiltrate, delete, or tamper with backups) and/or the Postgres superuser password (full database access).

Reference

OWASP Kubernetes Security Cheat Sheet — "Keep secrets as secrets": https://cheatsheetseries.owasp.org/cheatsheets/Kubernetes_Security_Cheat_Sheet.html#keep-secrets-as-secrets

Lingua principale
Go
Stelle
5.3k
Fork
1.1k
Merge medio
3g 17h
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di zalando/postgres-operator

Tutte le issue di zalando/postgres-operator

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.