Add key management system
authorBruce Momjian <bruce@momjian.us>
Fri, 25 Dec 2020 15:19:44 +0000 (10:19 -0500)
committerBruce Momjian <bruce@momjian.us>
Fri, 25 Dec 2020 15:19:44 +0000 (10:19 -0500)
commit978f869b992f9fca343e99d6fdb71073c76e869a
treeb8020240551aa16da5b4fc9fbf96710de2d667e4
parent5c31afc49d0b62b357218b6f8b01782509ef8acd
Add key management system

This adds a key management system that stores (currently) two data
encryption keys of length 128, 192, or 256 bits.  The data keys are
AES256 encrypted using a key encryption key, and validated via GCM
cipher mode.  A command to obtain the key encryption key must be
specified at initdb time, and will be run at every database server
start.  New parameters allow a file descriptor open to the terminal to
be passed.  pg_upgrade support has also been added.

Discussion: https://postgr.es/m/CA+fd4k7q5o6Nc_AaX6BcYM9yqTbC6_pnH-6nSD=54Zp6NBQTCQ@mail.gmail.com
Discussion: https://postgr.es/m/20201202213814.GG20285@momjian.us

Author: Masahiko Sawada, me, Stephen Frost
49 files changed:
doc/src/sgml/config.sgml
doc/src/sgml/database-encryption.sgml [new file with mode: 0644]
doc/src/sgml/filelist.sgml
doc/src/sgml/installation.sgml
doc/src/sgml/postgres.sgml
doc/src/sgml/ref/initdb.sgml
doc/src/sgml/ref/pg_ctl-ref.sgml
doc/src/sgml/ref/pgupgrade.sgml
doc/src/sgml/ref/postgres-ref.sgml
doc/src/sgml/storage.sgml
src/backend/Makefile
src/backend/access/transam/xlog.c
src/backend/bootstrap/bootstrap.c
src/backend/crypto/Makefile [new file with mode: 0644]
src/backend/crypto/kmgr.c [new file with mode: 0644]
src/backend/main/main.c
src/backend/postmaster/pgstat.c
src/backend/postmaster/postmaster.c
src/backend/replication/basebackup.c
src/backend/storage/ipc/ipci.c
src/backend/storage/lmgr/lwlocknames.txt
src/backend/tcop/postgres.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/pg_controldata.c
src/backend/utils/misc/postgresql.conf.sample
src/bin/initdb/initdb.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_resetwal/pg_resetwal.c
src/bin/pg_rewind/filemap.c
src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/controldata.c
src/bin/pg_upgrade/file.c
src/bin/pg_upgrade/option.c
src/bin/pg_upgrade/pg_upgrade.h
src/bin/pg_upgrade/server.c
src/common/Makefile
src/common/cipher.c [new file with mode: 0644]
src/common/cipher_openssl.c [new file with mode: 0644]
src/common/kmgr_utils.c [new file with mode: 0644]
src/include/catalog/pg_control.h
src/include/common/cipher.h [new file with mode: 0644]
src/include/common/kmgr_utils.h [new file with mode: 0644]
src/include/crypto/kmgr.h [new file with mode: 0644]
src/include/pgstat.h
src/include/postmaster/postmaster.h
src/include/utils/guc_tables.h
src/test/Makefile
src/tools/msvc/Mkvcbuild.pm