Day 5 of 5
⏱ ~60 minutes
Auth and Security for Web Apps — Day 5

Secrets Management and Production Security Checklist

Day 5 covers secrets management, environment variables, and the production security checklist that every web app needs before going live.

Never Hardcode Secrets

API keys, database passwords, and JWT secrets hardcoded in source code get exposed in git history, logs, error messages, and accidental deployments. Environment variables are the minimum — secret managers are the standard for production.

.env — Local Development
# .env (local only — in .gitignore!)
DATABASE_URL=postgresql://localhost:5432/myapp
JWT_SECRET=super-long-random-string-at-least-32-chars
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_CLIENT_SECRET=GOCSPX-...
.gitignore — What Never to Commit
.env
.env.local
.env.*.local
*.pem
*.key
secrets/
node_modules/
Security Audit with Claude
# Use Claude to audit your security posture:

Prompt: "Review this Express application code for security
vulnerabilities. Check for:
- Hardcoded secrets or API keys
- SQL injection vulnerabilities
- Missing authentication on sensitive routes
- Insecure cookie configuration
- Missing rate limiting
- XSS vulnerabilities in response rendering
- Overly permissive CORS settings

[PASTE YOUR CODE]"

Production Security Checklist

Day 5 Exercise
Security Audit Your App
  1. Run npm audit on your project. Fix any high-severity vulnerabilities.
  2. Paste your main server file into Claude with the security audit prompt above.
  3. Work through the production checklist — check off each item or add it to your code.
  4. Run your app in production mode (NODE_ENV=production) and confirm error details are not exposed.

Course Complete — Secure Web Authentication

  • JWT authentication: stateless, scalable, with proper secret management and expiry.
  • OAuth 2.0: delegated login via Google/GitHub without managing passwords.
  • CSRF and XSS defenses: SameSite cookies, sanitized input, and Content Security Policy.
  • Rate limiting, bcrypt password hashing, and the production security checklist.

Want to go deeper in 3 days?

Our in-person AI bootcamp covers advanced AI development, agentic systems, and production deployment. Five cities. $1,490.

Reserve Your Seat →
Finished this lesson?