Skip to content
Back to Blog
Security10 min read

Ransomware Backup Strategy: 6 Rules to Survive 2026

Air-gapped snapshots and immutable storage won't help if you never test restores. These six rules guarantee recovery when encryption spreads through your infrastructure.

Written by Abdul AbrorTechnical Hosting Support Engineer
Ransomware Backup Strategy: 6 Rules to Survive 2026
On this page

Every backup strategy looks good until ransomware spreads to your backup repository and encrypts everything—live data, snapshots, the lot. I've seen hosting providers lose client sites because their "backup system" was just another mounted volume the malware could reach. A real ransomware backup strategy assumes breach and treats recovery as the only metric that matters.

The six rules below focus on one goal: guaranteeing you can restore when encryption spreads beyond the initial infection point. Air gaps, immutability, and automated restore tests aren't optional extras anymore.

Rule 1: Enforce a True Air Gap

An air-gapped backup sits on media or in a location that has zero network path back to your live environment. Not a separate VLAN. Not a different subnet. Actually disconnected.

For most hosting setups that means:

  • Removable drives rotated offsite. External USB or eSATA drives that you physically disconnect after each backup run.
  • Tape libraries with offline cartridges. LTO tape is still the gold standard for long-term air-gapped storage.
  • Cloud storage with API credentials destroyed after upload. Write backups to S3 or Backblaze B2 using temporary credentials, then revoke the keys. The bucket remains reachable only through a separate break-glass account.

What doesn't count: a second server on the same network, even if it has firewall rules. Ransomware that compromises your hypervisor or gains root will scan for SSH keys, mounted NFS shares, and iSCSI targets. If the backup destination is reachable through any credential or network route from the infected host, assume it will be encrypted too.

In client environments I supported, attackers consistently targeted backup repositories within 12–24 hours of initial access. Speed matters less than isolation.

Rule 2: Use Immutable Storage for Recent Snapshots

Air gaps are perfect for weekly or monthly snapshots, but daily or hourly backups need to stay online for fast recovery. That's where immutability comes in.

Immutable storage prevents any modification or deletion of written objects for a defined retention period. Even if an attacker gains your storage admin credentials, they can't alter or remove protected snapshots until the retention lock expires.

Implementation options:

  • S3 Object Lock in compliance mode. Set a retention period (30 days is common) and enable compliance mode, which prevents even the root account from deleting or shortening retention.

bash aws s3api put-object-lock-configuration --bucket my-backup-bucket \ --object-lock-configuration '{ "ObjectLockEnabled": "Enabled", "Rule": { "DefaultRetention": { "Mode": "COMPLIANCE", "Days": 30 } } }'

  • Linux filesystem snapshots with append-only flag. Btrfs or ZFS snapshots can be marked read-only, and the parent dataset set to append-only via chattr +a on ext4 or immutable flags on ZFS.

  • Dedicated backup appliances. Solutions like Veeam hardened repositories or Rubrik appliances enforce retention policies at the firmware level, outside the reach of OS-level compromise.

The retention period should exceed your longest realistic incident-detection window. If you discover ransomware a week after the initial breach, a 7-day retention lock won't help—the oldest clean snapshot is already gone. Thirty days is a reasonable minimum.

Rule 3: Follow the 3-2-1 Rule with a 2026 Twist

The classic 3-2-1 rule says keep three copies of data, on two different media types, with one copy offsite. Still true. But add this: at least one copy must be offline and one must be immutable.

So a modern ransomware-resistant layout looks like:

  1. Primary data on your production server (cPanel, Plesk, or direct VPS storage).
  2. Daily immutable snapshots in S3 or equivalent cloud object storage with compliance-mode retention.
  3. Weekly air-gapped snapshots on rotated external drives stored offsite, or in a separate cloud account with revoked API access.

This gives you fast restores from immutable snapshots for recent incidents, and a guaranteed-clean copy if the immutable window wasn't long enough. I've restored client sites from 3-week-old air-gapped backups after ransomware sat dormant for two weeks before triggering.

Rule 4: Automate Restore Testing Monthly

Your backups don't exist until you've proven you can restore from them. I mean actually spinning up a test instance and validating that the data is intact and the application starts.

Manual restore tests get skipped. Automate them.

A basic monthly restore test workflow:

  1. Provision a throwaway VPS or local VM.
  2. Pull the latest backup snapshot.
  3. Restore databases and files.
  4. Run application health checks (database connectivity, file permissions, service startup).
  5. Log results and alert on failure.

For a WordPress site, that might look like:

#!/bin/bash
# Monthly automated WordPress restore test

BACKUP_PATH="/mnt/backups/latest-snapshot.tar.gz"
TEST_DIR="/tmp/restore-test-$(date +%s)"

mkdir -p "$TEST_DIR"
tar -xzf "$BACKUP_PATH" -C "$TEST_DIR"

# Restore database to test instance
mysql -h testdb.local -u testuser -p"$TEST_PASS" test_wp < "$TEST_DIR/database.sql"

# Check WordPress can load
cd "$TEST_DIR/public_html"
php -r "define('WP_USE_THEMES', false); require 'wp-blog-header.php'; echo 'OK';"

if [ $? -eq 0 ]; then
  echo "Restore test PASSED"
else
  echo "Restore test FAILED" | mail -s "Backup restore failure" [email protected]
fi

rm -rf "$TEST_DIR"

Run this via cron on the first of each month. If the test fails, you find out while you still have time to fix the backup process—not during an actual ransomware incident.

Rule 5: Separate Backup Credentials from Production

