Security review findings (HIGH-1/2/3, MEDIUM): - Rate limiting via @nestjs/throttler: global 100 req/min default, stricter 10 req/min on login and refresh. Also closes the MEDIUM finding (public batch-lookup enumeration) since it now sits behind the global limit too. Trust the K8s ingress's single proxy hop so throttling keys off the real client IP, not the ingress pod's IP. - Auth events (login success/failure, logout, token refresh) are now audit-logged via new AuditAction values, closing the gap where the project's own audit-log principle never actually covered the Auth module. - Refresh-token cookie now defaults to Secure=true (opt out only via COOKIE_SECURE=false for local HTTP dev), instead of keying off NODE_ENV which was never set in the K8s deploy templates. Added a TLS block + cert-manager annotation to both the backend and frontend ingress templates, which previously had no HTTPS termination configured at all.
22 lines
785 B
Bash
22 lines
785 B
Bash
# Kopieren nach .env und mit echten Werten befuellen. .env ist gitignored.
|
|
|
|
DATABASE_URL="postgresql://user:password@localhost:5432/apicore?schema=public"
|
|
|
|
JWT_ACCESS_SECRET="change-me-access-secret"
|
|
JWT_REFRESH_SECRET="change-me-refresh-secret"
|
|
JWT_ACCESS_EXPIRES_IN="15m"
|
|
JWT_REFRESH_EXPIRES_IN="7d"
|
|
|
|
PORT=3001
|
|
FRONTEND_ORIGIN="http://localhost:3000"
|
|
|
|
# Refresh-token cookie requires HTTPS by default. Set to "false" only for
|
|
# local HTTP development - every real deployment must leave this unset (or
|
|
# "true").
|
|
COOKIE_SECURE=false
|
|
|
|
# Lokales Verzeichnis fuer hochgeladene Dokumente/Bilder (Modul 29).
|
|
# Bei horizontaler Skalierung (>1 Replica) muss dies auf ein geteiltes
|
|
# Volume (z.B. ReadWriteMany-PVC) zeigen, siehe ARCHITECTURE.md Annahme 7.
|
|
DOCUMENTS_STORAGE_PATH="./uploads"
|