@@ -19,50 +19,102 @@ Before turning WAL encryption on, you must follow the steps below to create your
19
19
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.
20
20
21
21
` ` ` sql
22
- SELECT pg_tde_add_global_key_provider_kmip('provider-name','kmip-addr', 5696, '/path_to/server_certificate.pem', '/path_to/client_cert.pem', '/path_to/client_key.pem');
22
+ SELECT pg_tde_add_global_key_provider_kmip(
23
+ provider_name => <provider-name>,
24
+ kmip_host => <kmip-addr>,
25
+ kmip_port => 5696,
26
+ kmip_ca_path => <server-certificate>,
27
+ kmip_cert_path => <client-cert>,
28
+ kmip_key_path => <client-key>
29
+ );
23
30
` ` `
24
31
25
32
where :
26
33
27
- * ` provider-name` is the name of the provider. You can specify any name, it' s for you to identify the provider.
28
- * `kmip-addr` is the IP address of a domain name of the KMIP server
29
- * `port` is the port to communicate with the KMIP server. Typically used port is 5696.
30
- * `server-certificate` is the path to the certificate file for the KMIP server.
31
- * `client-cert` is the path to the client certificate.
32
- * `client-key` is the path to the client key.
34
+ * ` < provider-name> ` is the name of the provider. You can specify any name, it' s for you to identify the provider.
35
+ * `< kmip-addr> ` is the IP address of a domain name of the KMIP server
36
+ * `< port> ` is the port to communicate with the KMIP server. Typically used port is 5696.
37
+ * `< server-certificate> ` is the path to the certificate file for the KMIP server.
38
+ * `< client-cert> ` is the path to the client certificate.
39
+ * `< client-key> ` is the path to the client key.
33
40
34
41
<i warning>:material-information: Warning:</i> This example is for testing purposes only:
35
42
36
43
```
37
- SELECT pg_tde_add_key_using_global_key_provider_kmip(' kmip' ,' 127 .0 .0 .1 ' , 5696, ' / tmp/ server_certificate .pem ' , ' / tmp/ client_cert_jane_doe .pem ' , ' / tmp/ client_key_jane_doe .pem ' );
44
+ SELECT pg_tde_add_key_using_global_key_provider_kmip(
45
+ provider_name => ' kmip' ,
46
+ kmip_host => ' 127 .0 .0 .1 ' ,
47
+ kmip_port => 5696,
48
+ kmip_ca_path => ' / opt/ server_certificate .pem ' ,
49
+ kmip_cert_path => ' / opt/ client_cert_jane_doe .pem ' ,
50
+ kmip_key_path => ' / opt/ client_key_jane_doe .pem '
51
+ );
38
52
```
39
53
40
54
=== "With HashiCorp Vault"
41
55
42
56
```sql
43
- SELECT pg_tde_add_global_key_provider_vault_v2(' provider- name' , ' secret_token' , ' url' , ' mount' , ' ca_path' );
57
+ SELECT pg_tde_add_global_key_provider_vault_v2(
58
+ provider_name => <provider-name>,
59
+ vault_token => <secret_token>,
60
+ vault_url => <url>,
61
+ vault_mount_path => <mount>,
62
+ vault_ca_path => <ca-path>
63
+ );
44
64
```
45
65
46
66
where:
47
67
48
- * `provider-name` is the name you define for the key provider
49
- * `url` is the URL of the Vault server
50
- * `mount` is the mount point where the keyring should store the keys
51
- * `secret_token` is an access token with read and write access to the above mount point
52
- * [optional] `ca_path` is the path of the CA file used for SSL verification
68
+ * `<provider-name>` is the name you define for the key provider
69
+ * `<url>` is the URL of the Vault server
70
+ * `<mount>` is the mount point where the keyring should store the keys
71
+ * `<secret-token>` is an access token with read and write access to the above mount point
72
+ * [optional] `<ca-path>` is the path of the CA file used for SSL verification
73
+
74
+ <i warning>:material-information: Warning:</i> This example is for testing purposes only:
75
+
76
+ ```
77
+ SELECT pg_tde_add_key_using_global_key_provider_vault_v2(
78
+ provider_name => ' vault_v2' ,
79
+ vault_token => ' secret_token' ,
80
+ vault_url => ' http:// 127 .0 .0 .1 ' ,
81
+ vault_mount_path => ' secrets' ,
82
+ vault_ca_path => ' / opt/ server_certificate .pem '
83
+ );
84
+ ```
53
85
54
86
=== "With keyring file"
55
87
56
88
This setup is **not recommended**, as it is intended for development. The keys are stored **unencrypted** in the specified data file.
57
89
58
90
```sql
59
- SELECT pg_tde_add_global_key_provider_file(' provider- name' ,' / path / to/ the/ keyring/ data .file ' );
91
+ SELECT pg_tde_add_global_key_provider_file(
92
+ provier_name => <provider-name>,
93
+ file_path => <path>
94
+ );
95
+ ```
96
+
97
+ where:
98
+
99
+ * `<provider-name>` is the name you define for the key provider
100
+ * `<path>` is the key data file
101
+
102
+ <i warning>:material-information: Warning:</i> This example is for testing purposes only:
103
+
104
+ ```sql
105
+ SELECT pg_tde_add_global_key_provider_file(
106
+ provier_name => ' provider- name' ,
107
+ file_path => ' / path / to/ the/ keyring/ data .file '
108
+ );
60
109
```
61
110
62
111
3. Create principal key
63
112
64
113
```sql
65
- SELECT pg_tde_set_server_key_using_global_key_provider(' key' , ' provider- name' );
114
+ SELECT pg_tde_set_server_key_using_global_key_provider(
115
+ key_name => ' key' ,
116
+ provider_name => ' provider- name'
117
+ );
66
118
```
67
119
68
120
4. Enable WAL level encryption using the `ALTER SYSTEM` command. You need the privileges of the superuser to run this command:
0 commit comments