model-writtenrun 7878 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Dec 2020 - Jan 2021 ยท 22 entries
- Bruce Momjian opened the thread with an adaptation of Masahiko Sawada's key manager, narrowing it to cluster-file encryption, removing SQL-level key management, and proposing external key retrieval plus terminal prompting as foundations for later data encryption #1.
- Adapting to the new cryptohash API exposed a FreeBSD bootstrap failure reported by Masahiko Sawada; Bruce posted an initialization fix, and Michael Paquier's review led to explicitly initializing the resource-owner pointer instead of using explicit_bzero for initialization #2 #4 #6 #7 #8.
- Sawada's follow-up prompted additional key cleanup and support for single-user prompting through a duplicated standard-error descriptor #9 #11 #12.
- Daniel Gustafsson reviewed documentation, permissions, unused declarations, and crypto-library coupling; Bruce applied numerous corrections while retaining the normal cluster file-permission policy #13 #17.
- Bruce moved upgrade key copying into initdb so newly created system catalogs could use the old cluster's keys, added prompting to pg_upgrade, and introduced a command-line utility for changing the wrapping key #15.
- Bruce demonstrated Yubikey-backed key retrieval with and without interactive PIN entry, adding a directory placeholder so scripts could keep encrypted supporting material beside the wrapped keys #20 #21.
- Michael Paquier objected to committing the current implementation, citing missing Windows integration, insufficiently separated crypto APIs, frontend/backend dependencies, and testing needs; Bruce's next cumulative attachment addressed several of those issues #23 #25.
- Neil Chen supplied experimental page and WAL encryption that exposed unusable wrapped keys during bootstrap and inconsistent key-length units; Bruce responded with a bootstrap delta that also handled keys copied from an older cluster #24 #29.
- Bruce separated the generic cipher interface from its OpenSSL implementation, then split HMAC into separate files and packaged the key manager and rotation utility as distinct attachments #32 #55.
- Alastair Turner argued that enterprise HSM integration should permit externally managed data keys, while Bruce favored an internal keyring for validation, rotation, and simpler administration and demonstrated an AWS Secrets Manager integration using the existing interface #34 #39 #40.
- Stephen Frost distinguished passphrases from supplied encryption keys and proposed moving derivation outside PostgreSQL; Bruce implemented a fixed hexadecimal-key contract and shared frontend/backend hex decoding #46 #63 #64.
- The next full submission completed the cluster_key_command and pg_alterckey naming, while Bruce and Stephen deferred direct external management of the data keys rather than expanding the initial implementation #70 #72 #75 #77.
- Bruce packaged the sample authentication commands for installation and revised their source and installation directory to auth_commands; Alastair then challenged the scripts' simple passphrase hashing and the key-wrapping construction #80 #81 #82.
- Bruce also posted a separate extension allowing ssl_passphrase_command to use the terminal descriptor supplied by the key-management infrastructure #85.
- The key-manager component of the last full submission became 978f869b99 on December 25, with substantial changes from #75: GCM replaced CBC/HMAC, the stored-key structure gained identifiers, counters, and authentication tags, and the cipher interface changed accordingly.
- The rotation-utility component became 62afb42a7f on December 26 UTC, retaining the utility from #75 while adapting hexadecimal decoding and cipher-context handling to the new GCM implementation.
- Neither supplied commit includes Neil's actual page/WAL encryption prototype, the authentication-script package, or the SSL prompting extension, leaving those contributions outside these two landings #24 #81 #85 978f869b99 62afb42a7f.
- After the commits, Fabien COELHO argued for a generic external key-management API that would avoid hardwiring the cryptographic design, while Bruce and Stephen defended the internal implementation and the possibility of adding external alternatives later #87 #88 #89 #91.
- The discussion sharpened the threat model: Bruce and Stephen agreed that neither proposed arrangement protects against an online compromise of the PostgreSQL operating-system account, while defending wrapping-key rotation as an administrative capability #97 #98.
- Alastair explored a library-managed PKCS#12 keystore, but found that OpenSSL's support for arbitrary secret bags required substantial additional code; Bruce reported that Stephen had considered the format and found insufficient benefit for the added complexity #102 #107.
- Fabien continued to question key scope, rotation, and API flexibility, and Bruce said further progress was blocked by unresolved implementation objections, leaving the broader encryption effort stalled despite the two recorded commits #103 #105.
- The thread ended with Alastair still advocating library-managed wrapping and clarifying that GCM authenticates the wrapped keys but does not establish that those keys match the database files after an independent copy or restore #109 #110.