Petr Jediný | dd6387a | 2017-08-01 15:50:17 +0200 | [diff] [blame] | 1 | |
Petr Jediný | 1ff6f56 | 2017-08-09 14:38:09 +0200 | [diff] [blame] | 2 | ================ |
| 3 | Barbican formula |
| 4 | ================ |
Petr Jediný | dd6387a | 2017-08-01 15:50:17 +0200 | [diff] [blame] | 5 | |
| 6 | Barbican is a REST API designed for the secure storage, provisioning and |
| 7 | management of secrets such as passwords, encryption keys and X.509 Certificates. |
| 8 | It is aimed at being useful for all environments, including large ephemeral |
| 9 | Clouds. |
| 10 | |
| 11 | Sample pillars |
| 12 | ============== |
| 13 | |
Petr Jediný | 1ff6f56 | 2017-08-09 14:38:09 +0200 | [diff] [blame] | 14 | Barbican cluster service |
Petr Jediný | dd6387a | 2017-08-01 15:50:17 +0200 | [diff] [blame] | 15 | |
| 16 | .. code-block:: yaml |
| 17 | |
| 18 | barbican: |
| 19 | server: |
| 20 | enabled: true |
| 21 | version: ocata |
Petr Jediný | 1ff6f56 | 2017-08-09 14:38:09 +0200 | [diff] [blame] | 22 | 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 | |
| 72 | Running behind loadbalancer |
| 73 | |
| 74 | If you are running behind loadbalancer, set the `host_href` to load balancer's |
| 75 | address. You can set `host_href` empty and the api attempts autodetect correct |
| 76 | address from http requests. |
| 77 | |
| 78 | .. code-block:: yaml |
| 79 | |
| 80 | barbican: |
| 81 | server: |
| 82 | enabled: true |
| 83 | version: ocata |
| 84 | host_href: '' |
| 85 | |
| 86 | |
| 87 | Running behind proxy |
| 88 | |
| 89 | If you are running behind proxy, set the `is_proxied` parameter to `true`. This |
| 90 | will allow `host_href` autodetection with help of proxy headers such as |
| 91 | `X-FORWARDED-FOR` and `X-FORWARDED-PROTO`. |
| 92 | |
| 93 | .. code-block:: yaml |
| 94 | |
| 95 | barbican: |
| 96 | server: |
| 97 | enabled: true |
| 98 | version: ocata |
| 99 | host_href: '' |
| 100 | is_proxied: true |
| 101 | |
| 102 | Queuing asynchronous messaging |
| 103 | |
| 104 | By default is `async_queues_enable` set `false` to invoke worker tasks |
| 105 | synchronously (i.e. no-queue standalone mode). To enable queuing asynchronous |
| 106 | messaging you need to set it true. |
| 107 | |
| 108 | .. code-block:: yaml |
| 109 | |
| 110 | barbican: |
| 111 | server: |
| 112 | enabled: true |
| 113 | version: ocata |
| 114 | async_queues_enable: true |
| 115 | |
| 116 | Keystone notification listener |
| 117 | |
| 118 | To enable keystone notification listener, set the `ks_notification_enable` |
| 119 | to true. |
| 120 | `ks_notifications_allow_requeue` enables requeue feature in case of |
| 121 | notification processing error. Enable this only when underlying transport |
| 122 | supports this feature. |
| 123 | |
| 124 | |
| 125 | .. code-block:: yaml |
| 126 | |
| 127 | barbican: |
| 128 | server: |
| 129 | enabled: true |
| 130 | version: ocata |
| 131 | ks_notifications_enable: true |
| 132 | ks_notifications_allow_requeue: true |
| 133 | |
| 134 | |
Petr Jediný | 6e745fb | 2017-09-05 10:20:05 +0200 | [diff] [blame] | 135 | MySQL server has gone away |
| 136 | |
| 137 | MySQL uses a default `wait_timeout` of 8 hours, after which it will drop |
| 138 | idle connections. This can result in 'MySQL Gone Away' exceptions. If you |
| 139 | notice this, you can lower `sql_idle_timeout` to ensure that SQLAlchemy |
Petr Jediný | 09886ec | 2017-09-06 22:20:38 +0200 | [diff] [blame] | 140 | reconnects before MySQL can drop the connection. If you run MySQL with HAProxy |
| 141 | you need to consider haproxy client/server timeout parameters. |
Petr Jediný | 6e745fb | 2017-09-05 10:20:05 +0200 | [diff] [blame] | 142 | |
| 143 | .. code-block:: yaml |
| 144 | |
| 145 | barbican: |
| 146 | server: |
| 147 | enabled: true |
| 148 | version: ocata |
| 149 | database: |
| 150 | engine: "mysql+pymysql" |
| 151 | host: 10.0.106.20 |
| 152 | port: 3306 |
| 153 | name: barbican |
| 154 | user: barbican |
| 155 | password: password |
Petr Jediný | 09886ec | 2017-09-06 22:20:38 +0200 | [diff] [blame] | 156 | sql_idle_timeout: 180 |
Petr Jediný | 6e745fb | 2017-09-05 10:20:05 +0200 | [diff] [blame] | 157 | |
| 158 | |
Kirill Bespalov | 95aa802 | 2017-10-31 16:35:06 +0300 | [diff] [blame] | 159 | Configuring TLS communications |
| 160 | ------------------------------ |
| 161 | |
Kirill Bespalov | 8d13330 | 2017-11-01 12:14:28 +0300 | [diff] [blame] | 162 | In order to trust remote server's certificate during establishing tls |
| 163 | connection the CA cert must be provided at client side. By default |
| 164 | system wide installed CA certs are used. You can change this behavior |
| 165 | by specifying cacert_file and cacert params (optional). |
| 166 | See examples below: |
| 167 | |
| 168 | |
| 169 | - **RabbitMQ** |
Kirill Bespalov | 95aa802 | 2017-10-31 16:35:06 +0300 | [diff] [blame] | 170 | |
| 171 | .. code-block:: yaml |
| 172 | |
| 173 | barbican: |
| 174 | server: |
| 175 | message_queue: |
| 176 | port: 5671 |
| 177 | ssl: |
| 178 | enabled: True |
| 179 | cacert: cert body if the cacert_file does not exists |
| 180 | cacert_file: /etc/openstack/rabbitmq-ca.pem |
| 181 | |
| 182 | |
Kirill Bespalov | 8d13330 | 2017-11-01 12:14:28 +0300 | [diff] [blame] | 183 | - **MySQL** |
| 184 | |
| 185 | .. code-block:: yaml |
| 186 | |
| 187 | barbican: |
| 188 | server: |
| 189 | database: |
| 190 | ssl: |
| 191 | enabled: True |
| 192 | cacert: cert body if the cacert_file does not exists |
| 193 | cacert_file: /etc/openstack/mysql-ca.pem |
| 194 | |
Kirill Bespalov | 95aa802 | 2017-10-31 16:35:06 +0300 | [diff] [blame] | 195 | |
Petr Jediný | 1ff6f56 | 2017-08-09 14:38:09 +0200 | [diff] [blame] | 196 | Configuring plugins |
| 197 | ------------------- |
| 198 | |
| 199 | Dogtag KRA |
| 200 | |
| 201 | .. code block:: yaml |
| 202 | |
| 203 | barbican: |
| 204 | server: |
| 205 | plugin: |
| 206 | dogtag: |
| 207 | pem_path: '/etc/barbican/kra_admin_cert.pem' |
| 208 | dogtag_host: localhost |
Petr Jediný | dcc90f8 | 2017-10-02 13:46:10 +0200 | [diff] [blame] | 209 | dogtag_port: 8443 |
Petr Jediný | 1ff6f56 | 2017-08-09 14:38:09 +0200 | [diff] [blame] | 210 | nss_db_path: '/etc/barbican/alias' |
| 211 | nss_db_path_ca: '/etc/barbican/alias-ca' |
| 212 | nss_password: 'password123' |
| 213 | simple_cmc_profile: 'caOtherCert' |
| 214 | ca_expiration_time: 1 |
| 215 | plugin_working_dir: '/etc/barbican/dogtag' |
| 216 | |
Oleg Iurchenko | 622ef90 | 2017-12-13 01:40:04 +0200 | [diff] [blame] | 217 | There are few sources (engines) to define KRA admin cert: |
| 218 | Engine #1: Define KRA admin cert by pillar. |
| 219 | To define KRA admin cert by pillar need to define the following: |
| 220 | .. code block:: yaml |
| 221 | barbican: |
| 222 | server: |
| 223 | dogtag_admin_cert: |
| 224 | engine: manual |
| 225 | key: | |
| 226 | ... key data ... |
| 227 | Engine #2: Receive DogTag cert from Salt Mine. |
| 228 | DogTag formula sends KRA cert to dogtag_admin_cert mine function. |
| 229 | .. code block:: yaml |
| 230 | barbican: |
| 231 | server: |
| 232 | dogtag_admin_cert: |
| 233 | engine: mine |
| 234 | minion: ...name of minion which has installed DogTag.. |
| 235 | Engine #3: No operations. |
| 236 | In case of some additional steps to install KRA certificate which |
| 237 | are out of scope for the formula, the formula has 'noop' engine |
| 238 | to perform no operations. If 'noop' engine is defined the formula will |
| 239 | do nothing to install KRA admin cert. |
| 240 | .. code block:: yaml |
| 241 | barbican: |
| 242 | server: |
| 243 | dogtag_admin_cert: |
| 244 | engine: noop |
| 245 | |
Petr Jediný | 1ff6f56 | 2017-08-09 14:38:09 +0200 | [diff] [blame] | 246 | KMIP HSM |
| 247 | |
| 248 | .. code block:: yaml |
| 249 | |
| 250 | barbican: |
| 251 | server: |
| 252 | plugin: |
| 253 | kmip: |
| 254 | username: 'admin' |
| 255 | password: 'password' |
| 256 | host: localhost |
| 257 | port: 5696 |
| 258 | keyfile: '/path/to/certs/cert.key' |
| 259 | certfile: '/path/to/certs/cert.crt' |
| 260 | ca_certs: '/path/to/certs/LocalCA.crt' |
| 261 | |
| 262 | |
| 263 | PKCS11 HSM |
| 264 | |
| 265 | .. code block:: yaml |
| 266 | |
| 267 | barbican: |
| 268 | server: |
| 269 | plugin: |
| 270 | p11_crypto: |
| 271 | library_path: '/usr/lib/libCryptoki2_64.so' |
| 272 | login: 'mypassword' |
| 273 | mkek_label: 'an_mkek' |
| 274 | mkek_length: 32 |
| 275 | hmac_label: 'my_hmac_label' |
| 276 | |
| 277 | |
| 278 | |
| 279 | Software Only Crypto |
| 280 | |
| 281 | `kek` is key encryption key created from 32 bytes encoded as Base64. You should |
| 282 | not use this in production. |
| 283 | |
| 284 | .. code block:: yaml |
| 285 | |
| 286 | barbican: |
| 287 | server: |
| 288 | plugin: |
| 289 | simple_crypto: |
| 290 | kek: 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY=' |
| 291 | |
| 292 | |
| 293 | Secret stores |
| 294 | ------------- |
| 295 | |
| 296 | .. code-block:: yaml |
| 297 | |
| 298 | barbican: |
| 299 | server: |
| 300 | plugin: |
| 301 | simple_crypto: |
| 302 | kek: "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY=" |
| 303 | p11_crypto: |
| 304 | library_path: '/usr/lib/libCryptoki2_64.so' |
| 305 | login: 'mypassword' |
| 306 | mkek_label: 'an_mkek' |
| 307 | mkek_length: 32 |
| 308 | hmac_label: 'my_hmac_label' |
| 309 | kmip: |
| 310 | username: 'admin' |
| 311 | password: 'password' |
| 312 | host: localhost |
| 313 | port: 5696 |
| 314 | keyfile: '/path/to/certs/cert.key' |
| 315 | certfile: '/path/to/certs/cert.crt' |
| 316 | ca_certs: '/path/to/certs/LocalCA.crt' |
| 317 | dogtag: |
| 318 | pem_path: '/etc/barbican/kra_admin_cert.pem' |
| 319 | dogtag_host: localhost |
Petr Jediný | dcc90f8 | 2017-10-02 13:46:10 +0200 | [diff] [blame] | 320 | dogtag_port: 8443 |
Petr Jediný | 1ff6f56 | 2017-08-09 14:38:09 +0200 | [diff] [blame] | 321 | nss_db_path: '/etc/barbican/alias' |
| 322 | nss_db_path_ca: '/etc/barbican/alias-ca' |
| 323 | nss_password: 'password123' |
| 324 | simple_cmc_profile: 'caOtherCert' |
| 325 | ca_expiration_time: 1 |
| 326 | plugin_working_dir: '/etc/barbican/dogtag' |
| 327 | store: |
| 328 | software: |
| 329 | crypto_plugin: simple_crypto |
| 330 | store_plugin: store_crypto |
| 331 | global_default: True |
| 332 | kmip: |
| 333 | store_plugin: kmip_plugin |
| 334 | dogtag: |
Petr Jediný | dcc90f8 | 2017-10-02 13:46:10 +0200 | [diff] [blame] | 335 | store_plugin: dogtag_crypto |
Petr Jediný | 1ff6f56 | 2017-08-09 14:38:09 +0200 | [diff] [blame] | 336 | pkcs11: |
| 337 | store_plugin: store_crypto |
| 338 | crypto_plugin: p11_crypto |
| 339 | |
Petr Jediný | dd6387a | 2017-08-01 15:50:17 +0200 | [diff] [blame] | 340 | |
| 341 | Documentation and Bugs |
| 342 | ====================== |
| 343 | |
| 344 | To learn how to install and update salt-formulas, consult the documentation |
| 345 | available online at: |
| 346 | |
| 347 | http://salt-formulas.readthedocs.io/ |
| 348 | |
| 349 | In the unfortunate event that bugs are discovered, they should be reported to |
| 350 | the appropriate issue tracker. Use GitHub issue tracker for specific salt |
| 351 | formula: |
| 352 | |
| 353 | https://github.com/salt-formulas/salt-formula-barbican/issues |
| 354 | |
| 355 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 356 | use Launchpad salt-formulas project: |
| 357 | |
| 358 | https://launchpad.net/salt-formulas |
| 359 | |
| 360 | Developers wishing to work on the salt-formulas projects should always base |
| 361 | their work on master branch and submit pull request against specific formula. |
| 362 | |
| 363 | You should also subscribe to mailing list (salt-formulas@freelists.org): |
| 364 | |
| 365 | https://www.freelists.org/list/salt-formulas |
| 366 | |
| 367 | Any questions or feedback is always welcome so feel free to join our IRC |
| 368 | channel: |
| 369 | |
| 370 | #salt-formulas @ irc.freenode.net |
| 371 | |
| 372 | Read more |
| 373 | ========= |
| 374 | |
| 375 | * https://docs.openstack.org/barbican/latest/ |