Initial impact: 282 agencies offline, no fallback
Timeline of investigation: how the attacker had days inside
- Initial access occurred before the encryption event. The attacker was inside the environment long enough to disable endpoint protection.
- Security monitoring did not catch the Defender disablement in time. No active 24/7 threat monitoring flagged the change, or if it did, it was not acted on.
- Cross-agency coordination was fragmented. Different agencies had different security postures and no unified incident response protocol, which slowed the initial response.
Critical discovery: backups were not isolated
- 3 copies of data
- 2 different storage media or types
- 1 copy offsite and offline (isolated from the production network)
- Offsite storage mounted via NFS or SMB with credentials stored on the production server. Ransomware reads those credentials and encrypts the remote share.
- Backup jobs push to cloud storage using an API key stored in a config file on the compromised host. Attacker uses the same key to delete or encrypt remote objects.
- Backups exist but have never been tested. The files are there, but they are corrupt, incomplete, or missing critical components (like a database schema or an encryption key needed to decrypt the backup itself).
Temporary mitigation: what agencies did immediately
Architectural fix: monthly isolated restore tests
Step 1: Ensure you actually have an isolated copy
- A separate storage account with credentials that only the backup pull mechanism knows (and that mechanism runs outside production).
- Object storage with object lock or WORM (Write Once Read Many) enabled, so even if an attacker gets the write key, they cannot delete or overwrite existing objects.
- A physically separate machine that pulls backups from production on a schedule, then disconnects or restricts inbound access.
Step 2: Script a restore test
- Pulls the latest backup from isolated storage
- Restores it (database import, file extraction, config placement)
- Runs a basic health check (can the application start, does the database respond, do key tables have rows)
- Logs the result
BASH
#!/bin/bash
# monthly-restore-test.sh — run on a test/staging machine, NOT production
set -euo pipefail
BACKUP_SOURCE='s3://your-isolated-bucket/latest'
RESTORE_DIR='/tmp/restore-test'
DB_NAME='testdb_restore'
LOG_FILE='/var/log/restore-test.log'
echo "[(date)] Starting restore test" >> "LOG_FILE"
# Pull backup files from isolated storage
mkdir -p "$RESTORE_DIR"
aws s3 cp "BACKUP_SOURCE/db-dump.sql.gz" "RESTORE_DIR/" --quiet
aws s3 cp "BACKUP_SOURCE/files.tar.gz" "RESTORE_DIR/" --quiet
# Restore database
gunzip -f "$RESTORE_DIR/db-dump.sql.gz"
mysql -u restore_user -p'USE_ENV_VAR_IN_REAL_SETUP' -e "DROP DATABASE IF EXISTS DB_NAME; CREATE DATABASEDB_NAME;"
mysql -u restore_user -p'USE_ENV_VAR_IN_REAL_SETUP' "DB_NAME" < "RESTORE_DIR/db-dump.sql"
# Restore files
tar -xzf "RESTORE_DIR/files.tar.gz" -C "RESTORE_DIR/docroot"
# Basic health check: verify key table exists and has rows
ROW_COUNT=(mysql -u restore_user -p'USE_ENV_VAR_IN_REAL_SETUP' -N -e "SELECT COUNT(*) FROMDB_NAME.users;" 2>/dev/null || echo '0')
if [ "$ROW_COUNT" -gt 0 ]; then
echo "[(date)] PASS — database restored, users table hasROW_COUNT rows" >> "$LOG_FILE"
else
echo "[(date)] FAIL — database restore problem, users table empty or missing" >> "LOG_FILE"
fi
# Cleanup
rm -rf "$RESTORE_DIR"
echo "[(date)] Restore test complete" >> "LOG_FILE"mysql for pg_restore. If your backups are encrypted, add the decryption step. The point is not the specific commands — it is that the restore runs end-to-end and a health check confirms the data is actually there.
Step 3: Schedule it and alert on failure
BASH
# Run restore test on the 1st of each month at 04:00
0 4 1 * * /usr/local/bin/monthly-restore-test.shStep 4: Verify file integrity, not just existence
BASH
# Illustrative: compare SHA-256 of pulled file against recorded checksum
sha256sum "RESTORE_DIR/db-dump.sql.gz" | awk '{print1}'
# Compare this output against the checksum stored alongside the backup.sha256) next to each backup artifact when it creates them. The restore test reads that checksum and compares. Mismatch means corruption in transit or at rest.
For more on why a successful backup job does not guarantee a working restore, see Why a Successful Backup Job Does Not Guarantee a Working Database Restore.
What this looks like in practice
- Proof that your isolated copy exists and is reachable from a non-production context.
- Proof that the data inside is intact — not just a file on disk, but a database that loads and an application directory that extracts.
- Proof that your restore procedure works — the commands, credentials, and paths are correct. When you need to restore under pressure, you are running a script you have run dozens of times, not improvising.
- Early warning when something breaks — storage credentials rotate, bucket policies change, backup jobs silently fail. The monthly test catches these before they matter.
