blob: c7cf95c3c580e18a79ee0f1e60fa88d529c3e2f4 [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 Shchelokovskyy65e241f2019-06-12 21:09:21 +0300153`ks_notifications_pool_name` allows to use keystone listener together with
154other applications listening on the same notifications topic without
155interference between services. Set it to any distinctive value to enable
156listener pooling. It is enabled by default with pool name 'barbican'.
157Disable it (by setting to empty string) only if underlying messaging transport
158does supports this feature or Barbican is the sole service listening for
159notifications on 'notifications' topic.
Petr Jediný1ff6f562017-08-09 14:38:09 +0200160
161.. code-block:: yaml
162
163 barbican:
164 server:
165 enabled: true
Pavlo Shchelokovskyy65e241f2019-06-12 21:09:21 +0300166 version: pike
Petr Jediný1ff6f562017-08-09 14:38:09 +0200167 ks_notifications_enable: true
168 ks_notifications_allow_requeue: true
Pavlo Shchelokovskyy65e241f2019-06-12 21:09:21 +0300169 ks_notifications_pool_name: barbican
Petr Jediný1ff6f562017-08-09 14:38:09 +0200170
171
Petr Jediný6e745fb2017-09-05 10:20:05 +0200172MySQL server has gone away
173
174MySQL uses a default `wait_timeout` of 8 hours, after which it will drop
175idle connections. This can result in 'MySQL Gone Away' exceptions. If you
176notice this, you can lower `sql_idle_timeout` to ensure that SQLAlchemy
Petr Jediný09886ec2017-09-06 22:20:38 +0200177reconnects before MySQL can drop the connection. If you run MySQL with HAProxy
178you need to consider haproxy client/server timeout parameters.
Petr Jediný6e745fb2017-09-05 10:20:05 +0200179
180.. code-block:: yaml
181
182 barbican:
183 server:
184 enabled: true
185 version: ocata
186 database:
187 engine: "mysql+pymysql"
188 host: 10.0.106.20
189 port: 3306
190 name: barbican
191 user: barbican
192 password: password
Petr Jediný09886ec2017-09-06 22:20:38 +0200193 sql_idle_timeout: 180
Petr Jediný6e745fb2017-09-05 10:20:05 +0200194
195
Kirill Bespalov95aa8022017-10-31 16:35:06 +0300196Configuring TLS communications
197------------------------------
198
Kirill Bespalov8d133302017-11-01 12:14:28 +0300199In order to trust remote server's certificate during establishing tls
200connection the CA cert must be provided at client side. By default
201system wide installed CA certs are used. You can change this behavior
202by specifying cacert_file and cacert params (optional).
203See examples below:
204
205
206- **RabbitMQ**
Kirill Bespalov95aa8022017-10-31 16:35:06 +0300207
208.. code-block:: yaml
209
210 barbican:
211 server:
212 message_queue:
213 port: 5671
214 ssl:
215 enabled: True
216 cacert: cert body if the cacert_file does not exists
217 cacert_file: /etc/openstack/rabbitmq-ca.pem
218
219
Kirill Bespalov8d133302017-11-01 12:14:28 +0300220- **MySQL**
221
222.. code-block:: yaml
223
224 barbican:
225 server:
226 database:
227 ssl:
228 enabled: True
229 cacert: cert body if the cacert_file does not exists
230 cacert_file: /etc/openstack/mysql-ca.pem
231
Kirill Bespalov95aa8022017-10-31 16:35:06 +0300232
Petr Jediný1ff6f562017-08-09 14:38:09 +0200233Configuring plugins
234-------------------
235
236Dogtag KRA
237
238.. code block:: yaml
239
240 barbican:
241 server:
242 plugin:
243 dogtag:
244 pem_path: '/etc/barbican/kra_admin_cert.pem'
245 dogtag_host: localhost
Petr Jedinýdcc90f82017-10-02 13:46:10 +0200246 dogtag_port: 8443
Petr Jediný1ff6f562017-08-09 14:38:09 +0200247 nss_db_path: '/etc/barbican/alias'
248 nss_db_path_ca: '/etc/barbican/alias-ca'
249 nss_password: 'password123'
250 simple_cmc_profile: 'caOtherCert'
251 ca_expiration_time: 1
252 plugin_working_dir: '/etc/barbican/dogtag'
253
Oleg Iurchenko622ef902017-12-13 01:40:04 +0200254There are few sources (engines) to define KRA admin cert:
255Engine #1: Define KRA admin cert by pillar.
256To define KRA admin cert by pillar need to define the following:
257.. code block:: yaml
258 barbican:
259 server:
260 dogtag_admin_cert:
261 engine: manual
262 key: |
263 ... key data ...
264Engine #2: Receive DogTag cert from Salt Mine.
265DogTag formula sends KRA cert to dogtag_admin_cert mine function.
266.. code block:: yaml
267 barbican:
268 server:
269 dogtag_admin_cert:
270 engine: mine
271 minion: ...name of minion which has installed DogTag..
272Engine #3: No operations.
273In case of some additional steps to install KRA certificate which
274are out of scope for the formula, the formula has 'noop' engine
275to perform no operations. If 'noop' engine is defined the formula will
276do nothing to install KRA admin cert.
277.. code block:: yaml
278 barbican:
279 server:
280 dogtag_admin_cert:
281 engine: noop
282
Petr Jediný1ff6f562017-08-09 14:38:09 +0200283KMIP HSM
284
285.. code block:: yaml
286
287 barbican:
288 server:
289 plugin:
290 kmip:
291 username: 'admin'
292 password: 'password'
293 host: localhost
294 port: 5696
295 keyfile: '/path/to/certs/cert.key'
296 certfile: '/path/to/certs/cert.crt'
297 ca_certs: '/path/to/certs/LocalCA.crt'
298
299
300PKCS11 HSM
301
302.. code block:: yaml
303
304 barbican:
305 server:
306 plugin:
307 p11_crypto:
308 library_path: '/usr/lib/libCryptoki2_64.so'
309 login: 'mypassword'
310 mkek_label: 'an_mkek'
311 mkek_length: 32
312 hmac_label: 'my_hmac_label'
313
Oleksandr Shyshko9c548ab2019-05-08 11:24:55 +0000314VAULT
315
316.. code block:: yaml
317
318 barbican:
319 server:
320 plugin:
321 vault:
322 schema: http
323 host: localhost
324 port: 8200
325 root_token_id: s.hpamtsbW5vcHFyc3R1dnd4eXo
326 approle_role_id: role_id
327 approle_secret_id: secret_id
328 kv_mountpoint: secret
329
330Vault supports secure connection. You able to define following fields for use security connection,
331also you should place file of certificate or define cert content in cacert field, in the last case
332`ssl_ca_crt_file` field required to define.
333
334.. code block:: yaml
335
336 barbican:
337 server:
338 plugin:
339 vault:
340 schema: https
341 ssl_ca_crt_file: '/etc/barbican/ssl/vault/CA.crt'
342 cacert: (certificate content)
Petr Jediný1ff6f562017-08-09 14:38:09 +0200343
344
345Software Only Crypto
346
347`kek` is key encryption key created from 32 bytes encoded as Base64. You should
348not use this in production.
349
350.. code block:: yaml
351
352 barbican:
353 server:
354 plugin:
355 simple_crypto:
356 kek: 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY='
357
358
359Secret stores
360-------------
361
362.. code-block:: yaml
363
364 barbican:
365 server:
366 plugin:
367 simple_crypto:
368 kek: "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY="
369 p11_crypto:
370 library_path: '/usr/lib/libCryptoki2_64.so'
371 login: 'mypassword'
372 mkek_label: 'an_mkek'
373 mkek_length: 32
374 hmac_label: 'my_hmac_label'
375 kmip:
376 username: 'admin'
377 password: 'password'
378 host: localhost
379 port: 5696
380 keyfile: '/path/to/certs/cert.key'
381 certfile: '/path/to/certs/cert.crt'
382 ca_certs: '/path/to/certs/LocalCA.crt'
383 dogtag:
384 pem_path: '/etc/barbican/kra_admin_cert.pem'
385 dogtag_host: localhost
Petr Jedinýdcc90f82017-10-02 13:46:10 +0200386 dogtag_port: 8443
Petr Jediný1ff6f562017-08-09 14:38:09 +0200387 nss_db_path: '/etc/barbican/alias'
388 nss_db_path_ca: '/etc/barbican/alias-ca'
389 nss_password: 'password123'
390 simple_cmc_profile: 'caOtherCert'
391 ca_expiration_time: 1
392 plugin_working_dir: '/etc/barbican/dogtag'
Oleksandr Shyshko9c548ab2019-05-08 11:24:55 +0000393 vault:
394 schema: http
395 host: localhost
396 port: 8200
397 root_token_id: s.hpamtsbW5vcHFyc3R1dnd4eXo
398 approle_role_id: role_id
399 approle_secret_id: secret_id
400 kv_mountpoint: secret
Petr Jediný1ff6f562017-08-09 14:38:09 +0200401 store:
402 software:
403 crypto_plugin: simple_crypto
404 store_plugin: store_crypto
405 global_default: True
406 kmip:
407 store_plugin: kmip_plugin
408 dogtag:
Petr Jedinýdcc90f82017-10-02 13:46:10 +0200409 store_plugin: dogtag_crypto
Petr Jediný1ff6f562017-08-09 14:38:09 +0200410 pkcs11:
411 store_plugin: store_crypto
412 crypto_plugin: p11_crypto
413
Mykyta Karpinae0e66b2018-04-23 18:51:31 +0300414Creating resources in barbican
415------------------------------
416
417To create a secret with payload from file in barbican, next pillar can be used:
418
419.. code-block:: yaml
420
421 barbican:
422 client:
423 enabled: True
424 resources:
425 v1:
426 enabled: true
Ann Taraday96dbd892018-11-19 18:22:45 +0400427 cloud_name: admin_identity
Mykyta Karpinae0e66b2018-04-23 18:51:31 +0300428 secrets:
429 TestSecret:
430 type: certificate
431 algorithm: RSA
432 payload_content_type: application/octet-stream
433 payload_content_encoding: base64
434 payload_path: /tmp/test.crt
435 encodeb64_payload: true
Ann Taraday96dbd892018-11-19 18:22:45 +0400436 acl:
437 TestSecret:
438 test_user:
439 enabled: True
440
441
442Sign image with barbican
443------------------------
444
445To sign image with given image name, secrect name and user credentials, can be
446used the following pillar:
447
448
449.. code-block:: yaml
450
451 barbican:
452 client:
453 enabled: True
454 signed_images:
455 v1:
456 enabled: true
457 images:
458 TestImage:
459 secret_name: 'TestSecret'
460 cert_key: /etc/test/certs/image.key
461 name: test-image-name
462 cloud_name: admin_identity
463
Mykyta Karpinae0e66b2018-04-23 18:51:31 +0300464
465
Oleksandr Shyshko6ccbafa2018-09-11 13:04:36 +0300466Enable x509 and ssl communication between Barbican and Galera cluster.
Ann Taraday96dbd892018-11-19 18:22:45 +0400467----------------------------------------------------------------------
Oleksandr Shyshko6ccbafa2018-09-11 13:04:36 +0300468By default communication between Barbican and Galera is unsecure.
469
470barbican:
471 server:
472 database:
473 x509:
474 enabled: True
475
476You able to set custom certificates in pillar:
477
478barbican:
479 server:
480 database:
481 x509:
482 cacert: (certificate content)
483 cert: (certificate content)
484 key: (certificate content)
485
486You can read more about it here:
487 https://docs.openstack.org/security-guide/databases/database-access-control.html
Petr Jedinýdd6387a2017-08-01 15:50:17 +0200488
Oleksandr Bryndzii1139fcc2018-10-04 12:58:30 +0300489Barbican server with memcached caching and security strategy:
490
491.. code-block:: yaml
492
493 barbican:
494 server:
495 enabled: true
496 ...
497 cache:
498 engine: memcached
499 members:
500 - host: 127.0.0.1
501 port: 11211
502 - host: 127.0.0.1
503 port: 11211
504 security:
505 enabled: true
506 strategy: ENCRYPT
507 secret_key: secret
508
Oleksandr Pidrepnyiad898b22019-05-13 16:53:21 +0300509Change default options using configmap template settings
510========================================================
511
512.. code-block:: yaml
513
514 barbican:
515 server:
516 configmap:
517 DEFAULT:
518 max_allowed_secret_in_bytes: 10000
519 max_allowed_request_size_in_bytes: 1000000
520 sql_pool_max_overflow: 10
521 default_limit_paging: 10
522 max_limit_paging: 100
523 quotas:
524 quota_secrets: -1
525 quota_orders: -1
526 quota_containers: -1
527 quota_consumers: -1
528 quota_cas: -1
529
Petr Jedinýdd6387a2017-08-01 15:50:17 +0200530Read more
531=========
532
533* https://docs.openstack.org/barbican/latest/