Skip to content

v0.6.0: A wrapping key and per-environment data keys

·All releases ·GitHub release

Upgrading

Apply the new migration to each deployment’s D1 before deploying 0.6.0, as for earlier releases (see Deploying your own). It only adds tables, so 0.5 keeps working on the migrated database and you can roll back without undoing it.

Nothing else is required: without the new PORTONA_WRAPPING_KEY, 0.6 works exactly as 0.5.

The wrapping key

portona-keys init creates a deployment’s wrapping key from its deployment repository. It generates the key in memory, saves it to 1Password, reads it back, and only then sets the Worker secret. It prints only the key’s id and refuses to replace a wrapping key the Worker already has. See Wrapping key.

The admin page’s Keys view (formerly Master key) shows the wrapping key’s id, and on phones its master-key table and re-encrypt button now fit the card.

The Keys view with the master keys in use and the wrapping key’s id

On a phone, the master-key table and the wrapping key card fit the screen

Per-environment data keys

With the wrapping key set, every admin change to a PORTONA_ACCESS environment also stores the value under that environment’s own data key, in the same transaction. The data key is wrapped so that it opens only for its own deployment, environment and version, and it’s created only for an environment the ledger holds live.

Exchanges still read the master-key rows, which stay complete, so an earlier release can be redeployed at any time. A later release copies existing secrets over and then moves reads across. Backups don’t include the data-keyed copies yet; they hold nothing the master-key rows don’t.