Week 14: Hardening Web Applications
Security, Performance, and Production Readiness
NoteReading Assignment
Review this material before your final project presentation.
Overview
This week focuses on the gap between a working application and a production-ready one. “Hardening” means systematically reducing the attack surface, improving resilience, and ensuring your application can be operated, monitored, and maintained in production.
Key Concepts
- Defense in depth — security at every layer (network, transport, application, data)
- OWASP Top 10 — the most critical web application security risks
- Authentication hardening — password hashing, JWT best practices, rate limiting
- HTTP security headers — CSP, HSTS, X-Frame-Options via
helmet - Input validation — server-side validation, injection prevention (SQL, NoSQL, XSS)
- Dependency security —
npm audit, lock files, automated scanning - Infrastructure hardening — HTTPS, CORS configuration, secrets management
- Error handling — generic messages in production, structured logging
- Performance — CDN, compression, caching, connection pooling, database indexing
- Monitoring & observability — logs, metrics, traces
Hardening Checklist
Security
Reliability & Performance
Further Reading
OWASP & Security
HTTP Security Headers
- Helmet.js Documentation
- SecurityHeaders.com — scan your deployed app
- MDN Content Security Policy
Authentication & Secrets
Dependency Security
Rate Limiting
- Express Rate Limit — middleware for Express apps
- rate-limit-redis — Redis-backed store for distributed rate limiting
- Understanding Rate Limiting Algorithms (Cloudflare) — fixed window, sliding window, token bucket, leaky bucket
- AWS API Gateway Throttling — platform-level rate limiting
- IETF RateLimit Header Fields (RFC 9110) —
X-RateLimit-*andRetry-Afterheaders
Performance & Monitoring
- web.dev Performance
- Lighthouse Documentation
- Pino Logger — fast structured logging for Node.js
- Express Validator
SSL/TLS
- SSL Labs Server Test — test your TLS configuration
- Let’s Encrypt — free TLS certificates