Security failures destroy trust instantly. These items are non-negotiable before any user sees your product.
- HTTPS everywhere: Force SSL on all routes. Use Let's Encrypt (free) or your hosting provider's SSL. No mixed content warnings.
- Authentication hardened: Password hashing with bcrypt/argon2, minimum 8-character passwords, account lockout after 5 failed attempts.
- Session management: HTTP-only cookies, secure flag set, session timeout after 24 hours of inactivity, session invalidation on password change.
- CSRF protection: Django CSRF middleware enabled on all POST endpoints. SPA applications use CSRF tokens or SameSite cookies.
- Input validation: Server-side validation on every form field. Never trust client-side validation alone. Sanitize HTML input to prevent XSS.
- SQL injection prevention: Use ORM queries exclusively. If raw SQL is required, use parameterized queries — never string interpolation.
- Rate limiting: Implement on login (5 attempts/minute), registration (3/hour), API endpoints (100/minute), and password reset (3/hour).
- API authentication: Token-based auth (JWT or API keys) for all API endpoints. Tokens expire after 24 hours. Refresh tokens stored securely.
- File upload security: Validate file types server-side, scan for malware, limit file size (10MB default), store outside web root.
- Secrets management: No API keys, database passwords, or secrets in code. Use environment variables or a secrets manager (AWS Secrets Manager, HashiCorp Vault).
- Dependency audit: Run
pip auditornpm audit. Fix all critical and high vulnerabilities before launch. - Security headers: Set X-Content-Type-Options, X-Frame-Options, Content-Security-Policy, Strict-Transport-Security headers.
Time to implement: If you built with Django, most of these are configured by default. Budget 2-3 days for a security review and fixes. Cost: EUR 200-400 if hiring a developer.