Skip to content

v0.6.3: Backfill data keys, and reads from them

·All releases ·GitHub release

Upgrading

Apply migration 0005, which adds one nullable column to environments, before deploying. An earlier release keeps working on the migrated database: the master-key rows stay complete.

Backfill data keys

With the wrapping key set, the Keys view has Backfill data keys. Each pass copies up to 50 existing secrets of PORTONA_ACCESS environments the environment ledger holds, under the environment’s own data key. A secret changed while the pass runs is never overwritten with the value read before the change; the next pass copies it. Run it until nothing remains.

  • Quarantined, never adopted: secrets of PORTONA_POLICIES bundles and of names no longer configured. Move the environment to PORTONA_ACCESS with an ID to copy them.
  • Refused: secrets of an environment whose ID disagrees with the ledger, and any the master keys can’t decrypt.

Once every secret of an environment is copied, its exchanges read the data-keyed copies. A copy is read only while it matches its master-key row’s version and IV, so a write by an earlier release, or a restore, falls back to the master-key row. So does an exchange whose wrapping key fails to load, or whose copy fails to decrypt. Admin writes still go to both.

The Keys view after a backfill: 5 of 8 secrets under data keys, reads switched for two environments, two bundles quarantined

Maintenance pauses the daily cron

With PORTONA_MAINTENANCE on, the daily cron now does nothing. Before, a cron run during a fresh-database recovery could replace the day’s backup with a copy of the empty database, and record the configured environments ahead of the ledger being restored. See Backups and recovery.