Backup Policy
| Category | Security |
|---|---|
| Version | 1.0 |
| Status | Approved |
| Approved | 2026-03-25 by Mishkin Berteig |
| Next Review | 2027-03-25 |
| ID | POL-4 |
| Document version | policies/backup.md at commit 9c72db400a23 (SHA-256 cbfa22d88149) |
Linked Controls
- PDP-4 Backup Retention
- PDP-3 Backup Storage
- PDP-1 Backup Plan
- PDP-2 Restore Testing
Backup Policy
Purpose
This policy establishes backup requirements for all MaxGood.work production data stores, ensuring data can be recovered following accidental deletion, corruption, or disaster.
Scope
All production data stores including databases, file storage, and configuration data.
Backup Plan
All production data stores must have automated backups enabled:
| System | Backup Method | Frequency | Retention |
|---|---|---|---|
| RDS PostgreSQL | AWS automated snapshots + point-in-time recovery | Continuous (transaction log) + daily snapshot | 30 days |
| RDS PostgreSQL (pre-migrate) | Manual snapshot taken by the MaxGoodApp pipeline's ProdMigrate stage |
Every production migration: taken before its first change, complete before the release is deployed | 7 days |
| S3 | Versioning on the production data and media buckets; no cross-region replication | Continuous (every object change) | Indefinite (versioned) |
| ElastiCache Redis | No automated snapshots (data is ephemeral cache/session data) | N/A | N/A |
| CodeCommit | Distributed git (inherent) | Every push | Indefinite |
| Decision logs | Git commits to MGDataAndEvidence | Per session | Indefinite |
Easypanel host: AFFiNE volumes (storage, config) |
Easypanel volume backups to /var/lib/easypanel/backups/ on the instance's disk |
Daily at 02:00 and before every update | Kept on the instance's disk |
| Easypanel host: AFFiNE Postgres database | Easypanel database backup to /var/lib/easypanel/backups/ |
On demand before every update | Latest 3 (Easypanel retention setting) |
| Easypanel host: n8n data | Easypanel volume backup to /var/lib/easypanel/backups/ |
Daily at 02:00 and before every update | Kept on the instance's disk |
| Easypanel host: Apache Tika | None (stateless) | N/A | N/A |
Backup Retention
- Minimum retention: 30 days for all production databases
- Extended retention: Compliance evidence and decision logs are retained indefinitely
- S3 versioning: Object versions retained indefinitely; lifecycle policies may transition old versions to cheaper storage tiers (S3 Glacier) but must not delete within 30 days
- Owner-initiated deletion: When a content owner deletes content (a title and its uploaded original documents), the platform permanently deletes those originals from S3, every version and delete marker included on a versioned bucket; owner-initiated deletion is outside the backup retention and lifecycle rules above.
- Erasure and restores: an erased person's personal data remains in database backups until they expire: automated backups after 30 days, pre-migrate snapshots after 7 days, and a snapshot copied to
mg-prod-postgres-keep-<reason>when that copy is deleted. After any restore of the database from a backup or point-in-time recovery, the erasures are re-applied by runningflask erasure-reapplyin the MaxGoodAI container (idempotent, driven by theuser_erasuresregister), and file deletions still owed are retried withflask erasure-retry-cleanup. A restore is not complete untilflask erasure-reapplyhas run. - Erased files: an erasure deletes the person's uploaded originals from the primary S3 bucket, every version and delete marker. Copies of those files held outside the primary bucket, including any replica bucket and any restored backup, are not removed by the deletion and are subject to their own retention.
- Staging storage: The six staging buckets
mg-<owner>-<tier>-staginghold seed data only; the staging data loader empties them and reloads the seed objects at every staging start, so they are not a production data store and are outside this backup plan. - Backup snapshots: Automatically expire per the retention schedule above
- Pre-migrate snapshots: The
mg-pre-migrate-snapshot-expiryLambda runs daily and deletes everymg-prod-postgres-pre-migrate-*snapshot more than 7 days old; a pre-migrate snapshot that must be kept longer is copied tomg-prod-postgres-keep-<reason>before it expires
Backup Storage
Storage Location
- RDS backups are stored in the same region (ca-central-1) as the source database
- S3 versioned objects are stored in the same region as the source bucket
- CodeCommit repositories have local git clones on developer machines providing natural geographic distribution
- Cross-region replication is not enabled on any bucket (a recorded risk in the risk register); geographic redundancy is provided by the distributed nature of git repositories and AWS's intra-region durability guarantees
Encryption
All backups are encrypted:
- RDS snapshots: encrypted with AWS KMS (inherits source database encryption)
- S3 versions: encrypted with SSE-S3 or SSE-KMS (inherits bucket encryption policy)
- EBS snapshots: encrypted with AWS KMS
- ElastiCache snapshots: encrypted at rest
Access Control
- Backup access is restricted to the Security Officer and authorized DevOps personnel (who have administrative access)
Restore Testing
Annually
- RDS restore test: Perform point-in-time recovery to a test instance; verify data integrity and application connectivity
- S3 version restore: Restore a deleted or overwritten object from version history; verify content integrity
- Document results: Record actual restore time, any issues encountered, and comparison to RTO/RPO targets
After Major Changes
- Test restore procedures after database schema changes, new storage configurations, or infrastructure modifications
Test Criteria
A restore test passes when:
- The backup restores without errors
- Data integrity is verified (application can read and operate on restored data)
- Restore completes within the defined RTO for that system
- No data loss beyond the defined RPO for that system