fix(security): TRUST_PROXY hinter Cloudflare auf Netzliste statt Hop-Zahl
Mit TRUST_PROXY=1 (Standard) war req.ip die Cloudflare-Edge, weil Traefik sie als letzten X-Forwarded-For-Eintrag anhaengt. Rate-Limits trafen damit alle Clients derselben Edge gemeinsam, und IP-Freigaben von API-Schluesseln sahen nie die echte Adresse. Vorlage und .env.example nennen jetzt "loopback, uniquelocal" plus die Cloudflare-Netze: Express nimmt den ersten Eintrag von rechts ausserhalb dieser Netze, also den Client, den Cloudflare angehaengt hat. Vom Client mitgeschickte Eintraege links davon erreicht die Auswertung nie. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
04f9363e4b
commit
570f4f94e4
2 files changed
+9
No files matched your search
@@ -21,6 +21,9 @@ FRONTEND_ORIGIN="http://localhost:3000"
|
||||
# Reverse-proxy hops in front of the backend whose X-Forwarded-For is
|
||||
# trusted (client IP for rate limits and API-key IP allowlists). "1" for the
|
||||
# single K8s ingress; a list such as "loopback, 10.0.0.0/8" also works.
|
||||
# Behind Cloudflare + Traefik use "loopback, uniquelocal, <Cloudflare ranges>"
|
||||
# (see deploy/k8s/backend/configmap.example.yaml); "1" would yield the
|
||||
# Cloudflare edge IP that many clients share.
|
||||
TRUST_PROXY=1
|
||||
|
||||
# Refresh-token cookie requires HTTPS by default. Set to "false" only for
|
||||
|
||||
Reference in new issue
Block a user