Keys and WAL encryption
Where the keys live
Relation keys are stored wrapped in the data directory. A database principal key from its provider unwraps them. The provider can be database-scoped or global. In the file example the provider lives outside the data directory. For a deployment, choose a supported KMS such as Vault or KMIP and test its reachability and authentication from every intended recovery host. Record provider identity, key names and versions. Keep credentials, certificates and file keyrings recoverable independently of the database host. Percona key management
Encrypt the WAL stream
WAL encryption applies to all databases, including ordinary heap tables. Establish the restore procedure on every backup and standby host before enabling it. On the test cluster, with the key directory from the previous page, configure a dedicated server principal key:
Restart the server and run SHOW pg_tde.wal_encrypt. Expect on. Earlier WAL and backups retain their original requirements. Turning the switch off leaves historical encrypted segments in the recovery chain. For continuous archiving use Percona’s pg_tde_archive_decrypt and pg_tde_restore_encrypt as documented for the chosen archive system. Protect the decrypted archive independently.
Rotation
Schedule rotation outside all backup jobs. Retain every principal/server key version needed from the oldest retained backup through its recovery targets. After rotation, take a fresh full backup and restore it on another host. A new key with the old name cannot decrypt data wrapped with the lost key. Backup and recovery