Skip to content

Commit 28606fd

Browse files
Merge pull request ceph#63228 from zdover23/wip-doc-2025-05-12-backport-63209-to-tentacle
tentacle: doc/radosgw: Cosmetic and formatting improvements in vault.rst
2 parents 1886028 + 07aadcf commit 28606fd

File tree

1 file changed

+56
-59
lines changed

1 file changed

+56
-59
lines changed

doc/radosgw/vault.rst

Lines changed: 56 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,15 @@ HashiCorp `Vault`_ can be used as a secure key management service for
3333
| | object | |
3434
| |------------------------------>|
3535
36-
#. `Vault secrets engines`_
37-
#. `Vault authentication`_
38-
#. `Vault namespaces`_
39-
#. `Create a key in Vault`_
40-
#. `Configure the Ceph Object Gateway`_
41-
#. `Upload object`_
36+
.. contents:: :depth: 2
4237

4338
Some examples below use the Vault command line utility to interact with
4439
Vault. You may need to set the following environment variable with the correct
4540
address of your Vault server to use this utility::
4641

4742
export VAULT_ADDR='https://vault-server-fqdn:8200'
4843

49-
Vault secrets engines
44+
Vault Secrets Engines
5045
=====================
5146

5247
Vault provides several secrets engines, which can store, generate, and encrypt
@@ -55,7 +50,7 @@ data. Currently, the Object Gateway supports:
5550
- `KV secrets engine`_ version 2
5651
- `Transit engine`_
5752

58-
KV secrets engine
53+
KV Secrets Engine
5954
-----------------
6055

6156
The KV secrets engine is used to store arbitrary key/value secrets in Vault. To
@@ -68,7 +63,7 @@ following setting::
6863

6964
rgw crypt vault secret engine = kv
7065

71-
Transit secrets engine
66+
Transit Secrets Engine
7267
----------------------
7368

7469
The transit engine handles cryptographic functions on data in-transit. To enable
@@ -81,7 +76,7 @@ following setting::
8176

8277
rgw crypt vault secret engine = transit
8378

84-
Vault authentication
79+
Vault Authentication
8580
====================
8681

8782
Vault supports several authentication mechanisms. Currently, the Object
@@ -93,7 +88,7 @@ sort of Vault token that does not have a lifetime are root tokens.
9388
For all other tokens, it is necessary to periodically refresh them,
9489
either by performing initial authentication, or by renewing the token.
9590
Ceph does not have any logic to perform either operation.
96-
The simplest best way to use Vault tokens with ceph is to
91+
The simplest best way to use Vault tokens with Ceph is to
9792
also run the Vault agent and have it refresh the token file.
9893
When the Vault agent is used in this mode, file system permissions
9994
can be used to restrict who has the use of tokens.
@@ -103,26 +98,26 @@ to act as a proxy server. In this mode, Vault will add a token when
10398
necessary and add it to requests passed to it before forwarding them on
10499
to the real server. Vault agent will still handle token renewal just
105100
as it would when storing a token in the filesystem. In this mode, it
106-
is necessary to properly secure the network path rgw uses to reach the
101+
is necessary to properly secure the network path RGW uses to reach the
107102
Vault agent, such as having the Vault agent listen only to localhost.
108103

109-
Token policies for the object gateway
104+
Token Policies for the Object Gateway
110105
-------------------------------------
111106

112107
All Vault tokens have powers as specified by the polices attached
113108
to that token. Multiple policies may be associated with one
114109
token. You should only use the policies necessary for your
115110
configuration.
116111

117-
When using the kv secret engine with the object gateway::
112+
When using the KV secret engine with the Object Gateway::
118113

119114
vault policy write rgw-kv-policy -<<EOF
120115
path "secret/data/*" {
121116
capabilities = ["read"]
122117
}
123118
EOF
124119

125-
When using the transit secret engine with the object gateway::
120+
When using the transit secret engine with the Object Gateway::
126121

127122
vault policy write rgw-transit-policy -<<EOF
128123
path "transit/keys/*" {
@@ -147,7 +142,7 @@ When using the transit secret engine with the object gateway::
147142
}
148143
EOF
149144

150-
If you had previously used an older version of ceph with the
145+
If you had previously used an older version of Ceph with the
151146
transit secret engine, you might need the following policy::
152147

153148
vault policy write old-rgw-transit-policy -<<EOF
@@ -156,23 +151,23 @@ transit secret engine, you might need the following policy::
156151
}
157152
EOF
158153

