Laravel Post-Breach Response Checklist

A step-by-step incident response checklist for Laravel applications. Covers containment, investigation, remediation, and communication after a security breach.

Progress
0 / 16 completed

Immediate Containment (First Hour)

Rotate APP_KEY immediately

If the APP_KEY was compromised (through .env exposure), generate a new one with php artisan key:generate. This invalidates all encrypted data, sessions, and cookies. All users will be logged out.

Rotate all exposed credentials and API keys

Change database passwords, third-party API keys, mail credentials, and any other secrets in your .env file. Start with payment processor and banking API keys — these have the highest immediate risk.

Disable debug mode if it was enabled

Set APP_DEBUG=false immediately. Every error page in debug mode continues to leak credentials and application internals while the incident is ongoing.

Revoke all active user sessions

If using database sessions, truncate the sessions table. If using Redis, flush the session store. This forces all users to re-authenticate with clean sessions.

Investigation & Assessment

Determine the attack vector and timeline

Review access logs, application logs, and error logs to determine how the attacker gained access and when the breach started. Check for .env access, debug page hits, Telescope access, and unusual API requests.

Identify which data was accessed or exfiltrated

Based on the attack vector, determine what data the attacker could have accessed. If .env was exposed, assume all credentials were compromised. If debug mode was on, check what data appeared in error pages.

Check for backdoors or unauthorized changes

Review recent file changes, new user accounts (especially admin), modified routes, and any cron jobs or scheduled tasks that were not present before. Check for webshells in the storage or public directories.

Review database for unauthorized modifications

Check for new admin users, modified permissions, changed email addresses on existing accounts, and any data that has been altered. Compare against your most recent backup if possible.

Remediation & Hardening

Fix the root cause vulnerability

Address the specific vulnerability that was exploited. If .env was exposed, configure your web server to block dotfile access. If debug mode was on, add deployment checks. Fix the root cause, not just the symptom.

Force password reset for all affected users

If user credentials may have been compromised, force a password reset for all affected accounts. Notify users with clear instructions and explain what happened without unnecessary alarm.

Update all dependencies and apply security patches

Run composer update and check for any security patches in Laravel, PHP, and your server software. The breach may have exploited a known vulnerability that has already been patched.

Implement missing security controls

Add the security measures that would have prevented or detected the breach earlier: security headers, access restrictions on admin tools, external monitoring, rate limiting, and 2FA for admin accounts.

Communication & Prevention

Notify affected users according to legal requirements

Most jurisdictions require breach notification within a specific timeframe (72 hours under GDPR, varies by state in the US). Be transparent about what happened, what data was affected, and what steps you are taking.

Document the incident timeline and response

Create a detailed incident report with the timeline, attack vector, data impact, containment steps, and remediation actions. This document is essential for regulatory compliance and internal learning.

Set up continuous monitoring to prevent recurrence

Deploy external security monitoring (like StackShield) to continuously check for the types of exposures that led to the breach. Automated monitoring catches configuration drift before it becomes a vulnerability.

Conduct a post-incident review with the team

Hold a blameless post-mortem to discuss what happened, what worked well in the response, and what processes need to change. Document action items and assign owners for each improvement.

Frequently Asked Questions

What should I do first if I discover my .env file was exposed?

Immediately rotate APP_KEY, all database passwords, and all API keys in the .env file. Then block public access to the .env file at the web server level. Finally, invalidate all user sessions. Speed matters — every minute the credentials are active is additional exposure.

How do I know if user data was actually accessed?

Check your web server access logs for requests to the .env file, debug pages, Telescope, or other sensitive endpoints. Review application logs for unusual queries or data exports. If you cannot confirm data was not accessed, assume it was and notify users accordingly.

Am I legally required to notify users of a breach?

In most cases, yes. GDPR requires notification within 72 hours for EU user data. Most US states have breach notification laws. If you handle healthcare data (HIPAA) or financial data, additional requirements apply. Consult legal counsel for your specific situation.

Related Fix Guides

Other Checklists

Automate These Checks with StackShield

Stop running through checklists manually. StackShield continuously monitors your Laravel application for the security issues that matter most.

Start Free Trial