forked from postgres/postgres
-
Notifications
You must be signed in to change notification settings - Fork 11
Tde documentation updates for ga #251
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
Merged
Andriciuc
merged 31 commits into
TDE_REL_17_STABLE
from
TDE-documentation-updates-for-GA
May 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
fdd464b
Added and reorg files
Andriciuc f3d8379
Split Home and created TDE Overview
Andriciuc e2d4be2
Further refined and split into topics
Andriciuc f5db064
Renamed files and folders for better SEO
Andriciuc 4869f64
Merge remote-tracking branch 'origin/pg_tde_docs_updates_for_GA' into…
Andriciuc ed361e7
updated with Anders branch
Andriciuc b5c9e89
Small updates to yml and apt
Andriciuc d5a0629
updated index folder to reflect chapter name, overview
Andriciuc ef82b1f
updated overview doc to index again
Andriciuc cbd4017
updated links to reflect proper structure
Andriciuc 778851b
Setup.md and structure changes
Andriciuc 1e3c
8000
160
A handful of fixes
Andriciuc 043b44e
removed PG Community mentions
Andriciuc 0876d20
updated cli and kmip server code
Andriciuc 106856d
small fixes
Andriciuc 6dc7d79
Update functions.md
Andriciuc 9b8d6c2
updated toc
Andriciuc 9302f0f
small fixes to buttons added
Andriciuc 7d4b514
smaller updates
Andriciuc 6f1c3b8
smaller updates
Andriciuc 12230fe
Update requirements.txt
Andriciuc 31c0975
fixes part 1/2 from feedback review
Andriciuc dce23bd
updated features.md
Andriciuc 1e61a45
removed compliance/regulations
Andriciuc f636e82
fix for PG-1587
Andriciuc 45b470e
fixes for nastia 1/2 and for jz 2/2
Andriciuc 104710e
all fixes accounted for
Andriciuc a39e568
Resolve merge conflicts
Andriciuc 31bea87
fixes to titles
Andriciuc be6e6ef
fixed notes in features
Andriciuc 7b76758
updated function parameters
Andriciuc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
A handful of fixes
created principal key file and updated the flow of the docs, TOC, fixes to texts and updated the way we present sql commands
- Loading branch information
commit 1e3c16071997a1200fbe21c44cbf811be4ca6430
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 12 additions & 4 deletions
16
contrib/pg_tde/documentation/docs/global-key-provider-configuration/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
# Global Key Provider Configuration | ||
# Configure Key Management (KMS) | ||
|
||
In production environments, storing encryption keys locally on the PostgreSQL server can create security risks. To enhance security, `pg_tde` supports integration with external Key Management Systems (KMS) through a Global Key Provider interface. | ||
In production environments, storing encryption keys locally on the PostgreSQL server can introduce security risks. To enhance security, `pg_tde` supports integration with external Key Management Systems (KMS) through a Global Key Provider interface. | ||
|
||
This section explains how to configure `pg_tde` to use external key providers, including KMIP servers, HashiCorp Vault, local keyring files and more. | ||
This section describes how you can configure `pg_tde` to use the local and external key providers. | ||
To use an external KMS with `pg_tde`, follow these two steps: | ||
Andriciuc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
1. [Configure a Key Provider](vault.md)(kmip-server.md)(keyring.md) | ||
2. Set the [Global Principal Key](set-principal-key.md) | ||
|
||
!!! note | ||
KMS integration is optional and it is intended for advanced deployments requiring higher security standards. | ||
KMS integration is optional and intended for advanced deployments that require higher security standards. | ||
|
||
Select your prefered configuration from the links below: | ||
|
||
[Configure KMIP :material-arrow-right:](kmip-server.md){.md-button} [Configure Vault :material-arrow-right:](vault.md){.md-button} [Configure Keyring :material-arrow-right:](keyring.md){.md-button} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Configure local keyring file | ||
|
||
This setup is intended for development and stores the keys unencrypted in the specified data file. See [how to use external reference to parameters](../how-to/external-parameters.md) to add an extra security layer to your setup. | ||
|
||
```sql | ||
SELECT pg_tde_add_global_key_provider_file( | ||
'provider-name', | ||
'/path/to/the/keyring/data.file' | ||
); | ||
``` | ||
|
||
<i note>:material-information: Note:</i> The following example is used for testing purposes only: | ||
|
||
```sql | ||
SELECT pg_tde_add_global_key_provider_file( | ||
'file-keyring', | ||
'/tmp/pg_tde_test_local_keyring.per' | ||
); | ||
``` | ||
|
||
## Next Step | ||
|
||
[Test pg_tde :material-arrow-right:](../test.md){.md-button} |
55 changes: 40 additions & 15 deletions
55
contrib/pg_tde/documentation/docs/global-key-provider-configuration/kmip-server.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,52 @@ | ||
# Set up with KMIP server | ||
# Configure KMIP server | ||
|
||
Set up a global key provider | ||
To use a Key Management Interoperability Protocol (KMIP) server with `pg_tde`, you must configure it as a global key provider. This setup enables `pg_tde` to securely fetch and manage encryption keys from a centralized key management appliance. | ||
|
||
Make sure you have obtained the root certificate for the KMIP server and the keypair for the client. The client key needs permissions to create / read keys on the server. Find the [configuration guidelines for the HashiCorp Vault Enterprise KMIP Secrets Engine](https://developer.hashicorp.com/vault/tutorials/enterprise/kmip-engine). | ||
!!! note | ||
|
||
For testing purposes, you can use the PyKMIP server which enables you to set up required certificates. To use a real KMIP server, make sure to obtain the valid certificates issued by the key management appliance. | ||
You need the root certificate of the KMIP server and a client key/certificate pair with permissions to create and read keys on the server. | ||
|
||
```sql | ||
SELECT pg_tde_add_global_key_provider_kmip('provider-name','kmip-IP', 5696, '/path_to/server_certificate.pem', '/path_to/client_key.pem'); | ||
``` | ||
It is recommended to review the [configuration guidelines for the HashiCorp Vault Enterprise KMIP Secrets Engine](https://developer.hashicorp.com/vault/tutorials/enterprise/kmip-engine) if you're using Vault. | ||
|
||
For testing purposes, you can use a lightweight PyKMIP server, which enables easy certificate generation and basic KMIP behavior. If you're using a production-grade KMIP server, ensure you obtain valid, trusted certificates from the key management appliance. | ||
|
||
## Example usage | ||
|
||
```sql | ||
SELECT pg_tde_add_global_key_provider_kmip( | ||
'provider-name', | ||
'kmip-IP', | ||
5696, | ||
'/path_to/server_certificate.pem', | ||
'/path_to/client_key.pem' | ||
); | ||
``` | ||
|
||
where: | ||
## Parameter descriptions | ||
|
||
* `provider-name` is the name of the provider. You can specify any name, it's for you to identify the provider. | ||
* `provider-name` is the name of the provider. You can specify any name, it's for you to identify the provider | ||
* `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. | ||
* `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 | ||
|
||
<i warning>:material-information: Warning:</i> Note that pg_tde_add_global_key_provider_kmip currently accepts only a combined client key + client certificate for the last parameter of this function named as `client key`. | ||
<i warning>:material-information: Warning:</i> `pg_tde_add_global_key_provider_kmip` currently accepts only a combined client key and a client certificate for its final parameter, reffered to as `client key`. | ||
|
||
<i warning>:material-information: Warning:</i> This example is for testing purposes only: | ||
<i note>:material-information: Note:</i> The following example is for testing purposes only. | ||
|
||
```sql | ||
SELECT pg_tde_add_global_key_provider_kmip('kmip','127.0.0.1', 5696, '/tmp/server_certificate.pem', '/tmp/client_key_jane_doe.pem'); | ||
SELECT pg_tde_add_global_key_provider_kmip( | ||
'kmip','127.0.0.1', | ||
5696, | ||
'/tmp/server_certificate.pem', | ||
'/tmp/client_key_jane_doe.pem' | ||
); | ||
``` | ||
|
||
For more information on related functions, see the link below: | ||
|
||
[Percona TDE function reference](../functions.md){.md-button} | ||
|
||
## Next Step | ||
|
||
[Test pg_tde :material-arrow-right:](../test.md){.md-button} |
23 changes: 23 additions & 0 deletions
23
...g_tde/documentation/docs/global-key-provider-configuration/set-principal-key.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Set the Global Principal Key | ||
|
||
Add a default principal key | ||
|
||
```sql | ||
SELECT pg_tde_set_default_key_using_global_key_provider('name-of-the-key','provider-name','ensure_new_key'); | ||
``` | ||
|
||
## Parameter description | ||
|
||
* `name-of-the-key` is the name of the principal key. You will use this name to identify the key. | ||
* `provider-name` is the name of the key provider you added before. The principal key will be associated with this provider. | ||
* `ensure_new_key` defines if a principal key must be unique. The default value `true` means that you must speficy a unique key during key rotation. The `false` value allows reusing an existing principal key. | ||
|
||
<i warning>:material-information: Warning:</i> This example is for testing purposes only. Replace the key name and provider name with your values: | ||
|
||
```sql | ||
SELECT pg_tde_set_key_using_global_key_provider('test-db-master-key','file-vault','ensure_new_key'); | ||
``` | ||
|
||
The key is auto-generated. | ||
|
||
After this, all databases that do not have something else configured will use this newly generated principal key. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Configure HashiCorp Vault | ||
|
||
You can configure `pg_tde` to use HashiCorp Vault as a global key provider for managing encryption keys securely. | ||
|
||
!!! note | ||
Andriciuc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This guide assumes that your Vault server is already set up and accessible. Vault configuration is outside the scope of this document, see [Vault's official documentation](https://developer.hashicorp.com/vault/docs) for more information. | ||
|
||
## Example usage | ||
|
||
```sql | ||
SELECT pg_tde_add_global_key_provider_vault_v2( | ||
'provider-name', | ||
'secret_token', | ||
'url', | ||
'mount', | ||
'ca_path' | ||
); | ||
``` | ||
|
||
## Parameter descriptions | ||
|
||
* `provider-name` is the name to identify this key provider | ||
* `secret_token` is an access token with read and write access to the above mount point | ||
* `url` is the URL of the Vault server | ||
* `mount` is the mount point where the keyring should store the keys | ||
* [optional] `ca_path` is the path of the CA file used for SSL verification | ||
|
||
<i note>:material-information: Note:</i> The following example is for testing purposes only. Use secure tokens and proper SSL validation in production environments: | ||
|
||
```sql | ||
SELECT pg_tde_add_global_key_provider_vault_v2( | ||
'my-vault', | ||
'hvs.zPuyktykA...example...ewUEnIRVaKoBzs2', | ||
'http://vault.vault.svc.cluster.local:8200', | ||
'secret/data', | ||
NULL | ||
); | ||
``` | ||
|
||
For more information on related functions, see the link below: | ||
|
||
[Percona TDE function reference](../functions.md){.md-button} | ||
|
||
## Next Step | ||
|
||
[Test pg_tde :material-arrow-right:](../test.md){.md-button} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.