blob: eec3a6d2deb3e11a31e10dfde1d837282a7ddb8b [file] [log] [blame]
Petr Jedinýdd6387a2017-08-01 15:50:17 +02001
Petr Jediný1ff6f562017-08-09 14:38:09 +02002================
3Barbican formula
4================
Petr Jedinýdd6387a2017-08-01 15:50:17 +02005
6Barbican is a REST API designed for the secure storage, provisioning and
7management of secrets such as passwords, encryption keys and X.509 Certificates.
8It is aimed at being useful for all environments, including large ephemeral
9Clouds.
10
11Sample pillars
12==============
13
Petr Jediný1ff6f562017-08-09 14:38:09 +020014Barbican cluster service
Petr Jedinýdd6387a2017-08-01 15:50:17 +020015
16.. code-block:: yaml
17
18 barbican:
19 server:
20 enabled: true
21 version: ocata
Petr Jediný1ff6f562017-08-09 14:38:09 +020022 host_href: ''
23 is_proxied: true
24 plugin:
25 simple_crypto:
26 kek: "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY="
27 store:
28 software:
29 crypto_plugin: simple_crypto
30 store_plugin: store_crypto
31 global_default: True
32 database:
33 engine: "mysql+pymysql"
34 host: 10.0.106.20
35 port: 3306
36 name: barbican
37 user: barbican
38 password: password
39 bind:
40 address: 10.0.106.20
41 port: 9311
42 admin_port: 9312
43 identity:
44 engine: keystone
45 host: 10.0.106.20
46 port: 35357
47 domain: default
48 tenant: service
49 user: barbican
50 password: password
51 message_queue:
52 engine: rabbitmq
53 user: openstack
54 password: password
55 virtual_host: '/openstack'
56 members:
57 - host: 10.10.10.10
58 port: 5672
59 - host: 10.10.10.11
60 port: 5672
61 - host: 10.10.10.12
62 port: 5672
63 cache:
64 members:
65 - host: 10.10.10.10
66 port: 11211
67 - host: 10.10.10.11
68 port: 11211
69 - host: 10.10.10.12
70 port: 11211
71
sgarbuza9931392018-07-19 10:44:20 +030072Enhanced logging with logging.conf
73----------------------------------
74
75By default logging.conf is disabled.
76
77That is possible to enable per-binary logging.conf with new variables:
78 * openstack_log_appender - set it to true to enable log_config_append for all OpenStack services;
79 * openstack_fluentd_handler_enabled - set to true to enable FluentHandler for all Openstack services.
80 * openstack_ossyslog_handler_enabled - set to true to enable OSSysLogHandler for all Openstack services.
81
82Only WatchedFileHandler, OSSysLogHandler and FluentHandler are available.
83
84Also it is possible to configure this with pillar:
85
86.. code-block:: yaml
87
88 barbican:
89 server:
90 logging:
91 log_appender: true
92 log_handlers:
93 watchedfile:
94 enabled: true
95 fluentd:
96 enabled: true
97 ossyslog:
98 enabled: true
99
Petr Jediný1ff6f562017-08-09 14:38:09 +0200100Running behind loadbalancer
101
102If you are running behind loadbalancer, set the `host_href` to load balancer's
103address. You can set `host_href` empty and the api attempts autodetect correct
104address from http requests.
105
106.. code-block:: yaml
107
108 barbican:
109 server:
110 enabled: true
111 version: ocata
112 host_href: ''
113
114
115Running behind proxy
116
117If you are running behind proxy, set the `is_proxied` parameter to `true`. This
118will allow `host_href` autodetection with help of proxy headers such as
119`X-FORWARDED-FOR` and `X-FORWARDED-PROTO`.
120
121.. code-block:: yaml
122
123 barbican:
124 server:
125 enabled: true
126 version: ocata
127 host_href: ''
128 is_proxied: true
129
130Queuing asynchronous messaging
131
132By default is `async_queues_enable` set `false` to invoke worker tasks
133synchronously (i.e. no-queue standalone mode). To enable queuing asynchronous
134messaging you need to set it true.
135
136.. code-block:: yaml
137
138 barbican:
139 server:
140 enabled: true
141 version: ocata
142 async_queues_enable: true
143
144Keystone notification listener
145
146To enable keystone notification listener, set the `ks_notification_enable`
147to true.
Pavlo Shchelokovskyy65e241f2019-06-12 21:09:21 +0300148
Petr Jediný1ff6f562017-08-09 14:38:09 +0200149`ks_notifications_allow_requeue` enables requeue feature in case of
150notification processing error. Enable this only when underlying transport
151supports this feature.
152
Pavlo Shchelokovskyyf70167c2019-06-19 10:14:49 +0300153`ks_notifications_topic` (defaults to 'notifications') allows to set
154name of the topic to listen for Keystone notifications on. Note that Keystone
155must also be configured to send notifications to this topic.
156If Barbican version and messaging back end support listener pooling,
157it is preferable to leave this value as default and use
158`ks_notifications_pool_name` (see below).
159
160`ks_notifications_pool_name` (Since Pike release) allows to use keystone
161listener together with other applications listening on the same notifications
162topic without interference between services.
163Set it to any distinctive value to enable listener pooling.
164It is enabled by default with pool name 'barbican'.
Pavlo Shchelokovskyy65e241f2019-06-12 21:09:21 +0300165Disable it (by setting to empty string) only if underlying messaging transport
Pavlo Shchelokovskyyf70167c2019-06-19 10:14:49 +0300166does not support this feature or Barbican is the sole service listening for
167notifications on `ks_notifications_topic` (default is 'notifications') topic.
Petr Jediný1ff6f562017-08-09 14:38:09 +0200168
169.. code-block:: yaml
170
171 barbican:
172 server:
173 enabled: true
Pavlo Shchelokovskyy65e241f2019-06-12 21:09:21 +0300174 version: pike
Petr Jediný1ff6f562017-08-09 14:38:09 +0200175 ks_notifications_enable: true
176 ks_notifications_allow_requeue: true
Pavlo Shchelokovskyy65e241f2019-06-12 21:09:21 +0300177 ks_notifications_pool_name: barbican
Petr Jediný1ff6f562017-08-09 14:38:09 +0200178
179
Petr Jediný6e745fb2017-09-05 10:20:05 +0200180MySQL server has gone away
181
182MySQL uses a default `wait_timeout` of 8 hours, after which it will drop
183idle connections. This can result in 'MySQL Gone Away' exceptions. If you
184notice this, you can lower `sql_idle_timeout` to ensure that SQLAlchemy
Petr Jediný09886ec2017-09-06 22:20:38 +0200185reconnects before MySQL can drop the connection. If you run MySQL with HAProxy
186you need to consider haproxy client/server timeout parameters.
Petr Jediný6e745fb2017-09-05 10:20:05 +0200187
188.. code-block:: yaml
189
190 barbican:
191 server:
192 enabled: true
193 version: ocata
194 database:
195 engine: "mysql+pymysql"
196 host: 10.0.106.20
197 port: 3306
198 name: barbican
199 user: barbican
200 password: password
Petr Jediný09886ec2017-09-06 22:20:38 +0200201 sql_idle_timeout: 180
Petr Jediný6e745fb2017-09-05 10:20:05 +0200202
203
Kirill Bespalov95aa8022017-10-31 16:35:06 +0300204Configuring TLS communications
205------------------------------
206
Kirill Bespalov8d133302017-11-01 12:14:28 +0300207In order to trust remote server's certificate during establishing tls
208connection the CA cert must be provided at client side. By default
209system wide installed CA certs are used. You can change this behavior
210by specifying cacert_file and cacert params (optional).
211See examples below:
212
213
214- **RabbitMQ**
Kirill Bespalov95aa8022017-10-31 16:35:06 +0300215
216.. code-block:: yaml
217
218 barbican:
219 server:
220 message_queue:
221 port: 5671
222 ssl:
223 enabled: True
224 cacert: cert body if the cacert_file does not exists
225 cacert_file: /etc/openstack/rabbitmq-ca.pem
226
227
Kirill Bespalov8d133302017-11-01 12:14:28 +0300228- **MySQL**
229
230.. code-block:: yaml
231
232 barbican:
233 server:
234 database:
235 ssl:
236 enabled: True
237 cacert: cert body if the cacert_file does not exists
238 cacert_file: /etc/openstack/mysql-ca.pem
239
Kirill Bespalov95aa8022017-10-31 16:35:06 +0300240
Petr Jediný1ff6f562017-08-09 14:38:09 +0200241Configuring plugins
242-------------------
243
244Dogtag KRA
245
246.. code block:: yaml
247
248 barbican:
249 server:
250 plugin:
251 dogtag:
252 pem_path: '/etc/barbican/kra_admin_cert.pem'
253 dogtag_host: localhost
Petr Jedinýdcc90f82017-10-02 13:46:10 +0200254 dogtag_port: 8443
Petr Jediný1ff6f562017-08-09 14:38:09 +0200255 nss_db_path: '/etc/barbican/alias'
256 nss_db_path_ca: '/etc/barbican/alias-ca'
257 nss_password: 'password123'
258 simple_cmc_profile: 'caOtherCert'
259 ca_expiration_time: 1
260 plugin_working_dir: '/etc/barbican/dogtag'
261
Oleg Iurchenko622ef902017-12-13 01:40:04 +0200262There are few sources (engines) to define KRA admin cert:
263Engine #1: Define KRA admin cert by pillar.
264To define KRA admin cert by pillar need to define the following:
265.. code block:: yaml
266 barbican:
267 server:
268 dogtag_admin_cert:
269 engine: manual
270 key: |
271 ... key data ...
272Engine #2: Receive DogTag cert from Salt Mine.
273DogTag formula sends KRA cert to dogtag_admin_cert mine function.
274.. code block:: yaml
275 barbican:
276 server:
277 dogtag_admin_cert:
278 engine: mine
279 minion: ...name of minion which has installed DogTag..
280Engine #3: No operations.
281In case of some additional steps to install KRA certificate which
282are out of scope for the formula, the formula has 'noop' engine
283to perform no operations. If 'noop' engine is defined the formula will
284do nothing to install KRA admin cert.
285.. code block:: yaml
286 barbican:
287 server:
288 dogtag_admin_cert:
289 engine: noop
290
Petr Jediný1ff6f562017-08-09 14:38:09 +0200291KMIP HSM
292
293.. code block:: yaml
294
295 barbican:
296 server:
297 plugin:
298 kmip:
299 username: 'admin'
300 password: 'password'
301 host: localhost
302 port: 5696
303 keyfile: '/path/to/certs/cert.key'
304 certfile: '/path/to/certs/cert.crt'
305 ca_certs: '/path/to/certs/LocalCA.crt'
306
307
308PKCS11 HSM
309
310.. code block:: yaml
311
312 barbican:
313 server:
314 plugin:
315 p11_crypto:
316 library_path: '/usr/lib/libCryptoki2_64.so'
317 login: 'mypassword'
318 mkek_label: 'an_mkek'
319 mkek_length: 32
320 hmac_label: 'my_hmac_label'
321
Oleksandr Shyshko9c548ab2019-05-08 11:24:55 +0000322VAULT
323
324.. code block:: yaml
325
326 barbican:
327 server:
328 plugin:
329 vault:
330 schema: http
331 host: localhost
332 port: 8200
333 root_token_id: s.hpamtsbW5vcHFyc3R1dnd4eXo
334 approle_role_id: role_id
335 approle_secret_id: secret_id
336 kv_mountpoint: secret
337
338Vault supports secure connection. You able to define following fields for use security connection,
339also you should place file of certificate or define cert content in cacert field, in the last case
340`ssl_ca_crt_file` field required to define.
341
342.. code block:: yaml
343
344 barbican:
345 server:
346 plugin:
347 vault:
348 schema: https
349 ssl_ca_crt_file: '/etc/barbican/ssl/vault/CA.crt'
350 cacert: (certificate content)
Petr Jediný1ff6f562017-08-09 14:38:09 +0200351
352
353Software Only Crypto
354
355`kek` is key encryption key created from 32 bytes encoded as Base64. You should
356not use this in production.
357
358.. code block:: yaml
359
360 barbican:
361 server:
362 plugin:
363 simple_crypto:
364 kek: 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY='
365
366
367Secret stores
368-------------
369
370.. code-block:: yaml
371
372 barbican:
373 server:
374 plugin:
375 simple_crypto:
376 kek: "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY="
377 p11_crypto:
378 library_path: '/usr/lib/libCryptoki2_64.so'
379 login: 'mypassword'
380 mkek_label: 'an_mkek'
381 mkek_length: 32
382 hmac_label: 'my_hmac_label'
383 kmip:
384 username: 'admin'
385 password: 'password'
386 host: localhost
387 port: 5696
388 keyfile: '/path/to/certs/cert.key'
389 certfile: '/path/to/certs/cert.crt'
390 ca_certs: '/path/to/certs/LocalCA.crt'
391 dogtag:
392 pem_path: '/etc/barbican/kra_admin_cert.pem'
393 dogtag_host: localhost
Petr Jedinýdcc90f82017-10-02 13:46:10 +0200394 dogtag_port: 8443
Petr Jediný1ff6f562017-08-09 14:38:09 +0200395 nss_db_path: '/etc/barbican/alias'
396 nss_db_path_ca: '/etc/barbican/alias-ca'
397 nss_password: 'password123'
398 simple_cmc_profile: 'caOtherCert'
399 ca_expiration_time: 1
400 plugin_working_dir: '/etc/barbican/dogtag'
Oleksandr Shyshko9c548ab2019-05-08 11:24:55 +0000401 vault:
402 schema: http
403 host: localhost
404 port: 8200
405 root_token_id: s.hpamtsbW5vcHFyc3R1dnd4eXo
406 approle_role_id: role_id
407 approle_secret_id: secret_id
408 kv_mountpoint: secret
Petr Jediný1ff6f562017-08-09 14:38:09 +0200409 store:
410 software:
411 crypto_plugin: simple_crypto
412 store_plugin: store_crypto
413 global_default: True
414 kmip:
415 store_plugin: kmip_plugin
416 dogtag:
Petr Jedinýdcc90f82017-10-02 13:46:10 +0200417 store_plugin: dogtag_crypto
Petr Jediný1ff6f562017-08-09 14:38:09 +0200418 pkcs11:
419 store_plugin: store_crypto
420 crypto_plugin: p11_crypto
421
Mykyta Karpinae0e66b2018-04-23 18:51:31 +0300422Creating resources in barbican
423------------------------------
424
425To create a secret with payload from file in barbican, next pillar can be used:
426
427.. code-block:: yaml
428
429 barbican:
430 client:
431 enabled: True
432 resources:
433 v1:
434 enabled: true
Ann Taraday96dbd892018-11-19 18:22:45 +0400435 cloud_name: admin_identity
Mykyta Karpinae0e66b2018-04-23 18:51:31 +0300436 secrets:
437 TestSecret:
438 type: certificate
439 algorithm: RSA
440 payload_content_type: application/octet-stream
441 payload_content_encoding: base64
442 payload_path: /tmp/test.crt
443 encodeb64_payload: true
Ann Taraday96dbd892018-11-19 18:22:45 +0400444 acl:
445 TestSecret:
446 test_user:
447 enabled: True
448
449
450Sign image with barbican
451------------------------
452
453To sign image with given image name, secrect name and user credentials, can be
454used the following pillar:
455
456
457.. code-block:: yaml
458
459 barbican:
460 client:
461 enabled: True
462 signed_images:
463 v1:
464 enabled: true
465 images:
466 TestImage:
467 secret_name: 'TestSecret'
468 cert_key: /etc/test/certs/image.key
469 name: test-image-name
470 cloud_name: admin_identity
471
Mykyta Karpinae0e66b2018-04-23 18:51:31 +0300472
473
Oleksandr Shyshko6ccbafa2018-09-11 13:04:36 +0300474Enable x509 and ssl communication between Barbican and Galera cluster.
Ann Taraday96dbd892018-11-19 18:22:45 +0400475----------------------------------------------------------------------
Oleksandr Shyshko6ccbafa2018-09-11 13:04:36 +0300476By default communication between Barbican and Galera is unsecure.
477
478barbican:
479 server:
480 database:
481 x509:
482 enabled: True
483
484You able to set custom certificates in pillar:
485
486barbican:
487 server:
488 database:
489 x509:
490 cacert: (certificate content)
491 cert: (certificate content)
492 key: (certificate content)
493
494You can read more about it here:
495 https://docs.openstack.org/security-guide/databases/database-access-control.html
Petr Jedinýdd6387a2017-08-01 15:50:17 +0200496
Oleksandr Bryndzii1139fcc2018-10-04 12:58:30 +0300497Barbican server with memcached caching and security strategy:
498
499.. code-block:: yaml
500
501 barbican:
502 server:
503 enabled: true
504 ...
505 cache:
506 engine: memcached
507 members:
508 - host: 127.0.0.1
509 port: 11211
510 - host: 127.0.0.1
511 port: 11211
512 security:
513 enabled: true
514 strategy: ENCRYPT
515 secret_key: secret
516
Oleksandr Pidrepnyiad898b22019-05-13 16:53:21 +0300517Change default options using configmap template settings
518========================================================
519
520.. code-block:: yaml
521
522 barbican:
523 server:
524 configmap:
525 DEFAULT:
526 max_allowed_secret_in_bytes: 10000
527 max_allowed_request_size_in_bytes: 1000000
528 sql_pool_max_overflow: 10
529 default_limit_paging: 10
530 max_limit_paging: 100
531 quotas:
532 quota_secrets: -1
533 quota_orders: -1
534 quota_containers: -1
535 quota_consumers: -1
536 quota_cas: -1
537
Petr Jedinýdd6387a2017-08-01 15:50:17 +0200538Read more
539=========
540
541* https://docs.openstack.org/barbican/latest/