πŸ”„ Detecting a Stale Backup Mirror Before Trusting It

I learned that a backup can be present, readable, and still be a security problem if nobody can prove that it is current. During the Hermes work I added a bounded check for the iCloud mirror: it verifies representative state and freshness without pretending that a single successful copy command proves recoverability.

🎯 Goal

The goal was to detect a mirror that had silently stopped receiving updates. The check had to avoid reading every private file, record enough evidence to explain the result, and alert when the last trustworthy receipt became too old.

πŸ›  What I Did

I added a staleness-alert script and tests around the existing backup helper. The check compares the expected receipt and representative files, records the observed state, and distinguishes a fresh mirror from one that is merely mounted. The implementation also reports the file name and operating-system error when hashing fails, instead of reducing every failure to β€œbackup failed.”

That distinction matters. A full disk, an evicted iCloud file, a permissions error, and an unavailable destination need different responses. The same non-zero exit code is not enough for an analyst to understand the incident.

πŸ”— Key Cybersecurity Connections

Backup verification is an integrity and availability control. It supports recovery from ransomware, accidental deletion, and operator error, but only if the evidence covers the actual recovery path. A stale mirror can create false confidence during an incident.

πŸ” Investigation Questions

  • When was the last successful receipt created?
  • Which representative state was checked?
  • Did hashing fail, and if so, on which file?
  • Was the destination present but stale, or actually unreachable?
  • Is the evidence recent enough for the recovery decision being made?

🚨 Detection Opportunities

A useful alert should include the age of the last trusted receipt, the destination, the failed phase, and the affected path. β€œBackup job green” is not a sufficient security signal when the mirror has not changed for days.

⚠ Challenges

The difficult part was setting a useful boundary. Reading the entire mirror every time would be expensive and would expose more data than the freshness check needs. Checking only that the directory exists would be too weak. The final design uses representative evidence and makes the remaining coverage explicit.

πŸ“š What I Learned

The question is not β€œdid the backup command exit zero?” It is β€œwhat recovery evidence do I have, how fresh is it, and what exactly was not checked?” That is the same evidence discipline I use when reviewing logs and security controls.

🧠 Reflection

Security monitoring is often about detecting false reassurance. A stale copy is dangerous precisely because it looks like a backup until the moment it is needed.