Ransomware protection for NAS is no longer an optional extra. A shared file server is the most attractive target on most office networks: one compromised laptop with a mapped drive can encrypt years of project files, accounts records or drawings in an hour, and the attacker then asks for payment to give them back.
Antivirus and firewalls reduce the chance of infection, but they do not guarantee it never happens. What decides whether you recover in hours or lose the data is the storage layer: whether you have point-in-time copies the attacker cannot change, a second copy somewhere else, and a recovery procedure your team has actually practised. This post covers all three.
How ransomware attacks a file share
Most ransomware does not break into the NAS itself. It runs on a client machine, or on a server, using the permissions of a logged-in user. Anything that user can write to over SMB or NFS, it can encrypt or delete. That has three practical consequences:
- Broad write permissions widen the blast radius. If every user can write to every share, one infected PC can damage everything. See our guide to access control on shared storage.
- Backups reachable as a normal share are not safe. A backup folder mapped as a drive letter gets encrypted along with the source.
- Administrator credentials are the real prize. Attackers who obtain storage admin credentials try to delete snapshots and backups before encrypting, so recovery is impossible.
Why snapshots are the first line of recovery
On a ZFS-based system such as Awanstor SDS, a snapshot is a read-only, point-in-time view of a dataset. Because ZFS is copy-on-write, new data is always written to new blocks; the snapshot simply keeps references to the old blocks. Taking a snapshot is near-instant and initially consumes almost no space. Space grows only as data changes.
When ransomware encrypts a file over SMB, it writes new, encrypted blocks. The old blocks referenced by yesterday's snapshot are untouched, and a client cannot modify them through the file share. Recovery is then a rollback of the dataset or a copy of files out of the snapshot.
A practical snapshot schedule
| Frequency | Keep | Purpose |
|---|---|---|
| Every hour (working hours) | 24–48 | Limit lost work to under an hour |
| Daily | 14–30 | Cover attacks discovered after a few days |
| Weekly | 8–12 | Cover slow, quiet encryption |
| Monthly | 6–12 | Long-tail recovery and audit |
Some ransomware encrypts slowly to avoid notice, so keep daily and weekly snapshots long enough to reach back past the likely detection delay. Watch the space: during an attack, the pool fills with both the encrypted copies and the snapshot-held originals. Leave headroom.
Protect the snapshots themselves
A snapshot is only as safe as the account that can delete it. Keep storage administration on a separate management network, use separate admin accounts that are never used for daily work or email, and restrict who can destroy snapshots. Ask your vendor whether the system supports holds or a delay before snapshot deletion takes effect, and whether alerts fire when snapshots are deleted in bulk.
Replication: a second copy on another system
Snapshots live on the same pool as the data. If the pool is lost to hardware failure, fire, or an attacker with admin access, the snapshots go with it. ZFS replication sends snapshots incrementally to a second system: after the first full copy, only changed blocks travel, which makes daily or hourly replication practical even over modest links.
- Place the replica in a different room, building or city.
- Use separate credentials on the target so a compromise of the primary does not grant access to the replica.
- Prefer a design where the target pulls from the source, or where the source has rights only to send, not to delete old snapshots on the target.
- Keep a longer retention on the replica than on the primary.
Replication is part of a wider 3-2-1 backup strategy; at least one copy should be offline or otherwise unreachable from the production network.
Detection: spotting an attack early
The faster you notice, the less you lose. Storage-side signals worth monitoring include:
- A sudden jump in snapshot space usage (many blocks changing at once).
- A collapse in compression ratio, because encrypted data does not compress.
- Mass file renames to unfamiliar extensions, or ransom notes appearing in many folders.
- Unusual write throughput from a single client outside working hours.
If you are covered by the CERT-In directions of April 2022, specified cyber incidents including ransomware must be reported within 6 hours of noticing, and logs must be available. Our post on CERT-In log retention and storage covers that side; check your obligations with your legal team.
The recovery runbook
Write the steps down before you need them:
- Isolate. Disconnect infected clients; disable the affected user accounts; consider making shares read-only.
- Preserve evidence. Keep logs and a snapshot of the encrypted state for investigation before rolling back.
- Find the last clean snapshot. Browse snapshots from newest to oldest until files open correctly.
- Restore. Roll back whole datasets if the damage is wide; copy individual folders out if it is narrow.
- Verify and reopen. Check a sample of files with their owners, then restore write access.
- Review. Fix the entry point, tighten permissions and adjust retention.
Rehearse this at least twice a year on a test dataset. Time it. The restore time you measure is your real recovery time objective, not the one on paper.
Common mistakes that defeat snapshot protection
Snapshot features are widely available, yet recoveries still fail. The causes are usually configuration and habit rather than technology:
- Snapshots on some shares only. A new share created for a project is often left out of the schedule. Apply schedules at a parent dataset level so new children inherit them, and review coverage quarterly.
- Retention too short. Keeping only seven daily snapshots means an attack noticed on day eight leaves nothing clean. Space is cheaper than lost data.
- Pool running near full. When free space runs low, administrators delete old snapshots to make room, sometimes the very ones needed. Plan capacity with snapshot growth included and alert at 80% fill.
- One administrator password for everything. If the same credentials open the hypervisor, the backup server and the NAS, an attacker who finds one has them all.
- No one watching replication. Replication jobs fail quietly when a link drops or credentials change. A replica that stopped updating three months ago is not a recovery point.
- Untested restores. Teams discover during the incident that rolling back a large dataset takes longer than expected, or that applications need restarting in a specific order.
What snapshots do not cover
Snapshots protect data on the NAS. They do not protect data stored only on laptops, databases that were not quiesced before the snapshot, or the configuration of the servers themselves. Databases should be backed up with their own tools to a share that is snapshotted, so the snapshot captures a consistent dump. Server configurations and virtual machines need their own backup routine.
Checklist: questions to ask your vendor
- Are snapshots read-only from SMB/NFS clients, and who can delete them?
- Can snapshot schedules and retention be set per share or dataset?
- Is incremental replication to a second system supported, and can the target keep longer retention?
- Can storage management be isolated on its own network interface? (Panaro JP, CL and LP series include IPMI remote management on a dedicated port.)
- What alerts are available for capacity jumps, mass deletion and failed replication?
- How long does a full dataset rollback take at our data size?
- Will your engineers help us test a restore during commissioning?
Awanstor NAS systems run ZFS-based Awanstor SDS with snapshots, compression and deduplication; see the Awanstor NAS range for platforms. If you want a snapshot and replication design sized to your data, send your requirement and our engineers will propose a layout.
Frequently asked questions
Do NAS snapshots protect against ransomware?
Yes, if they are read-only to clients and the attacker cannot reach the admin account. Ransomware running on a PC writes new encrypted blocks; on a copy-on-write file system such as ZFS, the older blocks held by a snapshot stay intact, so you can roll back. Snapshots do not help if the whole pool is lost, so pair them with replication.
How long should I keep snapshots for ransomware recovery?
Long enough to reach past the time it might take you to notice an attack. A common pattern is hourly snapshots kept for a day or two, dailies for two to four weeks, weeklies for two to three months and monthlies for six to twelve months. Adjust to how fast your data changes and how much free space the pool has.
Is replication the same as a backup?
Replication copies snapshots to a second system, which protects against loss of the primary. It becomes a proper backup when the replica has independent credentials, longer retention and cannot be altered from the primary. Keep at least one further copy offline or offsite to follow the 3-2-1 rule.
Should I pay the ransom if I have snapshots?
If clean snapshots exist, restoring from them is normally faster and more certain than paying, and paying does not guarantee a working decryptor. Decisions on payment, reporting and investigation involve legal and management considerations, so follow your incident policy and consult your legal team.