DOCS-small-fixes (#322)

literally 1 uppercase changes to files where appropriate to ensured
style throughout docs by doing that, and a small sql fix for a command

NOTE: I will change the capitalization to the titles a bit later as per
the style guide, right now I want to have a clean style across all
titles so it doesn't look too mishmashy.
pull/230/head
Dragos Andriciuc 4 months ago committed by GitHub
parent 48c37f8544
commit c6d4bc776f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      contrib/pg_tde/documentation/docs/architecture/index.md
  2. 2
      contrib/pg_tde/documentation/docs/features.md
  3. 6
      contrib/pg_tde/documentation/docs/global-key-provider-configuration/kmip-server.md
  4. 2
      contrib/pg_tde/documentation/docs/global-key-provider-configuration/vault.md
  5. 12
      contrib/pg_tde/documentation/docs/how-to/decrypt.md
  6. 2
      contrib/pg_tde/documentation/docs/how-to/external-parameters.md
  7. 7
      contrib/pg_tde/documentation/docs/how-to/multi-tenant-setup.md
  8. 4
      contrib/pg_tde/documentation/docs/index.md
  9. 2
      contrib/pg_tde/documentation/docs/index/index.md
  10. 4
      contrib/pg_tde/documentation/docs/index/table-access-method.md
  11. 2
      contrib/pg_tde/documentation/docs/index/tde-encrypts.md
  12. 2
      contrib/pg_tde/documentation/docs/index/tde-limitations.md
  13. 9
      contrib/pg_tde/documentation/docs/setup.md
  14. 26
      contrib/pg_tde/documentation/docs/test.md
  15. 11
      contrib/pg_tde/documentation/docs/wal-encryption.md

@ -45,8 +45,8 @@ In the future these could be extracted into separate shared libraries with an op
`pg_tde` uses two kinds of keys for encryption:
* Internal keys to encrypt the data. They are stored in PostgreSQL's data directory under `$PGDATA/pg_tde``.
* Higher-level keys to encrypt internal keys. These keys are called "principal keys". They are stored externally, in a Key Management System (KMS) using the key provider API.
* Internal keys to encrypt the data. They are stored in PostgreSQL's data directory under `$PGDATA/pg_tde`.
* Higher-level keys to encrypt internal keys. These keys are called *principal keys*. They are stored externally, in a Key Management System (KMS) using the key provider API.
`pg_tde` uses one principal key per database. Every internal key for the given database is encrypted using this principal key.

@ -21,4 +21,4 @@ The following features are available for the extension:
* Multiple Key management options
* Logical replication of encrypted tables
[Overview](index/index.md){.md-button} [Get started](install.md){.md-button}
[Overview](index/index.md){.md-button} [Get Started](install.md){.md-button}

@ -29,9 +29,7 @@ SELECT pg_tde_add_global_key_provider_kmip(
* `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_cert` is the path to the client certificate.
* `client_key` (optional) is the path to the client key. If not specified, the certificate key has to contain both the certifcate and the 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`.
* `client_key` is the path to the client key.
The following example is for testing purposes only.
@ -47,7 +45,7 @@ SELECT pg_tde_add_global_key_provider_kmip(
For more information on related functions, see the link below:
[Percona pg_tde function reference](../functions.md){.md-button}
[Percona pg_tde Function Reference](../functions.md){.md-button}
## Next steps

@ -39,7 +39,7 @@ SELECT pg_tde_add_global_key_provider_vault_v2(
For more information on related functions, see the link below:
[Percona pg_tde function reference](../functions.md){.md-button}
[Percona pg_tde Function Reference](../functions.md){.md-button}
## Next steps

@ -5,19 +5,19 @@
If you encrypted a table with the `tde_heap` access method and need to remove the encryption from it, run the following command against the desired table (`mytable` in the example below):
```sql
ALTER TABLE mytable SET ACCESS METHOD heap;
ALTER TABLE mytable SET ACCESS METHOD heap;
```
Note that the `SET ACCESS METHOD` command drops hint bits and this may affect performance. Running a plain `SELECT count(*)` or `VACUUM` command on the entire table will check every tuple for visibility and set its hint bits. Therefore, after executing the `ALTER TABLE` command, run a simple `count(*)` on your tables:
```sql
SELECT count(*) FROM mytable;
SELECT count(*) FROM mytable;
```
Check that the table is not encrypted:
```sql
SELECT pg_tde_is_encrypted('mytable');
SELECT pg_tde_is_encrypted('mytable');
```
The output returns `f` meaning that the table is no longer encrypted.
@ -27,8 +27,8 @@ The output returns `f` meaning that the table is no longer encrypted.
Alternatively, you can create a new not encrypted table with the same structure and data as the initial table. For example, the original encrypted table is `EncryptedCustomers`. Use the following command to create a new table `Customers`:
```sql
CREATE TABLE Customers AS
SELECT * FROM EncryptedCustomers;
CREATE TABLE Customers AS
SELECT * FROM EncryptedCustomers;
```
The new table `Customers` inherits the structure and the data from `EncryptedCustomers`.
@ -36,5 +36,5 @@ The new table `Customers` inherits the structure and the data from `EncryptedCus
(Optional) If you no longer need the `EncryptedCustomers` table, you can delete it.
```sql
DROP TABLE EncryptedCustomers;
DROP TABLE EncryptedCustomers;
```

@ -18,7 +18,7 @@ use the following command:
SELECT pg_tde_add_database_key_provider_file(
'file-provider',
json_object( 'type' VALUE 'remote', 'url' VALUE 'http://localhost:8888/hello' )
);"
);
```
Or to use the `file` method, use the following command:

@ -2,9 +2,9 @@
The steps below describe how to set up multi-tenancy with `pg_tde`. Multi-tenancy allows you to encrypt different databases with different keys. This provides granular control over data and enables you to introduce different security policies and access controls for each database so that only authorized users of specific databases have access to the data.
If you don't need multi-tenancy, use the global key provider. See the configuration steps from the [Setup](../setup.md) section.
If you don't need multi-tenancy, use the global key provider. See the configuration steps from the [Configure pg_tde](../setup.md) section.
For how to enable WAL encryption, refer to the [WAL encryption](../wal-encryption.md) section.
For how to enable WAL encryption, refer to the [Configure WAL Encryption](../wal-encryption.md) section.
--8<-- "kms-considerations.md"
@ -132,6 +132,7 @@ You must do these steps for every database where you have created the extension.
SELECT pg_tde_set_key_using_database_key_provider('test-db-master-key','file-vault','ensure_new_key');
```
The key is auto-generated.
!!! note
The key is auto-generated.
<i info>:material-information: Info:</i> The key provider configuration is stored in the database catalog in an unencrypted table. See [how to use external reference to parameters](external-parameters.md) to add an extra security layer to your setup.

@ -6,6 +6,6 @@
This is the {{release}} version of the extension and it is not meant for production use yet. We encourage you to use it in testing environments and [provide your feedback](https://forums.percona.com/c/postgresql/pg-tde-transparent-data-encryption-tde/82).
[What is Transparent Data Encryption (TDE)?](index/index.md){.md-button}
[Get started](install.md){.md-button}
[Overview](index/index.md){.md-button}
[Get Started](install.md){.md-button}
[What's new in pg_tde {{release}}](release-notes/release-notes.md){.md-button}

@ -4,4 +4,4 @@ Transparent Data Encryption (TDE) protects your data at rest by ensuring that ev
Encryption happens transparently in the background, with minimal impact on database operations.
[TDE Benefits](how-tde-helps.md){.md-button} [Check the full feature list](../features.md){.md-button} [Get started](../install.md){.md-button}
[TDE Benefits](how-tde-helps.md){.md-button} [Check the full feature list](../features.md){.md-button} [Get Started](../install.md){.md-button}

@ -79,13 +79,13 @@ Here is how you can set the new default table access method:
You can run the SET command anytime during the session.
```sql
SET default_table_access_method = tde_heap;
SET default_table_access_method = tde_heap;
```
2. Reload the configuration to apply the changes:
```sql
SELECT pg_reload_conf();
SELECT pg_reload_conf();
```
[Limitations of TDE](tde-limitations.md){.md-button}

@ -8,4 +8,4 @@
* **Indexes** associated encrypted tables.
* **Logical replication data** for encrypted tables (ensures encrypted content is preserved across replicas).
[Table access methods and TDE](table-access-method.md){.md-button}
[Table Access Methods and TDE](table-access-method.md){.md-button}

@ -6,4 +6,4 @@
* `pg_rewind` doesn't work with encrypted WAL for now. We plan to fix it in future releases.
* `pg_tde` Release candidate is incompatible with `pg_tde`Beta2 due to significant changes in code. There is no direct upgrade flow from one version to another. You must [uninstall](../how-to/uninstall.md) `pg_tde` Beta2 first and then [install](../install.md) and configure the new Release Candidate version.
[Versions and supported PostgreSQL deployments](supported-versions.md){.md-button}
[Versions and Supported PostgreSQL Deployments](supported-versions.md){.md-button}

@ -3,10 +3,9 @@
Before you can use `pg_tde` for data encryption, you must enable the extension and configure PostgreSQL to load it at startup. This setup ensures that the necessary hooks and shared memory are available for encryption operations.
!!! note
To learn how to configure multi-tenancy, refer to the [Configure multi-tenancy](how-to/multi-tenant-setup.md) guidelines.
To learn how to configure multi-tenancy, refer to the [Configure multi-tenancy](how-to/multi-tenant-setup.md) guidelines.
The `pg_tde` extension requires additional shared memory. You need to configure PostgreSQL to prelaod it at startup.
The `pg_tde` extension requires additional shared memory. You need to configure PostgreSQL to preload it at startup.
## 1. Configure shared_preload_libraries
@ -45,7 +44,7 @@ Restart the `postgresql` cluster to apply the configuration.
After restarting PostgreSQL, connect to `psql` as a **superuser** or **database owner** and run:
```sql
CREATE EXTENSION pg_tde;
CREATE EXTENSION pg_tde;
```
See [CREATE EXTENSION :octicons-link-external-16:](https://www.postgresql.org/docs/current/sql-createextension.html) for more details.
@ -59,7 +58,7 @@ See [CREATE EXTENSION :octicons-link-external-16:](https://www.postgresql.org/do
To automatically have `pg_tde` enabled for all new databases, modify the `template1` database:
```
psql -d template1 -c 'CREATE EXTENSION pg_tde;'
psql -d template1 -c 'CREATE EXTENSION pg_tde;'
```
!!! note

@ -7,26 +7,26 @@ After enabling the `pg_tde` extension for a database, you can begin encrypting d
1. Create a table in the database for which you have [enabled `pg_tde`](setup.md) using the `tde_heap` access method as follows:
```sql
CREATE TABLE <table_name> (<field> <datatype>) USING tde_heap;
CREATE TABLE <table_name> (<field> <datatype>) USING tde_heap;
```
<i warning>:material-information: Warning:</i> Example for testing purposes only:
```sql
CREATE TABLE albums (
album_id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
artist_id INTEGER,
title TEXT NOT NULL,
released DATE NOT NULL
) USING tde_heap;
CREATE TABLE albums (
album_id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
artist_id INTEGER,
title TEXT NOT NULL,
released DATE NOT NULL
) USING tde_heap;
```
Learn more about table access methods and how you can enable data encryption by default in the [Table access methods](index/table-access-method.md) section.
Learn more about table access methods and how you can enable data encryption by default in the [Table Access Methods and TDE](index/table-access-method.md) section.
2. To check if the data is encrypted, run the following function:
```sql
SELECT pg_tde_is_encrypted('table_name');
SELECT pg_tde_is_encrypted('table_name');
```
The function returns `t` if the table is encrypted and `f` - if not.
@ -42,23 +42,21 @@ You can encrypt an existing table. It requires rewriting the table, so for large
Run the following command:
```sql
ALTER TABLE table_name SET ACCESS METHOD tde_heap;
ALTER TABLE table_name SET ACCESS METHOD tde_heap;
```
!!! important
Using `SET ACCESS METHOD` drops hint bits which can impact query performance. To restore performance, run:
```sql
SELECT count(*) FROM table_name;
SELECT count(*) FROM table_name;
```
This forces PostgreSQL to check every tuple for visibility and reset the hint bits.
!!! hint
Want to remove encryption later? See how to [decrypt your data](how-to/decrypt.md).
## Next steps
[Configure WAL encryption (tech preview) :material-arrow-right:](wal-encryption.md){.md-button}
[Configure WAL Encryption (tech preview) :material-arrow-right:](wal-encryption.md){.md-button}

@ -62,13 +62,13 @@ Before turning WAL encryption on, you must follow the steps below to create your
3. Create principal key
```sql
SELECT pg_tde_set_server_key_using_global_key_provider('key', 'provider-name');
SELECT pg_tde_set_server_key_using_global_key_provider('key', 'provider-name');
```
4. Enable WAL level encryption using the `ALTER SYSTEM` command. You need the privileges of the superuser to run this command:
```sql
ALTER SYSTEM SET pg_tde.wal_encrypt = on;
ALTER SYSTEM SET pg_tde.wal_encrypt = on;
```
5. Restart the server to apply the changes.
@ -76,15 +76,16 @@ Before turning WAL encryption on, you must follow the steps below to create your
* On Debian and Ubuntu:
```sh
sudo systemctl restart postgresql
sudo systemctl restart postgresql
```
* On RHEL and derivatives
```sh
sudo systemctl restart postgresql-17
sudo systemctl restart postgresql-17
```
Now WAL files start to be encrypted for both encrypted and unencrypted tables.
For more technical references related to architecture, variables or functions, see [Technical Reference](advanced-topics/index.md).
For more technical references related to architecture, variables or functions, see:
[Technical Reference](advanced-topics/index.md){.md-button}

Loading…
Cancel
Save