Architecture / Decision records / ADR-HIS-107
ADR-HIS-107 Backup and recovery: a service that records and enforces, tooling that executes, an immutable store only the recovery zone can write, and the restoration gate and duplicate checks in the unit¶
| Status | Accepted |
| Decided | 2026-11-30 by session RC-3-S17 |
| Record | Drafted 2026-11-30; approved 2026-11-30 by the Enterprise Architecture Board |
| Where the rule lives | platform/backup-recovery/ (mod-ise-009/, V1__recovery.sql; bin/backup-recovery and backup_recovery/; observability/backup-recovery.rules.yaml; README.md) |
Context¶
RC-3-S17 builds MOD-ISE-009: - FR-ISE-BCR-001, encrypted and immutable backups and restore testing; - FR-ISE-BCR-002, disaster recovery to the approved RTO and RPO; - FR-ISE-BCR-003, degraded operation, downtime enablement and restoration reconciliation.
The folder held only its README. The contracts of RC-3-S03 (ADR-HIS-085) fix what the unit offers:
- contracts/ise recovery.v1, 31 operations;
- five events: BackupCompleted, RestoreTestCompleted, FailoverCompleted, DowntimeDeclared and DowntimeEnded.
Their convention is "recording, not executing": backups, restores and failovers run in the platform's tools, and the API records their results and the human decisions.
The contract point of contracts/ise/README.md (row RC-3-S17) also asks for real backups of the data stores of his-env. The immutable copy must be one no production credential can delete. A deletion attempt must reach security monitoring, and restores must go into an isolated environment.
Technology stack row 17 names pgBackRest for PostgreSQL, Velero for cluster state, and immutable copies on object-lock storage at the DR site; row 25 names RustFS with object lock.
The integration environment of FN-S02 runs one PostgreSQL without WAL archiving and no object store, and this card may change neither (platform/dev-environment is FN-S02's).
Options considered¶
- A service from the template that records and enforces, beside a small tool that executes in the session's environment (chosen).
- pgBackRest against
his-env's PostgreSQL. It needsarchive_commandand a repository configured on the database server, which the card cannot change. A backup without WAL archiving does not restore consistently. - Only the service, with backups simulated in its tests. TEST-ISE-032 asks for a restore from backup, a deletion attempt with production credentials and a restore with recovery-zone access only. None of these would have been shown.
Decision¶
- The unit is
ise-backup-recovery, made from the service template with module MOD-ISE-009 (care.cema.his.ise.mod009, schemamod_ise_009). Each record is a JSON document with the columns it is queried and locked by, as in ADR-HIS-099. - The tooling of a development environment is
bin/backup-recovery: Python standard library and Docker, with nothing of its own installed. pgBackRest and Velero stay the production design of row 17; the deployment session that installs them calls the same API. - The backup is a logical one: pg_dump in the environment's own PostgreSQL image, piped into
openssl cms -encryptwith AES-256. - It is encrypted to the recovery zone's certificate, so production can encrypt but never decrypt. The decryption key is kept in the recovery zone, recoverable without production (FR-ISE-BCR-001 part 2).
- The backup is checksummed, verified by reading it back, and recorded with a manifest of row counts, row hashes and foreign keys. The restore checks against the manifest:
record-count,referential, andledger-chainfor every row. - The inventory of data stores and their tiers is the unit's. It holds the database of every unit of CLAUDE.md section 2 and of the platform units with a database, plus the configuration repository and the secret store.
- Each store has the tier architecture 5.2 gives its unit, or Tier 1 where it gives none: the strictest.
- The audit store and the financial ledger are marked as ledgers, whose restore needs a
ledger-chaincheck (AC-04). - Policies are made at start from the tier's defaults (CFG-ISE-015, CFG-ISE-016). A policy change cannot change the tier: the tier is the service's, not the policy's.
- Two stores, two credentials. The primary store takes the backups with the production backup credential. The immutable store is in the recovery zone, with object lock in compliance mode; it is written only by the recovery zone's copy job, with a credential production never holds (WF-ISE-004 step 2).
- The copy is retained the policy's daily retention, and the location recorded names its locked version.
- A deletion with the production credential is refused by the store: its key is unknown there. A deletion with the recovery zone's own credential is refused by the compliance retention.
- A delete without a version only adds a delete marker in front of the locked version. The tooling reads by version, and removes the marker again.
- Restores read with recovery-zone credentials only, into a database on an
--internalnetwork with nothing of production on it. - In development both stores are RustFS containers, pinned by digest.
- A deletion attempt reaches security monitoring as a security event, not as SecurityAlertRaised.
- SecurityAlertRaised is platform/observability's event, and version 1.1 has no category
immutable-copy-deletion. - The tooling sends a
his-security-eventrecord (SecurityEventRecord.v1) over IF-ISE-006, with detail categoryimmutable-copy-deletionand the data store as asset. observability's rule set then raises the alert of that category of security-monitoring.v1. - The rule is observability's to add (follow-up).
- Replication lag is the age of the recovery point. Without replicas,
readReplicationStatusandreadBackupStatusreport the time since the latest verified recovery point: the end of a log segment, or a backup's completion. That is the data a loss now would take. A Tier 1 store with only its daily backup is therefore at risk, as CFG-ISE-015 intends. A replica's lag joins this when replication is deployed. - "Queues draining" is read from the integration engine at confirmation.
listInterfaceHealthof integration.v1 is read when restoration is confirmed: no in-service interface may hold queued messages it cannot deliver, that is, with its circuit open or its partner unavailable. An engine that cannot be read is 503: restoration is not confirmed without it (BR-ISE-024). - The unit enforces the rules that protect against harm, beside the policy decision point.
- Failover: the same person as the Incident Commander, or a service, is refused as second authorizer; a result before both authorizations is 403; a result whose integrity or access failed is Failed.
- Automatic failover: only the services configured as designed for it (
his.backup-recovery.automatic-failover.services, none by default) may be recorded as automatic; the request alone cannot claim it. An automatic failover still without its second authorization afterconfirmation-within(1 hour by default, the Tier 1 RTO) is alerted. The list belongs with the deployment, which knows which services fail over by themselves. - Downtime: confirmation of restoration without a passed validation is 400; closure with unresolved items no domain accepted is 400; an entry matching one checked before by idempotency key (domain) or form number (facility) is answered duplicate.
- Restore tests: the RTO and RPO targets are CFG-ISE-017's whatever the caller sends, and the test passes only when every owning team's validation passed.
Who may do each thing is the policy decision point's, on the actions and attributes of README.md. Clinical staff read a summary only once its unit is released (attribute released).
9. A downtime window carries version, and its reads and transitions an ETag, for the If-Match of transitionDowntime. The contract's schema leaves extra fields open, the RC-3 scenario reads version, and the compatibility check is unaffected.
10. Audit types.
- The declaration and the release of summaries are ise.downtime.declared.
- Restoration validation, transitions, reconciliation reports, entry checks and exercise results are ise.downtime.ended: D02-ISE 9.5 names that type for "restoration confirmed, reconciliation period opened and closed".
- Summary submission is not audited: it is not an access to the content.
Rationale¶
- The API records and the tooling executes, as ADR-HIS-085 fixed. So production's pgBackRest and Velero and this tooling are interchangeable behind recovery.v1. Everything that decides is in the unit, and is tested there without Docker: two persons, the restoration gate, duplicate checks, objectives and closure.
- Encrypting to a certificate keeps the key out of production. That is the strongest reading of "keys recoverable without the production environment". It needs only the openssl already in the PostgreSQL image.
- Two stores make "credentials that do not exist in production" literal. Object lock in compliance mode then holds even against the recovery zone's own administrator.
- The strictest tier where none is given, and an RPO measured from the recovery point, err towards an alert rather than a silent gap: the hazard of D02-ISE 11.1 is data missing after recovery without anyone knowing.
Risks and review¶
- A logical backup has no point-in-time recovery. A Tier 1 store's policy still says continuous archiving, which the development environment does not provide, so its status there shows the RPO at risk unless log segments are recorded. Production needs pgBackRest (deployment follow-up).
- The manifest is taken after the dump, not in the dump's snapshot. On a database written to during the backup, record-count can differ and fail the restore test, which errs to the safe side.
- The Wazuh rule for
immutable-copy-deletionand the import of the alert rules are observability's. Until they are added, attempts are in the security event log and the store's refusal, not on the security console. - Review when pgBackRest is deployed, when the integration engine (RC-3-S15, S16) serves queue depth, and when D02-ISE 9.5 or the service catalogue give the types or tiers assumed here. Review date 2027-05-31.