Skip to content

Commit 8d88d3f

Browse files
authored
Updated principal-key/features/functions.md based on AA feedback (#441)
In set-principal-key.md: * updated with correct code example using set_server_key_using_global parameter * updated note to reflect correct config In features.md: * Removed temporary tables feature to clear confusion, removed logical replication mention, removed WAL encryption as a feature. In functions.md: * Added ON FUNCTION for grant/revoke execution * Modified sensitive info bolded paragraph to important note * Small modifications to notes display, title cases and text fixes * added note to Add or modify Vault providers for keeping the same principal key. * Added warning for WAL in pg_tde_create_key_using_global_key_provider In general: * Removed all logical replication mentions except the FAQ and in RC2 release note.
1 parent aa23578 commit 8d88d3f

File tree

5 files changed

+49
-27
lines changed

5 files changed

+49
-27
lines changed

contrib/pg_tde/documentation/docs/features.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ The following features are available for the extension:
99
* Data tables
1010
* Index data for encrypted tables
1111
* TOAST tables
12-
* Temporary tables created during database operations
12+
* Temporary tables
1313

1414
!!! note
1515
Metadata of those tables is not encrypted.
1616

17-
* Global Write-Ahead Log (WAL) encryption for data in both encrypted and non-encrypted tables
1817
* Single-tenancy support via a global keyring provider
1918
* Multi-tenancy support
2019
* Table-level granularity for encryption and access control
2120
* Multiple Key management options
22-
* Logical replication of encrypted tables
2321

2422
[Overview](index/index.md){.md-button} [Get Started](install.md){.md-button}

contrib/pg_tde/documentation/docs/functions.md

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ By default, `pg_tde` is locked down. No one is allowed to do any operations unti
88

99
However, database owners can run the “view keys” and “set principal key” functions on their own databases. You can delegate these rights to other roles with the following commands:
1010

11-
* `GRANT EXECUTE`
12-
* `REVOKE EXECUTE`
11+
* `GRANT EXECUTE ON FUNCTION`
12+
* `REVOKE EXECUTE ON FUNCTION`
1313

1414
## Key provider management
1515

1616
A key provider is a system or service responsible for managing encryption keys. `pg_tde` supports the following key providers:
1717

1818
* local file (not recommended for production use)
19-
* Hashicorp Vault / OpenBao
19+
* HashiCorp Vault / OpenBao
2020
* KMIP compatible providers
2121

2222
Key provider management includes the following operations:
@@ -52,9 +52,11 @@ The `change` functions require the same parameters as the `add` functions. They
5252

5353
Provider specific parameters differ for each implementation. Refer to the respective subsection for details.
5454

55-
**Some provider specific parameters contain sensitive information, such as passwords. Never specify these directly, use the remote configuration option instead.**
55+
!!! note
56+
The updated provider must be able to retrieve the same principal keys as the original configuration.
57+
If the new configuration cannot access existing keys, encrypted data and backups will become unreadable.
5658

57-
#### Adding or modifying Vault providers
59+
#### Add or modify Vault providers
5860

5961
The Vault provider connects to a HashiCorp Vault or an OpenBao server, and stores the keys on a key-value store version 2.
6062

@@ -106,7 +108,7 @@ where:
106108
* `secret_token_path` is a path to the file that contains an access token with read and write access to the above mount point
107109
* **[optional]** `ca_path` is the path of the CA file used for SSL verification
108110

109-
#### Adding or modifying KMIP providers
111+
#### Add or modify KMIP providers
110112

111113
The KMIP provider uses a remote KMIP server.
112114

@@ -165,16 +167,16 @@ where:
165167
!!! note
166168
The specified access parameters require permission to read and write keys at the server.
167169

168-
### Adding or modifying local keyfile providers
170+
### Add or modify local key file providers
169171

170-
This provider manages database keys using a local keyfile.
172+
This provider manages database keys using a local key file.
171173

172174
This function is intended for development or quick testing, and stores the keys unencrypted in the specified data file.
173175

174176
!!! important
175-
Local keyfile providers are **not recommended** for production environments, they lack the security and manageability of external key management systems.
177+
Local key file providers are **not recommended** for production environments, they lack the security and manageability of external key management systems.
176178

177-
Add a local keyfile provider:
179+
Add a local key file provider:
178180

179181
```sql
180182
SELECT pg_tde_add_database_key_provider_file(
@@ -188,7 +190,7 @@ SELECT pg_tde_add_global_key_provider_file(
188190
);
189191
```
190192

191-
Change a local keyfile provider:
193+
Change a local key file provider:
192194

193195
```sql
194196
SELECT pg_tde_change_database_key_provider_file(
@@ -225,14 +227,33 @@ These functions list the details of all key providers for the current database o
225227
* `pg_tde_list_all_database_key_providers()`
226228
* `pg_tde_list_all_global_key_providers()`
227229

228-
!!! important
229-
All configuration values include possibly sensitive values, such as passwords. **Never** specify these directly, use the remote configuration option instead.
230-
231230
## Principal key management
232231

233-
Use these functions to create a new principal key for a specific scope such as a current database, a global or default scope. You can also use them to start using a different existing key for a specific scope.
232+
Use these functions to create a new principal key at a given key provider, and to use those keys for a specific scope such as a current database, a global or default scope. You can also use them to start using a different existing key for a specific scope.
233+
234+
Principal keys are stored on key providers by the name specified in this function - for example, when using the Vault provider, after creating a key named "foo", a key named "foo" will be visible on the Vault server at the specified mount point.
235+
236+
### pg_tde_creates_key_using_database_key_provider
234237

235-
Princial keys are stored on key providers by the name specified in this function - for example, when using the Vault provider, after creating a key named "foo", a key named "foo" will be visible on the Vault server at the specified mount point.
238+
Creates a principal key using the database-local key provider with the specified name. Use this key later with [`pg_tde_set_key_using_database_key_provider()`](#pg_tde_set_key_using_database_key_provider).
239+
240+
```sql
241+
SELECT pg_tde_create_key_using_database_key_provider(
242+
'key-name',
243+
'provider-name'
244+
);
245+
```
246+
247+
### pg_tde_create_key_using_global_key_provider
248+
249+
Creates a principal key at a global key provider with the given name. Use this key later with the `pg_tde_set_` series of functions.
250+
251+
```sql
252+
SELECT pg_tde_create_key_using_global_key_provider(
253+
'key-name',
254+
'provider-name'
255+
);
256+
```
236257

237258
### pg_tde_set_key_using_database_key_provider
238259

@@ -283,6 +304,9 @@ SELECT pg_tde_set_server_key_using_global_key_provider(
283304
);
284305
```
285306

307+
!!! warning
308+
The WAL encryption feature is currently in beta and is not effective unless explicitly enabled. It is not yet production ready. **Do not enable this feature in production environments**.
309+
=======
286310
The `ensure_new_key` parameter instructs the function how to handle a principal key during key rotation:
287311

288312
* If set to `true`, a new key must be unique.

contrib/pg_tde/documentation/docs/global-key-provider-configuration/set-principal-key.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,16 @@ SELECT pg_tde_set_default_key_using_global_key_provider(
2727
If the specified key does **not** exist, a new encryption key is created under the given name. In this case, the key material (actual cryptographic key) is auto-generated by `pg_tde` and stored securely by the configured provider.
2828

2929
!!! note
30-
This process sets the **default principal key** for the server. Any database without its own key configuration will use this key.
30+
This process sets the **default principal key for the entire server**. Any database without a key explicitly configured will fall back to this key.
3131

3232
## Example
3333

3434
This example is for testing purposes only. Replace the key name and provider name with your values:
3535

3636
```sql
37-
SELECT pg_tde_set_key_using_global_key_provider(
38-
'test-db-master-key',
39-
'file-vault',
40-
'false'
37+
SELECT pg_tde_set_server_key_using_global_key_provider(
38+
'key-name',
39+
'provider-name'
4140
);
4241
```
4342

contrib/pg_tde/documentation/docs/index/supported-versions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Versions and Supported PostgreSQL Deployments
22

3-
The `pg_tde` extension is available for [Percona Server for PostgreSQL 17.x](https://docs.percona.com/postgresql/17/postgresql-server.html), an open source, drop-in replacement for PostgreSQL Community. This version provides the `tde_heap` access method and offers [full encryption capabilities](../features.md), including encryption of tables, indexes, WAL data, and support for logical replication.
3+
The `pg_tde` extension is available for [Percona Server for PostgreSQL 17.x](https://docs.percona.com/postgresql/17/postgresql-server.html), an open source, drop-in replacement for PostgreSQL Community. This version provides the `tde_heap` access method and offers [full encryption capabilities](../features.md), including encryption of tables, indexes and WAL data.
44

55
The extension is tightly integrated with Percona Server for PostgreSQL to deliver enhanced encryption functionality that is not available in community builds.
66

77
## Why choose Percona Server for PostgreSQL?
88

99
By using our PostgreSQL distribution, you get:
1010

11-
- **Full encryption support** through the `tde_heap` access method, including tables, indexes, WAL data, and logical replication.
11+
- **Full encryption support** through the `tde_heap` access method, including tables, indexes and WAL data.
1212
- **Enhanced performance and enterprise-ready features** not available in community builds.
1313
- **Regular updates and security patches** backed by Percona’s expert support team.
1414
- **Professional support** and guidance for secure PostgreSQL deployments.

contrib/pg_tde/documentation/docs/index/tde-encrypts.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* **Temporary tables** created during the query execution, for data tables created using the extension.
77
* **Write-Ahead Log (WAL) data** for the entire database cluster. This includes WAL data in encrypted and non-encrypted tables.
88
* **Indexes** on encrypted tables.
9-
* **Logical replication data** for encrypted tables (ensures encrypted content is preserved across replicas).
9+
10+
!!!
1011

1112
[Table Access Methods and TDE](table-access-method.md){.md-button}

0 commit comments

Comments
 (0)