Ransomware that compromises a web server will scan for database credentials, SSH keys, cloud API tokens, and anything else that grants access to other systems. If your backup script runs with credentials stored in /root/.aws/credentials or a cPanel API token in a readable file, the attacker inherits those permissions.

Segment backup access:

  • Use a dedicated service account for backups. Grant it read-only access to production data and write-only access to backup destinations. On AWS that means an IAM role with s3:PutObject but not s3:DeleteObject or s3:GetObject on the backup bucket.

  • Store credentials outside the compromised system. Use a secrets manager (AWS Secrets Manager, HashiCorp Vault, or even a separate jump box) and fetch credentials at backup time via a short-lived token.

  • Rotate credentials regularly. Even if an attacker intercepts a backup token, it should expire within hours or days, not persist indefinitely.

In hosting environments where clients manage their own backups, enforce these separations at the infrastructure level. A compromised cPanel account shouldn't be able to delete its own offsite backups.

Rule 6: Version Your Backups and Keep 30+ Restore Points

Ransomware doesn't always announce itself immediately. Some variants encrypt a few files per day to avoid triggering monitoring alerts, or sit dormant for weeks. If you only keep the last seven daily backups, you might discover that all seven snapshots contain partially encrypted data—and your last clean backup is gone.

Keep at least 30 daily restore points, plus weekly and monthly snapshots going back a quarter or a year depending on your risk tolerance. Yes, storage costs go up. But the cost of losing everything is higher.

For snapshot retention I usually configure:

  • Daily backups kept for 30 days
  • Weekly backups kept for 12 weeks
  • Monthly backups kept for 12 months

This gives you 30 recent restore points for fast rollback, and long-term snapshots in case the infection started months ago. Adjust based on your change frequency and compliance requirements.

Manage retention automatically with backup tooling or lifecycle policies. For S3, a lifecycle rule can transition old snapshots to Glacier and eventually delete them:

<LifecycleConfiguration>
  <Rule>
    <Status>Enabled</Status>
    <Filter>
      <Prefix>daily/</Prefix>
    </Filter>
    <Expiration>
      <Days>30</Days>
    </Expiration>
  </Rule>
  <Rule>
    <Status>Enabled</Status>
    <Filter>
      <Prefix>weekly/</Prefix>
    </Filter>
    <Transition>
      <Days>30</Days>
      <StorageClass>GLACIER</StorageClass>
    </Transition>
    <Expiration>
      <Days>84</Days>
    </Expiration>
  </Rule>
</LifecycleConfiguration>

What About Application-Consistent Snapshots?

Filesystem-level backups are fast and simple, but databases and applications with in-memory state need coordination to ensure consistency. If you snapshot a MySQL data directory mid-transaction, you might restore to a corrupted state.

For databases, use native dump tools before snapshotting:

  • MySQL/MariaDB: mysqldump --single-transaction --routines --triggers
  • PostgreSQL: pg_dump or pg_basebackup
  • MongoDB: mongodump with --oplog for point-in-time consistency

For application state, either quiesce the app (stop writes briefly), use application-aware snapshot tools (like Veeam for VMs), or rely on filesystem snapshots with crash-consistent recovery (acceptable for many stateless apps).

In a hosting environment, taking MySQL dumps before each backup run adds minimal time and guarantees the database can be restored cleanly.

Monitoring and Alerting for Backup Failures

Backups fail silently all the time. Disk full. Network timeout. Credential expiration. You won't know until you need them.

Monitor these metrics:

  • Backup job completion status. Alert if a daily backup hasn't completed successfully in 36 hours.
  • Backup size and file count. Alert on sudden drops (possible incomplete backup) or spikes (possible malware copying itself into backed-up directories).
  • Restore test results. As mentioned earlier, automate monthly restore tests and alert on failure.
  • Storage utilization. Alert before backup repositories run out of space, which will cause silent failures.

For a simple shell-based backup, append a status check that pings a monitoring service:

# At the end of your backup script
if [ $BACKUP_SUCCESS -eq 0 ]; then
  curl -fsS --retry 3 https://hc-ping.com/your-uuid-here
fi

Services like Healthchecks.io or UptimeRobot can alert you when the ping stops arriving, meaning the backup job failed or didn't run.

FAQ

Q: Can I use RAID as a backup strategy?
No. RAID protects against hardware failure, not ransomware, accidental deletion, or corruption. You still need offsite and air-gapped copies.

Q: How long should I keep backups?
At least 30 days of daily snapshots, plus quarterly or annual archives if you have compliance requirements. Longer retention increases the chance you have a clean restore point.

Q: What if ransomware encrypts my backup scripts?
Store backup scripts outside the web root and make them executable only by root. Better yet, run backups from a separate management server or via a cron job on a jump box the web server can't reach.

Q: Do I need to encrypt backups?
Yes, especially if they're stored offsite or in cloud object storage. Encrypt before upload using GPG, OpenSSL, or built-in encryption (like S3 SSE-C). Just make sure you store decryption keys separately from the backups themselves.

Q: Can I rely on cPanel's built-in backup system?
As one layer, yes. But cPanel backups are often stored on the same server or a mounted remote directory the compromised server can reach. Supplement with offsite immutable or air-gapped copies.

Start with Immutable Storage and Restore Tests

You don't need to implement all six rules on day one. Start with two: enable immutable retention on your existing cloud backups, and schedule a monthly automated restore test. Those two changes will catch 80% of ransomware backup failures.

Once those are running reliably, add an air-gapped copy and credential segmentation. A ransomware backup strategy isn't a one-time project—it's a layered system you improve as threats evolve.