159-
If you are using both sse-kms and sse-s3, then you should point
154+
If you are using both SSE-KMS and SSE-S3, then you should point
160155
each to separate containers. You could either use separate
161-
vault instances, or you could use either separately mounted
156+
Vault instances, or you could use either separately mounted
162157
transit instances, or different branches under a common transit
163-
point. If you are not using separate vault instances, you can
164-
use these to point kms and sse-s3 to separate containers:
158+
point. If you are not using separate Vault instances, you can
159+
use these to point SSE-KMS and SSE-S3 to separate containers:
165160
``rgw_crypt_vault_prefix``
166161
and/or
167162
``rgw_crypt_sse_s3_vault_prefix``.
168-
When granting vault permissions to sse-kms bucket owners, you should
169-
not give them permission to muck around with sse-s3 keys;
170-
only ceph itself should be doing that.
163+
When granting Vault permissions to SSE-KMS bucket owners, you should
164+
not give them permission to muck around with SSE-S3 keys;
165+
only Ceph itself should be doing that.
171166

172-
Token authentication
167+
Token Authentication
173168
--------------------
174169

175-
.. note: Never use root tokens with ceph in production environments.
170+
.. note: Never use root tokens with Ceph in production environments.
176171
177172
The token authentication method expects a Vault token to be present in a
178173
plaintext file. The Object Gateway can be configured to use token authentication
@@ -186,7 +181,7 @@ Adjust these settings to match your configuration.
186181
For security reasons, the token file must be readable by the Object Gateway
187182
only.
188183

189-
Vault agent
184+
Vault Agent
190185
-----------
191186

192187
The Vault agent is a client daemon that provides authentication to Vault and
@@ -200,25 +195,27 @@ settings::
200195
rgw crypt vault auth = agent
201196
rgw crypt vault addr = http://127.0.0.1:8100
202197

203-
You might set up vault agent as follows::
198+
You might set up Vault agent as follows::
204199

205200
vault write auth/approle/role/rgw-ap \
206201
token_policies=rgw-transit-policy,default \
207202
token_max_ttl=60m
208203

209204
Change the policy here to match your configuration.
210205

211-
Get the role-id:
206+
Get the role-id::
207+
212208
vault read auth/approle/role/rgw-ap/role-id -format=json | \
213209
jq -r .data.role_id
214210

215-
Store the output in some file, such as /usr/local/etc/vault/.rgw-ap-role-id
211+
Store the output in some file, such as ``/usr/local/etc/vault/.rgw-ap-role-id``.
212+
213+
Get the secret-id::
216214

217-
Get the secret-id:
218215
vault read auth/approle/role/rgw-ap/role-id -format=json | \
219216
jq -r .data.role_id
220217

221-
Store the output in some file, such as /usr/local/etc/vault/.rgw-ap-secret-id
218+
Store the output in some file, such as ``/usr/local/etc/vault/.rgw-ap-secret-id``.
222219

223220
Create configuration for the Vault agent, such as::
224221

@@ -249,11 +246,11 @@ a persistent daemon with the following arguments::
249246

250247
/usr/local/bin/vault agent -config=/usr/local/etc/vault/rgw-agent.hcl
251248

252-
Once the vault agent is running, you should find it listening
249+
Once the Vault agent is running, you should find it listening
253250
to port 8100 on localhost, and you should be able to interact
254-
with it using the vault command.
251+
with it using the ``vault`` command.
255252

256-
Vault namespaces
253+
Vault Namespaces
257254
================
258255

259256
In the Enterprise version, Vault supports the concept of `namespaces`_, which
@@ -265,13 +262,13 @@ namespace using the following configuration setting::
265262

266263
rgw crypt vault namespace = tenant1
267264

268-
Create a key in Vault
265+
Create a Key in Vault
269266
=====================
270267

271268
.. note:: Keys for server-side encryption must be 256-bit long and base-64
272269
encoded.
273270

274-
Using the KV engine
271+
Using the KV Engine
275272
-------------------
276273

277274
A key for server-side encryption can be created in the KV version 2 engine using
@@ -290,13 +287,13 @@ Sample output::
290287
version 1
291288

292289
Note that in the KV secrets engine, secrets are stored as key-value pairs, and
293-
the Gateway expects the key name to be ``key``, i.e. the secret must be in the
290+
the Object Gateway expects the key name to be ``key``, i.e. the secret must be in the
294291
form ``key=<secret key>``.
295292

296-
Using the Transit engine
293+
Using the Transit Engine
297294
------------------------
298295

299-
Keys created for use with the Transit engine should no longer be marked
296+
Keys created for use with the transit engine should no longer be marked
300297
exportable. They can be created with::
301298

302299
vault write -f transit/keys/mybucketkey
@@ -347,8 +344,8 @@ Optionally, set the Vault namespace where encryption keys will be fetched from::
347344

348345
rgw crypt vault namespace = tenant1
349346

350-
Finally, the URLs where the Gateway will retrieve encryption keys from Vault can
351-
be restricted by setting a path prefix. For instance, the Gateway can be
347+
Finally, the URLs where the Object Gateway will retrieve encryption keys from Vault can
348+
be restricted by setting a path prefix. For instance, the Object Gateway can be
352349
restricted to fetch KV keys as follows::
353350

354351
rgw crypt vault prefix = /v1/secret/data
@@ -357,28 +354,28 @@ Or, when using the transit secret engine::
357354

358355
rgw crypt vault prefix = /v1/transit
359356

360-
In the example above, the Gateway would only fetch transit encryption keys under
357+
In the example above, the Object Gateway would only fetch transit encryption keys under
361358
``https://vault-server:8200/v1/transit``.
362359

363-
You can use custom ssl certs to authenticate with vault with help of
360+
You can use custom SSL certificates to authenticate with Vault with help of
364361
following options::
365362

366363
rgw crypt vault verify ssl = true
367364
rgw crypt vault ssl cacert = /etc/ceph/vault.ca
368365
rgw crypt vault ssl clientcert = /etc/ceph/vault.crt
369366
rgw crypt vault ssl clientkey = /etc/ceph/vault.key
370367

371-
where vault.ca is CA certificate and vault.key/vault.crt are private key and ssl
372-
certificate generated for RGW to access the vault server. It highly recommended to
373-
set this option true, setting false is very dangerous and need to avoid since this
368+
where ``vault.ca`` is CA certificate and ``vault.key``/``vault.crt`` are private key and SSL
369+
certificate generated for RGW to access the Vault server. It is highly recommended to
370+
set this option to the value ``true``, setting ``false`` is very dangerous and needs to be avoided since this
374371
runs in very secured environments.
375372

376-
Transit engine compatibility support
373+
Transit Engine Compatibility Support
377374
------------------------------------
378375
The transit engine has compatibility support for previous
379-
versions of ceph, which used the transit engine as a simple key store.
376+
versions of Ceph, which used the transit engine as a simple key store.
380377

381-
There is a "compat" option which can be given to the transit
378+
There is a ``compat`` option which can be given to the transit
382379
engine to configure the compatibility support,
383380

384381
To entirely disable backwards support, use::
@@ -394,22 +391,22 @@ This is the normal default with the current version::
394391

395392
This enables the new engine for newly created objects,
396393
but still allows the old engine to be used for old objects.
397-
In order to access old and new objects, the vault token given
398-
to ceph must have both the old and new transit policies.
394+
In order to access old and new objects, the Vault token given
395+
to Ceph must have both the old and new transit policies.
399396

400397
To force use of only the old engine, use::
401398

402399
rgw crypt vault secret engine = transit compat=2
403400

404-
This mode is automatically selected if the vault prefix
405-
ends in export/encryption-key, which was the previously
401+
This mode is automatically selected if the Vault prefix
402+
ends in ``export/encryption-key``, which was the previously
406403
documented setting.
407404

408-
Upload object
405+
Upload Object
409406
=============
410407

411-
When uploading an object to the Gateway, provide the SSE key ID in the request.
412-
As an example, for the kv engine, using the AWS command-line client::
408+
When uploading an object to the Object Gateway, provide the SSE key ID in the request.
409+
As an example, for the KV engine, using the AWS command-line client::
413410

414411
aws --endpoint=http://radosgw:8000 s3 cp plaintext.txt s3://mybucket/encrypted.txt --sse=aws:kms --sse-kms-key-id myproject/mybucketkey
415412
@@ -418,18 +415,18 @@ As an example, for the transit engine (new flavor), using the AWS command-line c
418415
aws --endpoint=http://radosgw:8000 s3 cp plaintext.txt s3://mybucket/encrypted.txt --sse=aws:kms --sse-kms-key-id mybucketkey
419416

420417
The Object Gateway will fetch the key from Vault, encrypt the object and store
421-
it in the bucket. Any request to download the object will make the Gateway
418+
it in the bucket. Any request to download the object will make the Object Gateway
422419
automatically retrieve the correspondent key from Vault and decrypt the object.
423420

424421
Note that the secret will be fetched from Vault using a URL constructed by
425422
concatenating the base address (``rgw crypt vault addr``), the (optional)
426423
URL prefix (``rgw crypt vault prefix``), and finally the key ID.
427424

428-
In the kv engine example above, the Gateway would fetch the secret from::
425+
In the KV engine example above, the Object Gateway would fetch the secret from::
429426

430427
http://vaultserver:8200/v1/secret/data/myproject/mybucketkey
431428

432-
In the transit engine example above, the Gateway would encrypt the secret using this key::
429+
In the transit engine example above, the Object Gateway would encrypt the secret using this key::
433430

434431
http://vaultserver:8200/v1/transit/mybucketkey
435432

0 commit comments

Comments
 (0)