Skip to content

Commit f88e3ec

Browse files
Backport of Improve databases documentation into stable-website (#13481)
* backport of commit 1aeddca * backport of commit eb572c0 * backport of commit 72f9a6a Co-authored-by: Jonathan Ballet <jballet@edgelab.ch> Co-authored-by: Jonathan Ballet <jon@multani.info>
1 parent 3dc6234 commit f88e3ec

File tree

13 files changed

+79
-72
lines changed

13 files changed

+79
-72
lines changed

website/content/api-docs/secret/databases/cassandra.mdx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ has a number of parameters to further configure a connection.
5656
[the pki documentation](/docs/secrets/pki). Only one of `pem_bundle` or `pem_json` can be specified.
5757

5858
<details>
59-
<summary>`pem_json` example</summary>
59+
<summary><b><tt>pem_json</tt> example</b></summary>
6060

6161
```json
6262
{
@@ -65,7 +65,9 @@ has a number of parameters to further configure a connection.
6565
"ca_chain": ["<CA as a PEM>", "<Additional PEM for the CA chain if needed"]
6666
}
6767
```
68-
If using the Vault CLI, it's probably easiest to write the JSON to a file and then reference the file:
68+
69+
If using the Vault CLI, it's probably easiest to write the JSON to a file and then reference the file:
70+
6971
```shell
7072
vault write database/config/cassandra-example <...other fields> pem_json=@/path/to/file.json
7173
```
@@ -83,7 +85,7 @@ vault write database/config/cassandra-example <...other fields> pem_json=@/path/
8385

8486
- `local_datacenter` `(string: "")` – If set, enables host selection policy
8587
which will prioritize and use hosts which are in the local datacenter before
86-
hosts in all other datacenters (for example "dc-01").
88+
hosts in all other datacenters (for example `dc-01`).
8789

8890
- `socket_keep_alive` `(string: "0s")` – the keep-alive period for an active
8991
network connection. If zero, keep-alives are not enabled.
@@ -180,32 +182,35 @@ list the plugin does not support that statement type.
180182
statements executed to create and configure a user. Must be a
181183
semicolon-separated string, a base64-encoded semicolon-separated string, a
182184
serialized JSON string array, or a base64-encoded serialized JSON string
183-
array. The '{{username}}' and '{{password}}' values will be substituted. If not
185+
array. The `{{username}}` and `{{password}}` values will be substituted. If not
184186
provided, defaults to a generic create user statements that creates a
185187
non-superuser.
186188

187189
- `revocation_statements` `(list: [])` – Specifies the database statements to
188190
be executed to revoke a user. Must be a semicolon-separated string, a
189191
base64-encoded semicolon-separated string, a serialized JSON string array, or
190-
a base64-encoded serialized JSON string array. The '{{username}}' value will be
192+
a base64-encoded serialized JSON string array. The `{{username}}` value will be
191193
substituted. If not provided defaults to a generic drop user statement.
192194

193195
- `rollback_statements` `(list: [])` – Specifies the database statements to be
194196
executed to rollback a create operation in the event of an error. Must be a
195197
semicolon-separated string, a base64-encoded semicolon-separated string, a
196198
serialized JSON string array, or a base64-encoded serialized JSON string
197-
array. The '{{username}}' value will be substituted. If not provided, defaults to
199+
array. The `{{username}}` value will be substituted. If not provided, defaults to
198200
a generic drop user statement
199201

200202
- `root_rotation_statements` `(list: [])` - Specifies the database statements
201203
to be executed when rotating the root user's password. Must be a
202204
semicolon-separated string, a base64-encoded semicolon-separated string, a
203205
serialized JSON string array, or a base64-encoded serialized JSON string
204-
array. The '{{username}}' value will be substituted. If not provided, defaults to
206+
array. The `{{username}}` value will be substituted. If not provided, defaults to
205207
a reasonable default alter user statement.
206208

207209
~> Prior to Vault 1.7.1 and 1.6.4 the default `root_rotation_statements` does not
208210
allow for usernames with special characters in them due to missing quotes
209211
around the username. To fix this issue in versions prior to Vault 1.7.1/1.6.4,
210-
specify the following `root_rotation_statements`:<br/>
211-
`ALTER USER '{{username}}' WITH PASSWORD '{{password}}';`
212+
specify the following `root_rotation_statements`:
213+
214+
```sql
215+
ALTER USER '{{username}}' WITH PASSWORD '{{password}}';
216+
```

website/content/api-docs/secret/databases/elasticdb.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ has a number of parameters to further configure a connection.
2424

2525
### Parameters
2626

27-
- `url` `(string: <required>)` - The URL for Elasticsearch's API ("http://localhost:9200").
28-
- `username` `(string: <required>)` - The username to be used in the connection URL ("vault").
29-
- `password` `(string: <required>)` - The password to be used in the connection URL ("pa55w0rd").
27+
- `url` `(string: <required>)` - The URL for Elasticsearch's API (`http://localhost:9200`).
28+
- `username` `(string: <required>)` - The username to be used in the connection URL (`vault`).
29+
- `password` `(string: <required>)` - The password to be used in the connection URL (`pa55w0rd`).
3030
- `ca_cert` `(string: "")` - The path to a PEM-encoded CA cert file to use to verify the Elasticsearch server's identity.
3131
- `ca_path` `(string: "")` - The path to a directory of PEM-encoded CA cert files to use to verify the Elasticsearch server's identity.
3232
- `client_cert` `(string: "")` - The path to the certificate for the Elasticsearch client to present for communication.
3333
- `client_key` `(string: "")` - The path to the key for the Elasticsearch client to use for communication.
34-
- `tls_server_name` `(string: "")` - This, if set, is used to set the SNI host when connecting via 1TLS.
35-
- `insecure` `(bool: false)` - Not recommended. Default to false. Can be set to true to disable SSL verification.
34+
- `tls_server_name` `(string: "")` - This, if set, is used to set the SNI host when connecting via TLS.
35+
- `insecure` `(bool: false)` - Not recommended. Default to `false`. Can be set to `true` to disable certificate verification.
3636
- `username_template` `(string)` - [Template](/docs/concepts/username-templating) describing how dynamic usernames are generated.
3737

3838
### Sample Payload
@@ -74,11 +74,13 @@ list the plugin does not support that statement type.
7474

7575
- `creation_statements` `(string: <required>)` – Using JSON, either defines an
7676
`elasticsearch_role_definition` or a group of pre-existing `elasticsearch_roles`.
77+
7778
The object specified by the `elasticsearch_role_definition` is the JSON directly
7879
passed through to the Elasticsearch API, so you can pass through anything shown
7980
[here](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/security-api-put-role.html).
81+
8082
For `elasticsearch_roles`, add the names of the roles only. They must pre-exist
81-
in Elasticsearch. Defining roles in Vault is more secure than using pre-existing
83+
in Elasticsearch. Defining roles in Vault is more secure than using pre-existing
8284
roles because a privilege escalation could be performed by editing the roles used
8385
out-of-band in Elasticsearch.
8486

website/content/api-docs/secret/databases/hanadb.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ has a number of parameters to further configure a connection.
2626

2727
- `connection_url` `(string: <required>)` - Specifies the HANA DSN. This field
2828
can be templated and supports passing the username and password
29-
parameters in the following format {{field_name}}. A templated connection URL is
29+
parameters in the following format `{{field_name}}`. A templated connection URL is
3030
required when using root credential rotation.
3131

3232
- `max_open_connections` `(int: 4)` - Specifies the maximum number of open
@@ -38,7 +38,7 @@ has a number of parameters to further configure a connection.
3838
`max_open_connections` it will be reduced to be equal.
3939

4040
- `max_connection_lifetime` `(string: "0s")` - Specifies the maximum amount of
41-
time a connection may be reused. If &lt;= 0s connections are reused forever.
41+
time a connection may be reused. If &le; `0s`, connections are reused forever.
4242

4343
- `username` `(string: "")` - The root credential username used in the connection URL.
4444

@@ -54,7 +54,7 @@ has a number of parameters to further configure a connection.
5454
"max_open_connections": 5,
5555
"max_connection_lifetime": "5s",
5656
"username": "username",
57-
"password": "password
57+
"password": "password"
5858
}
5959
```
6060

@@ -84,7 +84,7 @@ list the plugin does not support that statement type.
8484
statements executed to create and configure a user. Must be a
8585
semicolon-separated string, a base64-encoded semicolon-separated string, a
8686
serialized JSON string array, or a base64-encoded serialized JSON string
87-
array. The '{{name}}', '{{password}}', and '{{expiration}}' values will be
87+
array. The `{{name}}`, `{{password}}`, and `{{expiration}}` values will be
8888
substituted.
8989

9090
- The expiration time will be HANA server time plus the role's `default_ttl`.
@@ -93,6 +93,6 @@ list the plugin does not support that statement type.
9393
- `revocation_statements` `(list: [])` – Specifies the database statements to
9494
be executed to revoke a user. Must be a semicolon-separated string, a
9595
base64-encoded semicolon-separated string, a serialized JSON string array, or
96-
a base64-encoded serialized JSON string array. The '{{name}}' value will be
96+
a base64-encoded serialized JSON string array. The `{{name}}` value will be
9797
substituted. If not provided, defaults to dropping the user only if they have
9898
no dependent objects.

website/content/api-docs/secret/databases/index.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ list of additional parameters.
4141
during initial configuration. Defaults to true.
4242

4343
- `allowed_roles` `(list: [])` - List of the roles allowed to use this connection.
44-
Defaults to empty (no roles), if contains a "\*" any role can use this connection.
44+
Defaults to empty (no roles), if contains a `*` any role can use this connection.
4545

4646
- `root_rotation_statements` `(list: [])` - Specifies the database statements to be
4747
executed to rotate the root user's credentials. See the plugin's API page for more
@@ -273,12 +273,12 @@ This endpoint creates or updates a role definition.
273273
for this role.
274274

275275
- `default_ttl` `(string/int: 0)` - Specifies the TTL for the leases
276-
associated with this role. Accepts time suffixed strings ("1h") or an integer
276+
associated with this role. Accepts time suffixed strings (`1h`) or an integer
277277
number of seconds. Defaults to system/engine default TTL time.
278278

279279
- `max_ttl` `(string/int: 0)` - Specifies the maximum TTL for the leases
280-
associated with this role. Accepts time suffixed strings ("1h") or an integer
281-
number of seconds. Defaults to system/mount default TTL time; this value is allowed to be less than the mount max TTL (or, if not set, the system max TTL), but it is not allowed to be longer. See also [The TTL General Case](/docs/concepts/tokens#the-general-case).
280+
associated with this role. Accepts time suffixed strings (`1h`) or an integer
281+
number of seconds. Defaults to `sys/mounts`'s default TTL time; this value is allowed to be less than the mount max TTL (or, if not set, the system max TTL), but it is not allowed to be longer. See also [The TTL General Case](/docs/concepts/tokens#the-general-case).
282282

283283
- `creation_statements` `(list: <required>)` – Specifies the database
284284
statements executed to create and configure a user. See the plugin's API page
@@ -490,7 +490,7 @@ this in order to know the password.
490490
{
491491
"db_name": "mysql",
492492
"username": "static-database-user",
493-
"rotation_statements": ["ALTER USER "{{name}}" WITH PASSWORD '{{password}}';"],
493+
"rotation_statements": ["ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';"],
494494
"rotation_period": "1h"
495495
}
496496
```
@@ -533,9 +533,9 @@ $ curl \
533533
"data": {
534534
"db_name": "mysql",
535535
"username":"static-user",
536-
"rotation_statements": ["ALTER USER "{{name}}" WITH PASSWORD '{{password}}';"],
537-
"rotation_period":"1h",
538-
},
536+
"rotation_statements": ["ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';"],
537+
"rotation_period":"1h"
538+
}
539539
}
540540
```
541541

website/content/api-docs/secret/databases/influxdb.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,19 @@ list the plugin does not support that statement type.
116116
statements executed to create and configure a user. Must be a
117117
semicolon-separated string, a base64-encoded semicolon-separated string, a
118118
serialized JSON string array, or a base64-encoded serialized JSON string
119-
array. The '{{username}}' and '{{password}}' values will be substituted. If not
119+
array. The `{{username}}` and `{{password}}` values will be substituted. If not
120120
provided, defaults to a generic create user statements that creates a
121121
non-superuser.
122122

123123
- `revocation_statements` `(list: [])` – Specifies the database statements to
124124
be executed to revoke a user. Must be a semicolon-separated string, a
125125
base64-encoded semicolon-separated string, a serialized JSON string array, or
126-
a base64-encoded serialized JSON string array. The '{{username}}' value will be
126+
a base64-encoded serialized JSON string array. The `{{username}}` value will be
127127
substituted. If not provided defaults to a generic drop user statement.
128128

129129
- `rollback_statements` `(list: [])` – Specifies the database statements to be
130130
executed to rollback a create operation in the event of an error. Must be a
131131
semicolon-separated string, a base64-encoded semicolon-separated string, a
132132
serialized JSON string array, or a base64-encoded serialized JSON string
133-
array. The '{{username}}' value will be substituted. If not provided, defaults to
134-
a generic drop user statement
133+
array. The `{{username}}` value will be substituted. If not provided, defaults to
134+
a generic drop user statement.

website/content/api-docs/secret/databases/mongodb.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,17 @@ list the plugin does not support that statement type.
111111
- `creation_statements` `(string: <required>)` – Specifies the database
112112
statements executed to create and configure a user. Must be a
113113
serialized JSON object, or a base64-encoded serialized JSON object.
114-
The object can optionally contain a "db" string for session connection,
115-
and must contain a "roles" array. This array contains objects that holds
116-
a "role", and an optional "db" value, and is similar to the BSON document that
114+
The object can optionally contain a `db` string for session connection,
115+
and must contain a `roles` array. This array contains objects that holds
116+
a `role`, and an optional `db` value, and is similar to the BSON document that
117117
is accepted by MongoDB's `roles` field. Vault will transform this array into
118118
such format. For more information regarding the `roles` field, refer to
119119
[MongoDB's documentation](https://docs.mongodb.com/manual/reference/method/db.createUser/).
120120

121121
- `revocation_statements` `(string: "")` – Specifies the database statements to
122122
be executed to revoke a user. Must be a serialized JSON object, or a base64-encoded
123-
serialized JSON object. The object can optionally contain a "db" string. If no
124-
"db" value is provided, it defaults to the "admin" database.
123+
serialized JSON object. The object can optionally contain a `db` string. If no
124+
`db` value is provided, it defaults to the `admin` database.
125125

126126
### Sample Creation Statement
127127

website/content/api-docs/secret/databases/mongodbatlas.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ list the plugin does not support that statement type.
8080
- `default_ttl` `(string/int): 0` - Specifies the TTL for the leases associated with this role.
8181
Accepts time suffixed strings (`1h`) or an integer number of seconds. Defaults to system/engine default TTL time.
8282
- `max_ttl` `(string/int): 0` - Specifies the maximum TTL for the leases associated with this role. Accepts time
83-
suffixed strings (`1h`) or an integer number of seconds. Defaults to system/mount default TTL time; this value
83+
suffixed strings (`1h`) or an integer number of seconds. Defaults to `sys/mounts` default TTL time; this value
8484
is allowed to be less than the mount max TTL (or, if not set, the system max TTL),
8585
but it is not allowed to be longer. See also [The TTL General Case](/docs/concepts/tokens#the-general-case).
8686

website/content/api-docs/secret/databases/mssql.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ has a number of parameters to further configure a connection.
3838
`max_open_connections` it will be reduced to be equal.
3939

4040
- `max_connection_lifetime` `(string: "0s")` - Specifies the maximum amount of
41-
time a connection may be reused. If <= 0s connections are reused forever.
41+
time a connection may be reused. If <= `0s` connections are reused forever.
4242

4343
- `username` `(string: "")` - The root credential username used in the connection URL.
4444

@@ -116,10 +116,10 @@ list the plugin does not support that statement type.
116116
statements executed to create and configure a user. Must be a
117117
semicolon-separated string, a base64-encoded semicolon-separated string, a
118118
serialized JSON string array, or a base64-encoded serialized JSON string
119-
array. The '{{name}}' and '{{password}}' values will be substituted.
119+
array. The `{{name}}` and `{{password}}` values will be substituted.
120120

121121
- `revocation_statements` `(list: [])` Specifies the database statements to
122122
be executed to revoke a user. Must be a semicolon-separated string, a
123123
base64-encoded semicolon-separated string, a serialized JSON string array, or
124-
a base64-encoded serialized JSON string array. The '{{name}}' value will be
124+
a base64-encoded serialized JSON string array. The `{{name}}` value will be
125125
substituted. If not provided defaults to a generic drop user statement.

website/content/api-docs/secret/databases/mysql-maria.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ has a number of parameters to further configure a connection.
2626

2727
- `connection_url` `(string: <required>)` - Specifies the MySQL DSN. This field
2828
can be templated and supports passing the username and password
29-
parameters in the following format {{field_name}}. A templated connection URL is
29+
parameters in the following format `{{field_name}}`. A templated connection URL is
3030
required when using root credential rotation.
3131

3232
- `max_open_connections` `(int: 4)` - Specifies the maximum number of open
@@ -38,7 +38,7 @@ has a number of parameters to further configure a connection.
3838
`max_open_connections` it will be reduced to be equal.
3939

4040
- `max_connection_lifetime` `(string: "0s")` - Specifies the maximum amount of
41-
time a connection may be reused. If &lt;= 0s connections are reused forever.
41+
time a connection may be reused. If &le; 0s connections are reused forever.
4242

4343
- `username` `(string: "")` - The root credential username used in the connection URL.
4444

@@ -149,11 +149,11 @@ list the plugin does not support that statement type.
149149
statements executed to create and configure a user. Must be a
150150
semicolon-separated string, a base64-encoded semicolon-separated string, a
151151
serialized JSON string array, or a base64-encoded serialized JSON string
152-
array. The '{{name}}' and '{{password}}' values will be substituted. The
152+
array. The `{{name}}` and `{{password}}` values will be substituted. The
153153
generated password will be a random alphanumeric 20 character string.
154154

155155
- `revocation_statements` `(list: [])` – Specifies the database statements to
156156
be executed to revoke a user. Must be a semicolon-separated string, a
157157
base64-encoded semicolon-separated string, a serialized JSON string array, or
158-
a base64-encoded serialized JSON string array. The '{{name}}' value will be
158+
a base64-encoded serialized JSON string array. The `{{name}}` value will be
159159
substituted. If not provided defaults to a generic drop user statement.

website/content/api-docs/secret/databases/oracle.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ has a number of parameters to further configure a connection.
3535
`max_open_connections` it will be reduced to be equal.
3636

3737
- `max_connection_lifetime` `(string: "0s")` - Specifies the maximum amount of
38-
time a connection may be reused. If <= 0s connections are reused forever.
38+
time a connection may be reused. If <= `0s` connections are reused forever.
3939

4040
- `username` `(string: "")` - The root credential username used in the connection URL.
4141

@@ -109,10 +109,10 @@ list the plugin does not support that statement type.
109109
statements executed to create and configure a user. Must be a
110110
semicolon-separated string, a base64-encoded semicolon-separated string, a
111111
serialized JSON string array, or a base64-encoded serialized JSON string
112-
array. The '{{name}}' and '{{password}}' values will be substituted.
112+
array. The `{{name}}` and `{{password}}` values will be substituted.
113113

114114
- `revocation_statements` `(string: "")` Specifies the database statements to
115115
be executed to revoke a user. Must be a semicolon-separated string, a
116116
base64-encoded semicolon-separated string, a serialized JSON string array, or
117-
a base64-encoded serialized JSON string array. The '{{name}}' value will be
117+
a base64-encoded serialized JSON string array. The `{{name}}` value will be
118118
substituted. If not provided defaults to a generic drop user statement.

0 commit comments

Comments
 (0)