]> git.proxmox.com Git - ceph.git/blame - ceph/doc/radosgw/barbican.rst
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / doc / radosgw / barbican.rst
CommitLineData
7c673cae
FG
1==============================
2OpenStack Barbican Integration
3==============================
4
5OpenStack `Barbican`_ can be used as a secure key management service for
6`Server-Side Encryption`_.
7
8.. image:: ../images/rgw-encryption-barbican.png
9
10#. `Configure Keystone`_
11#. `Create a Keystone user`_
12#. `Configure the Ceph Object Gateway`_
13#. `Create a key in Barbican`_
14
15Configure Keystone
16==================
17
18Barbican depends on Keystone for authorization and access control of its keys.
19
20See `OpenStack Keystone Integration`_.
21
22Create a Keystone user
23======================
24
25Create a new user that will be used by the Ceph Object Gateway to retrieve
26keys.
27
28For example::
29
30 user = rgwcrypt-user
31 pass = rgwcrypt-password
32 tenant = rgwcrypt
33
34See OpenStack documentation for `Manage projects, users, and roles`_.
35
36Create a key in Barbican
37========================
38
39See Barbican documentation for `How to Create a Secret`_. Requests to
40Barbican must include a valid Keystone token in the ``X-Auth-Token`` header.
41
42Example request::
43
44 POST /v1/secrets HTTP/1.1
45 Host: barbican.example.com:9311
46 Accept: */*
47 Content-Type: application/json
48 X-Auth-Token: 7f7d588dd29b44df983bc961a6b73a10
49 Content-Length: 299
50
51 {
52 "name": "my-key",
53 "expiration": "2016-12-28T19:14:44.180394",
54 "algorithm": "aes",
55 "bit_length": 256,
56 "mode": "cbc",
57 "payload": "6b+WOZ1T3cqZMxgThRcXAQBrS5mXKdDUphvpxptl9/4=",
58 "payload_content_type": "application/octet-stream",
59 "payload_content_encoding": "base64"
60 }
61
62Response::
63
64 {"secret_ref": "http://barbican.example.com:9311/v1/secrets/d1e7ef3b-f841-4b7c-90b2-b7d90ca2d723"}
65
66In the response, ``d1e7ef3b-f841-4b7c-90b2-b7d90ca2d723`` is the key id that
67can be used in any `SSE-KMS`_ request.
68
69This newly created key is not accessible by user ``rgwcrypt-user``. This
70privilege must be added with an ACL.
71
72Example request (assuming that the Keystone id of ``rgwcrypt-user`` is
73``906aa90bd8a946c89cdff80d0869460f``)::
74
75 PUT /v1/secrets/d1e7ef3b-f841-4b7c-90b2-b7d90ca2d723/acl HTTP/1.1
76 Host: barbican.example.com:9311
77 Accept: */*
78 Content-Type: application/json
79 X-Auth-Token: 7f7d588dd29b44df983bc961a6b73a10
80 Content-Length: 101
81
82 {
83 "read":{
84 "users":[ "906aa90bd8a946c89cdff80d0869460f" ],
85 "project-access": true
86 }
87 }
88
89Response::
90
91 {"acl_ref": "http://barbican.example.com:9311/v1/secrets/d1e7ef3b-f841-4b7c-90b2-b7d90ca2d723/acl"}
92
93Configure the Ceph Object Gateway
94=================================
95
96Edit the Ceph configuration file to add information about the Barbican server
97and Keystone user::
98
99 rgw barbican url = http://barbican.example.com:9311
100 rgw keystone barbican user = rgwcrypt-user
101 rgw keystone barbican password = rgwcrypt-password
102
103When using Keystone API version 2::
104
105 rgw keystone barbican tenant = rgwcrypt
106
107When using API version 3::
108
109 rgw keystone barbican project
110 rgw keystone barbican domain
111
112
113.. _Barbican: https://wiki.openstack.org/wiki/Barbican
114.. _Server-Side Encryption: ../encryption
115.. _OpenStack Keystone Integration: ../keystone
116.. _Manage projects, users, and roles: https://docs.openstack.org/admin-guide/cli-manage-projects-users-and-roles.html#create-a-user
117.. _How to Create a Secret: https://developer.openstack.org/api-guide/key-manager/secrets.html#how-to-create-a-secret
118.. _SSE-KMS: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html
119.. _How to Set/Replace ACL: https://developer.openstack.org/api-guide/key-manager/acls.html#how-to-set-replace-acl