Skip to content

Security hardening + enterprise email (production) - #9

Merged
JuanBerro-back merged 1 commit into
mainfrom
security/production-hardening
Oct 25, 2026
Merged

JuanBerro-back merged 1 commit into
mainfrom
security/production-hardening

Conversation

@JuanBerro-back

Copy link
Copy Markdown
Collaborator

Aplica al backend de produccion la auditoria de seguridad completa y el correo enterprise (SMTP/Resend), con despliegue endurecido (Docker/Caddy, Render, Vercel, CI).

Detalle: SECURITY-AUDIT.md, MIGRACION-BACKEND.md, EMAIL-ENTERPRISE.md.

Antes de fusionar: definir JWT_SECRET, DATABASE_URL, ADMIN_USERNAME/ADMIN_PASSWORD, CLIENT_ORIGIN, SEED_DEMO_DATA=false y credenciales de correo.

- Disable demo seeding by default; bootstrap admin from ADMIN_USERNAME/ADMIN_PASSWORD
- Neutralize legacy demo-hash accounts on startup in production
- Enforce JWT HS256/12h, fresh DB identity per request and Socket.IO handshake
- Socket.IO: remove client:identify, derive rooms only from token, fail-closed CORS
- Fix products IDOR, delivery-code leak/bypass, XupAI abuse, dashboard tenant leaks
- Restrict subscription plans to admin, bounded pagination, no fake dashboard data
- helmet CSP/HSTS + equivalent headers in vercel.json/Caddyfile, generic error handler
- Enterprise email: SMTP/Resend/EmailJS with HTML+text, retries, Reply-To/BCC
- Admin email diagnostics endpoints and npm run email:test script
- Deployment: Dockerfile, docker-compose, Caddyfile, render.yaml, CI, .env.production.example
- Bump express/nodemailer to patched releases (npm audit: 0 vulnerabilities)
- Docs: SECURITY-AUDIT.md, MIGRACION-BACKEND.md, EMAIL-ENTERPRISE.md
@JuanBerro-back
JuanBerro-back merged commit a1f5e75 into main Oct 25, 2026
1 check passed
@JuanBerro-back
JuanBerro-back deleted the security/production-hardening branch October 25, 2026 15:25
@Carchaloneo22

Copy link
Copy Markdown
Collaborator

chore(prod): cerrar hallazgos post-fusión del endurecimiento de seguridad

El PR #9 (a1f5e75) aplicó la auditoría y el correo enterprise, pero quedó
sin validación de configuración ni revisión. Este commit cubre lo pendiente:

  • config: validar al arranque que JWT_SECRET, DATABASE_URL, ADMIN_USERNAME,
    ADMIN_PASSWORD, CLIENT_ORIGIN y las credenciales SMTP/Resend estén
    definidas; abortar el boot con error explícito si falta alguna.
  • config: forzar SEED_DEMO_DATA=false fuera de NODE_ENV=development
    (negarse a sembrar datos demo en producción).
  • security: rotar JWT_SECRET y credenciales de admin generadas durante la
    auditoría; eliminar secretos embebidos en docker-compose/Caddyfile.
  • ci: añadir job de escaneo de secretos (gitleaks) y chequeo de env vars
    obligatorias antes del deploy en Render/Vercel.
  • docs: documentar en MIGRACION-BACKEND.md el runbook de despliegue,
    orden de migraciones y procedimiento de rollback (revert de a1f5e75).

Refs: #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants