8000 PG-1506: Add separate parameters for kmip client cert and key by dutow · Pull Request #306 · percona/postgres · GitHub
[go: up one dir, main page]

Skip to content

PG-1506: Add separate parameters for kmip client cert and key #306

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

Closed
wants to merge 2 commits into from

Conversation

dutow
Copy link
Collaborator
@dutow dutow commented May 5, 2025

The old behavior still exists, as the new parameter is optional.

If only a certificate is specified, the keyring expects both the key and certificate to be in the same file.

If both parameters are specified, it looks for the key and cert in separate files.

@Andriciuc Andriciuc self-assigned this May 5, 2025
@jeltz
Copy link
Collaborator
jeltz commented May 5, 2025

Is there a reason to not make the key path mandatory? If someone wants to have them in the same file they could point both the certificate path and the key path to the same file. Seems like that would mean less complex logic. And all tools I can think of on top of my head keep these two paths separate and mandatory to specify both.

@dutow
Copy link
Collaborator Author
dutow commented May 5, 2025

Mongodb uses this for example, both mongo enterprise and ours. I kept both options here as it isn't more difficult, and still allows the previous behavior.

The old behavior still exists, as the new parameter is optional.

If only a certificate is specified, the keyring expects both the
key and certificate to be in the same file.

If both parameters are specified, it looks for the key and cert in
separate files.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.

Project coverage is 80.28%. Comparing base (7ca5038) to head (566975e).

❌ Your project status has failed because the head coverage (80.28%) 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     #306      +/-   ##
=====================================================
+ Coverage              80.24%   80.28%   +0.04%     
=====================================================
  Files                     22       22              
  Lines                   2546     2552       +6     
  Branches                 399      398       -1     
=====================================================
+ Hits                    2043     2049       +6     
  Misses                   423      423              
  Partials                  80       80              
Components Coverage Δ
access 82.77% <ø> (ø)
catalog 87.75% <100.00%> (+0.08%) ⬆️
common 92.42% <ø> (ø)
encryption 77.06% <ø> (ø)
keyring 72.14% <66.66%> (+0.06%) ⬆️
src 64.18% <0.00%> (ø)
smgr 97.05% <ø> (-0.03%) ⬇️
transam ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jeltz
Copy link
Collaborator
jeltz commented May 5, 2025

I think the previous behavior is mostly confusing and means one more code path to test and document and since we are not yet GA I do not see any reason to support it.

@dutow
Copy link
Collaborator Author
dutow commented May 5, 2025

I would agree if supporting it would be a big difference - but really the only thing we need to support it is the default values in the sql functions and the additional condition in the kmip keyring code, that's a single line. I also added some conditions for handling if the value is NULL, but realistically that shouldn't happen even with the current code.

the previous behavior is mostly confusing

if you google it, some people keep them in the same file, and this is a valid/supported usecase by openssl and other ssl software. On the other hand, users just could repeat the same filename twice, or we could add an overload to the functions that does exactly that, but I don't think that would be simpler than this.

Andriciuc added a commit that referenced this pull request May 5, 2025
Updates merged from : PG-1506: Add separate parameters for kmip client cert and key #306
Copy link
Collaborator
@Andriciuc Andriciuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved from docs with the minor small correction to client-key for better clarity.

@@ -62,14 +62,15 @@ Load the `pg_tde` at startup time. The extension requires additional shared memo
* `kmip-IP` is the IP address of a domain name of the KMIP server
* `port` is the port to communicate with the KMIP server. Typically used port is 5696.
* `server-certificate` is the path to the certificate file for the KMIP server.
* `client key` is the path to the client key.
* `client-cert` is the path to the client certificate.
* `client-key` is the path to the client key. This is optional, if not specified, the certificate key has to contain both the certifcate and the key.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added small clarification after path to the client key: Optional, if not specified the certificate file has to contain both the certificate and the key.

@AndersAstrand
Copy link
Collaborator

To me it seems quite arbitrary to make this parameter optional. Now is the time to do backwards incompatible changes since this isn't in use anywhere yet, so making the "old" way work doesn't really mean anything valuable I think.

Updated with suggested cleaner text

Co-authored-by: Anastasia Alexandrova <anastasia.alexandrova@percona.com>
Andriciuc added a commit that referenced this pull request May 8, 2025
Modified the structure and overall presentation for the users to make it more accessible and future-proof as we improve pg_tde moving forward.

Split big chapters into smaller chunks to improve SEO, renamed a couple of files for better visibility online and cleaned a bit of text.

Integrated changes from:
- #314 
- #306
- Commit f636e82
@Andriciuc Andriciuc removed their assignment May 12, 2025
@AndersAstrand
Copy link
Collaborator

Replaced by #333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0