-
Notifications
You must be signed in to change notification settings - Fork 11
pg_basebackup: encrypt streamed WAL with new key #537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pg_basebackup: encrypt streamed WAL with new key #537
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (82.48%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## TDE_REL_17_STABLE #537 +/- ##
=====================================================
+ Coverage 82.40% 82.48% +0.07%
=====================================================
Files 25 25
Lines 3229 3232 +3
Branches 510 510
=====================================================
+ Hits 2661 2666 +5
+ Misses 457 455 -2
Partials 111 111
🚀 New features to boost your workflow:
|
0a724e9
to
70b96af
Compare
e7f8c94
to
b0830e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment about the copyright comment, otherwise looks good
contrib/pg_tde/t/pg_basebackup.pl
Outdated
@@ -0,0 +1,49 @@ | |||
|
|||
# Copyright (c) 2021-2024, PostgreSQL Global Development Group |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This copyright seems incorrect, as this mostly tests encryption flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
fc48b60
to
3a333e6
Compare
A lot of tests seems to fail with this patch. I haven't looked into the details. I'll push an updated version of #542 EDIT: SEems like the issue is with using |
3a333e6
to
cc2a46f
Compare
Before, pg_basebackup would encrypt streamed WAL according to the keys in pg_tde/wal_keys in the destination dir. This commit introduces the number of changes: pg_basebackup encrypts WAL only if the "-E --encrypt-wal" flag is provided. In such a case, it would extract the principal key, truncate pg_tde/wal_keys and encrypt WAL with a newly generated WAL key. We still expect pg_tde/wal_keys and pg_tde/1664_providers in the destination dir. In case these files are not provided, but "-E" is specified, it fails with an error. We also throw a warning if pg_basebackup runs w/o -E, but there is wal_keys on the source as WAL might be compromised, and the backup is broken For PG-1603, PG-1857
cc2a46f
to
78c0ecc
Compare
Before, pg_basebackup would encrypt streamed WAL according to the keys in pg_tde/wal_keys in the destination dir.
This commit introduces the number of changes:
pg_basebackup encrypts WAL only if the "-E --encrypt-wal" flag is provided. In such a case, it would extract the principal key, truncate pg_tde/wal_keys and encrypt WAL with a newly generated WAL key. We still expect pg_tde/wal_keys and pg_tde/1664_providers in the destination dir. In case these files are not provided, but "-E" is specified, it fails with an error.