Day 5 of 5
⏱ ~60 minutes
Cybersecurity + AI — Day 5

Production Security Hardening — AI-Assisted Audit and Response

Complete the cybersecurity course: AI-assisted production security hardening, incident response, and building recurring security practices.

From Development to Production Security

Days 1 through 4 covered the attack landscape, LLM-specific vulnerabilities, threat detection, and automated code review. Day 5 connects all of it into a production security posture: what to audit before you ship, how to use AI for incident response, and how to build a security culture that outlasts any single audit.

The Pre-Launch Security Checklist

Use Claude to generate and execute a comprehensive security checklist specific to your application stack.

Prompt — Application security audit
You are a senior application security engineer. Audit the following application for production readiness.

Stack: Node.js + Express + PostgreSQL + Claude API + AWS App Runner
Authentication: JWT + Google OAuth
File uploads: yes (multer, S3)
User data: yes (PII)

Generate a prioritized security checklist covering:
1. Authentication and session security
2. Input validation and injection prevention
3. File upload security
4. API security (rate limiting, key management)
5. LLM-specific risks (prompt injection, data leakage)
6. Infrastructure security (AWS IAM, secrets management)
7. Monitoring and incident response

For each item: priority (P0/P1/P2), specific test to verify, pass/fail criteria.

AI-Assisted Incident Response

When something goes wrong, AI can dramatically accelerate incident response: parsing logs, classifying the attack type, drafting communication, and generating remediation steps.

Prompt — Incident triage
You are an incident response specialist. Analyze the following logs and triage this security incident.

Application logs (last 2 hours):
[paste log excerpts]

Answer:
1. What type of attack or anomaly is this? (Be specific)
2. What is the estimated impact? (data accessed, accounts affected)
3. Is the attack ongoing or historical?
4. What is the immediate containment action? (be specific to our stack)
5. What forensic evidence should we preserve right now?
6. Draft a brief internal incident notification (for engineering team)
7. Draft a user notification (if PII was potentially exposed)

Security Headers Hardening

Node.js — Production security headers
import helmet from 'helmet';
import rateLimit from 'express-rate-limit';

// Security headers
app.use(helmet({
  contentSecurityPolicy: {
    directives: {
      defaultSrc: ["'self'"],
      scriptSrc: ["'self'"],
      styleSrc: ["'self'", "'unsafe-inline'"],
      imgSrc: ["'self'", 'data:', 'https:'],
      connectSrc: ["'self'", 'https://api.anthropic.com'],
    }
  },
  hsts: { maxAge: 31536000, includeSubDomains: true, preload: true },
  noSniff: true,
  xssFilter: true,
  referrerPolicy: { policy: 'strict-origin-when-cross-origin' }
}));

// Rate limiting by endpoint sensitivity
const authLimiter = rateLimit({ windowMs: 15 * 60 * 1000, max: 10, message: 'Too many auth attempts' });
const apiLimiter = rateLimit({ windowMs: 60 * 1000, max: 100 });

app.use('/auth', authLimiter);
app.use('/api', apiLimiter);

Dependency Security Scanning

Terminal — Automated security scanning
# npm audit — check for known vulnerabilities
npm audit
npm audit --fix  # auto-fix compatible updates

# Generate audit report
npm audit --json > security-audit.json

# Snyk (more comprehensive)
npm install -g snyk
snyk auth
snyk test
snyk monitor  # continuous monitoring

# Add to CI/CD (GitHub Actions)
# - name: Security Audit
#   run: npm audit --audit-level high && npx snyk test
💡
Paste your npm audit output into Claude with the prompt: "Triage these vulnerabilities by exploitability and business impact. Which must be fixed before launch vs acceptable risk?" It will give you a ranked remediation list faster than reading the CVE entries yourself.

Building a Security Culture

One-time audits don't create secure software — recurring practices do. These are the minimal recurring security practices for a small team:

Day 5 Capstone Exercise
Full Security Audit of Your Application
  1. Run the pre-launch security audit prompt on your actual application stack
  2. Execute npm audit and paste the output into Claude for triage
  3. Implement the security headers from this lesson on your Express app
  4. Write a security-focused PR checklist for your team
  5. Set up a weekly calendar reminder to run the dependency audit

Day 5 Summary — Cybersecurity + AI Course Complete

  • Pre-launch checklist prompts give you a stack-specific security review in minutes
  • AI dramatically accelerates incident triage: log analysis, impact assessment, communications
  • Helmet.js + rate limiting + CSP cover the majority of common web vulnerabilities
  • npm audit weekly + snyk in CI/CD catches dependency vulnerabilities before they bite you
  • Security is a recurring practice, not a one-time audit — build the habits that make it automatic

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?