blob: b36c3911b14c22b967cfd309d4d71e7514e1c2e4 [file] [log] [blame]
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +03001=====
2Usage
3=====
Filip Pytloun943d6882015-10-06 16:28:32 +02004
Jakub Pavlikffc280d2016-05-20 11:19:14 +02005Keystone provides authentication, authorization and service discovery
6mechanisms via HTTP primarily for use by projects in the OpenStack family. It
7is most commonly deployed as an HTTP interface to existing identity systems,
8such as LDAP.
Filip Pytloun943d6882015-10-06 16:28:32 +02009
10From Kilo release Keystone v3 endpoint has definition without version in url
11
12.. code-block:: bash
13
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +030014 +----------------+-----------+--------------------------+--------------------------+---------------------------+---------------+
15 | id | region | publicurl | internalurl | adminurl | service_id |
16 +----------------+-----------+--------------------------+--------------------------+---------------------------+---------------+
17 | 91663a8d...494 | RegionOne | http://10.0.150.37:5000/ | http://10.0.150.37:5000/ | http://10.0.150.37:35357/ | 0fd2dba...9c9 |
18 +----------------+-----------+--------------------------+--------------------------+---------------------------+---------------+
Filip Pytloun943d6882015-10-06 16:28:32 +020019
20Sample pillars
21==============
22
Alexander Noskov78b81e02016-12-05 16:20:50 +040023.. caution::
Adam Tengler7c66c882016-03-14 19:35:49 +010024
Jakub Pavlikffc280d2016-05-20 11:19:14 +020025 When you use localhost as your database host (keystone:server:
26 atabase:host), sqlalchemy will try to connect to /var/run/mysql/
27 mysqld.sock, may cause issues if you located your mysql socket elsewhere
Adam Tengler7c66c882016-03-14 19:35:49 +010028
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +030029Full stacked Keystone:
Filip Pytloun943d6882015-10-06 16:28:32 +020030
31.. code-block:: yaml
32
33 keystone:
34 server:
35 enabled: true
36 version: juno
37 service_token: 'service_tokeen'
38 service_tenant: service
39 service_password: 'servicepwd'
40 admin_tenant: admin
41 admin_name: admin
42 admin_password: 'adminpwd'
43 admin_email: stackmaster@domain.com
Dzmitry Stremkouskid9a2b652018-10-25 16:37:00 +020044 enable_proxy_headers_parsing: True
Filip Pytloun943d6882015-10-06 16:28:32 +020045 roles:
46 - admin
47 - Member
48 - image_manager
49 bind:
50 address: 0.0.0.0
51 private_address: 127.0.0.1
52 private_port: 35357
53 public_address: 127.0.0.1
54 public_port: 5000
55 api_version: 2.0
56 region: RegionOne
57 database:
58 engine: mysql
59 host: '127.0.0.1'
60 name: 'keystone'
61 password: 'LfTno5mYdZmRfoPV'
62 user: 'keystone'
63
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +030064Keystone public HTTPS API:
Filip Pytloun943d6882015-10-06 16:28:32 +020065
66.. code-block:: yaml
67
68 keystone:
69 server:
70 enabled: true
71 version: juno
72 ...
73 services:
74 - name: nova
75 type: compute
76 description: OpenStack Compute Service
77 user:
78 name: nova
79 password: password
80 bind:
81 public_address: cloud.domain.com
82 public_protocol: https
83 public_port: 8774
84 internal_address: 10.0.0.20
85 internal_port: 8774
86 admin_address: 10.0.0.20
87 admin_port: 8774
88
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +030089Keystone with custom policies. Keys with specified rules
90are created or set to this value if they already exists.
91Keys with no value (like our ``existing_rule``) are deleted
92from the policy file:
Adam Tenglerb1ebaca2017-05-04 21:06:08 +000093
94.. code-block:: yaml
95
96 keystone:
97 server:
98 enabled: true
99 policy:
100 new_rule: "rule:admin_required"
101 existing_rule:
102
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300103Keystone memcached storage for tokens:
Filip Pytloun943d6882015-10-06 16:28:32 +0200104
105.. code-block:: yaml
106
107 keystone:
108 server:
109 enabled: true
110 version: juno
111 ...
112 token_store: cache
113 cache:
114 engine: memcached
115 host: 127.0.0.1
116 port: 11211
117 services:
118 ...
119
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300120Keystone clustered memcached storage for tokens:
Filip Pytloun943d6882015-10-06 16:28:32 +0200121
122.. code-block:: yaml
123
124 keystone:
125 server:
126 enabled: true
127 version: juno
128 ...
129 token_store: cache
130 cache:
131 engine: memcached
132 members:
133 - host: 192.160.0.1
134 port: 11211
135 - host: 192.160.0.2
136 port: 11211
137 services:
138 ...
139
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300140Keystone client:
Filip Pytloun943d6882015-10-06 16:28:32 +0200141
142.. code-block:: yaml
143
144 keystone:
145 client:
146 enabled: true
147 server:
148 host: 10.0.0.2
149 public_port: 5000
150 private_port: 35357
151 service_token: 'token'
152 admin_tenant: admin
153 admin_name: admin
154 admin_password: 'passwd'
155
156Keystone cluster
157
158.. code-block:: yaml
159
160 keystone:
161 control:
162 enabled: true
163 provider:
164 os15_token:
165 host: 10.0.0.2
166 port: 35357
167 token: token
168 os15_tcp_core_stg:
169 host: 10.0.0.5
170 port: 5000
171 tenant: admin
172 name: admin
173 password: password
174
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300175Keystone fernet tokens for OpenStack Kilo release:
Filip Pytloun943d6882015-10-06 16:28:32 +0200176
177.. code-block:: yaml
178
179 keystone:
180 server:
181 ...
182 tokens:
183 engine: fernet
Jakub Pavlik6b0b74a2016-09-01 10:49:14 +0200184 max_active_keys: 3
Filip Pytloun943d6882015-10-06 16:28:32 +0200185 ...
186
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300187Keystone auth methods:
Oleksii Chupryn6fd899f2017-04-21 10:20:51 +0300188
189.. code-block:: yaml
190
191 keystone:
192 server:
193 ...
194 auth_methods:
195 - external
196 - password
197 - token
198 - oauth1
199 ...
200
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300201Keystone domain with LDAP backend, using SQL for
Dzmitry Stremkouski46705912019-07-30 16:16:29 +0200202role/project assignment and disabled group mapping block:
203
204.. code-block:: yaml
205
206 keystone:
207 server:
208 domain:
209 external:
210 description: "Testing domain"
211 backend: ldap
212 assignment:
213 backend: sql
214 ldap:
215 group_mapping: False
216
217Keystone domain with LDAP backend, using SQL for
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300218role/project assignment:
Filip Pytloun6b9ec2b2016-01-12 13:52:01 +0100219
220.. code-block:: yaml
221
222 keystone:
223 server:
224 domain:
Ramon Melero96ff9122017-08-15 11:02:50 -0500225 external:
226 description: "Testing domain"
227 backend: ldap
228 assignment:
229 backend: sql
230 ldap:
Dzmitry Stremkouski46705912019-07-30 16:16:29 +0200231 group_mapping: False
Ramon Melero96ff9122017-08-15 11:02:50 -0500232 url: "ldaps://idm.domain.com"
233 suffix: "dc=cloud,dc=domain,dc=com"
234 # Will bind as uid=keystone,cn=users,cn=accounts,dc=cloud,dc=domain,dc=com
235 uid: keystone
236 password: password
Dzmitry Stremkouski46705912019-07-30 16:16:29 +0200237 query_scope: "sub"
238 bind_user: "CN=lab,CN=users,${keystone:server:domain:testing:ldap:suffix}"
239 filter:
240 user: "(memberOf=CN=Grp-atm-admins,CN=Users,${keystone:server:domain:testing:ldap:suffix})"
241 user_tree_dn: "CN=users,${keystone:server:domain:testing:ldap:suffix}"
242 user_id_attribute: "sAMAccountName"
243 user_name_attribute: "sAMAccountName"
244 user_pass_attribute: ""
245 user_enabled_default: 512
246 user_enabled_mask: 2
247 user_enabled_attribute: "userAccountControl"
248 user_attribute_ignore: "password,tenant_id,tenants"
Filip Pytloun6b9ec2b2016-01-12 13:52:01 +0100249
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300250Use driver aliases for drivers instead of class path's:
Dzmitry Stremkouskia0db50f2018-03-26 20:41:36 +0200251
252.. code-block:: yaml
253
254 keystone:
255 server:
256 domain:
257 test:
258 description: "Test domain"
259 backend: ldap
260 assignment:
261 backend: sql
262 driver: sql
263 identity:
264 backend: ldap
265 driver: keystone.identity.backends.ldap.Identity
266 ldap:
267 url: "ldaps://idm.domain.com"
268 ...
269
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300270Using LDAP backend for default domain:
Filip Pytloun1abfdd72016-01-18 11:35:17 +0100271
272.. code-block:: yaml
273
274 keystone:
275 server:
276 backend: ldap
277 assignment:
278 backend: sql
279 ldap:
Ales Komarekaabbda62016-03-15 08:38:35 +0100280 url: "ldaps://idm.domain.com"
281 suffix: "dc=cloud,dc=domain,dc=com"
282 # Will bind as uid=keystone,cn=users,cn=accounts,dc=cloud,dc=domain,dc=com
Filip Pytloun1abfdd72016-01-18 11:35:17 +0100283 uid: keystone
Ales Komarekaabbda62016-03-15 08:38:35 +0100284 password: password
285
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300286Using LDAP backend for default domain with
287``user_enabled`` field emulation:
kovchynnykov74125082018-02-05 13:17:43 +0200288
289.. code-block:: yaml
290
291 keystone:
292 server:
293 backend: ldap
294 assignment:
295 backend: sql
296 ldap:
297 url: "ldap://idm.domain.com"
298 suffix: "ou=Openstack Service Users,o=domain.com"
299 bind_user: keystone
300 password: password
301 # Define LDAP "group" object class and "membership" attribute
302 group_objectclass: groupOfUniqueNames
303 group_member_attribute: uniqueMember
304 # User will receive "enabled" attribute basing on membership in "os-user-enabled" group
305 user_enabled_emulation: True
306 user_enabled_emulation_dn: "cn=os-user-enabled,ou=Openstack,o=domain.com"
307 user_enabled_emulation_use_group_config: True
308
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300309If the members of the group ``objectclass`` are user IDs
310rather than DNs, set ``group_members_are_ids`` to ``true``.
311This is the case when using ``posixGroup` as the group
312``objectclass`` and ``OpenDirectory``:
Aleksieiev, Oleksii3f1d7a52018-06-06 15:14:29 -0700313
314.. code-block:: yaml
315
316 keystone:
317 server:
318 backend: ldap
319 assignment:
320 backend: sql
321 ldap:
322 url: "ldaps://idm.domain.com"
323 suffix: "dc=cloud,dc=domain,dc=com"
324 # Will bind as uid=keystone,cn=users,cn=accounts,dc=cloud,dc=domain,dc=com
325 uid: keystone
326 password: password
327 group_members_are_ids: True
328
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300329Simple service endpoint definition (defaults to ``RegionOne``):
Ales Komarekaabbda62016-03-15 08:38:35 +0100330
331.. code-block:: yaml
332
333 keystone:
334 server:
335 service:
336 ceilometer:
337 type: metering
338 description: OpenStack Telemetry Service
339 user:
340 name: ceilometer
341 password: password
342 bind:
343 ...
344
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300345Region-aware service endpoints definition:
Ales Komarekaabbda62016-03-15 08:38:35 +0100346
347.. code-block:: yaml
348
349 keystone:
350 server:
351 service:
352 ceilometer_region01:
353 service: ceilometer
354 type: metering
355 region: region01
356 description: OpenStack Telemetry Service
357 user:
358 name: ceilometer
359 password: password
360 bind:
361 ...
362 ceilometer_region02:
363 service: ceilometer
364 type: metering
365 region: region02
366 description: OpenStack Telemetry Service
367 bind:
368 ...
369
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300370Enable Ceilometer notifications:
Jakub Pavlik72e31d62016-04-08 16:26:57 +0200371
372.. code-block:: yaml
373
374 keystone:
375 server:
376 notification: true
377 message_queue:
378 engine: rabbitmq
379 host: 127.0.0.1
380 port: 5672
381 user: openstack
382 password: password
383 virtual_host: '/openstack'
384 ha_queues: true
Filip Pytloun1abfdd72016-01-18 11:35:17 +0100385
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300386Client-side RabbitMQ HA setup:
Jakub Pavlik205ef802016-12-14 12:48:42 +0100387
388.. code-block:: yaml
389
390 keystone:
391 server:
392 ....
393 message_queue:
394 engine: rabbitmq
395 members:
396 - host: 10.0.16.1
397 - host: 10.0.16.2
398 - host: 10.0.16.3
399 user: openstack
400 password: pwd
401 virtual_host: '/openstack'
402 ....
403
Kirill Bespalov00984452017-08-01 17:44:11 +0300404Client-side RabbitMQ TLS configuration:
405
406|
407
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300408By default system-wide CA certs are used. Nothing should be
409specified except ``ssl.enabled``.
Kirill Bespalov00984452017-08-01 17:44:11 +0300410
411.. code-block:: yaml
412
413 keystone:
414 server:
415 ....
416 message_queue:
417 ssl:
418 enabled: True
419
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300420Use ``cacert_file`` option to specify the CA-cert
421file path explicitly:
Kirill Bespalov00984452017-08-01 17:44:11 +0300422
423.. code-block:: yaml
424
425 keystone:
426 server:
427 ....
428 message_queue:
429 ssl:
430 enabled: True
431 cacert_file: /etc/ssl/rabbitmq-ca.pem
432
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300433To manage content of the ``cacert_file`` use the ``cacert``
434option:
Kirill Bespalov00984452017-08-01 17:44:11 +0300435
436.. code-block:: yaml
437
438 keystone:
439 server:
440 ....
441 message_queue:
442 ssl:
443 enabled: True
444 cacert: |
445
446 -----BEGIN CERTIFICATE-----
447 ...
448 -----END CERTIFICATE-------
449
450 cacert_file: /etc/openstack/rabbitmq-ca.pem
451
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300452.. note::
Kirill Bespalov00984452017-08-01 17:44:11 +0300453
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300454 * The ``message_queue.port`` is set to ``5671`` (AMQPS) by
455 default if ``ssl.enabled=True``.
456 * Use ``message_queue.ssl.version`` if you need to specify
457 protocol version. By default, is ``TLSv1`` for python <
458 2.7.9 and ``TLSv1_2`` for version above.
Kirill Bespalov00984452017-08-01 17:44:11 +0300459
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300460Enable CADF audit notification:
Petr Michalec98fc6d62016-12-03 11:30:35 +0100461
462.. code-block:: yaml
463
464 keystone:
465 server:
466 notification: true
467 notification_format: cadf
468
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300469Run Keystone under Apache:
Alexander Noskov78b81e02016-12-05 16:20:50 +0400470
471.. code-block:: yaml
472
473 keystone:
474 server:
475 service_name: apache2
476 apache:
477 server:
478 enabled: true
479 default_mpm: event
480 site:
481 keystone:
482 enabled: true
483 type: keystone
484 name: wsgi
485 host:
486 name: ${linux:network:fqdn}
487 modules:
488 - wsgi
489
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300490Enable SAML2 Federated keystone:
Alexander Noskov78b81e02016-12-05 16:20:50 +0400491
492.. code-block:: yaml
493
494 keystone:
495 server:
Oleksii Chupryn6fd899f2017-04-21 10:20:51 +0300496 auth_methods:
497 - password
498 - token
499 - saml2
Oleksii Chuprynebe09a52017-04-21 11:08:14 +0300500 federation:
Oleksii Chuprynfcecf192017-04-21 12:20:46 +0300501 saml2:
502 protocol: saml2
503 remote_id_attribute: Shib-Identity-Provider
504 shib_url_scheme: https
505 shib_compat_valid_user: 'on'
Alexander Noskov78b81e02016-12-05 16:20:50 +0400506 federation_driver: keystone.contrib.federation.backends.sql.Federation
Oleksii Chupryn5f110b02017-03-30 09:54:27 +0300507 federated_domain_name: Federated
Alexander Noskov78b81e02016-12-05 16:20:50 +0400508 trusted_dashboard:
Oleksii Chuprynfcecf192017-04-21 12:20:46 +0300509 - https://${_param:cluster_public_host}/horizon/auth/websso/
Alexander Noskov78b81e02016-12-05 16:20:50 +0400510 apache:
511 server:
512 pkgs:
513 - apache2
514 - libapache2-mod-shib2
515 modules:
516 - wsgi
517 - shib2
Ales Komarek74a3ba62016-10-05 12:16:52 +0200518
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300519Enable OIDC Federated Keystone:
Oleksii Chuprynfcecf192017-04-21 12:20:46 +0300520
521.. code-block:: yaml
522
523 keystone:
524 server:
525 auth_methods:
526 - password
527 - token
528 - oidc
529 federation:
530 oidc:
531 protocol: oidc
532 remote_id_attribute: HTTP_OIDC_ISS
533 remote_id_attribute_value: https://accounts.google.com
534 oidc_claim_prefix: "OIDC-"
Oleksii Molchanov11b77ea2022-08-11 12:36:02 +0300535 oidc_claim_delimiter: ;
Oleksii Chuprynfcecf192017-04-21 12:20:46 +0300536 oidc_response_type: id_token
537 oidc_scope: "openid email profile"
538 oidc_provider_metadata_url: https://accounts.google.com/.well-known/openid-configuration
539 oidc_client_id: <openid_client_id>
540 oidc_client_secret: <openid_client_secret>
541 oidc_crypto_passphrase: openstack
542 oidc_redirect_uri: https://key.example.com:5000/v3/auth/OS-FEDERATION/websso/oidc/redirect
543 oidc_oauth_introspection_endpoint: https://www.googleapis.com/oauth2/v1/tokeninfo
544 oidc_oauth_introspection_token_param_name: access_token
545 oidc_oauth_remote_user_claim: user_id
546 oidc_ssl_validate_server: 'off'
547 federated_domain_name: Federated
548 federation_driver: keystone.contrib.federation.backends.sql.Federation
549 trusted_dashboard:
550 - https://${_param:cluster_public_host}/auth/websso/
551 apache:
552 server:
553 pkgs:
554 - apache2
555 - libapache2-mod-auth-openidc
556 modules:
557 - wsgi
558 - auth_openidc
559
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300560.. note:: Ubuntu Trusty repository doesn't contain
561 ``libapache2-mod-auth-openidc`` package. Additonal
562 repository should be added to the source list.
Oleksii Chuprynfcecf192017-04-21 12:20:46 +0300563
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300564Use a custom identity driver with custom options:
mnederlof5d9ccac2017-03-02 15:47:50 +0100565
566.. code-block:: yaml
567
568 keystone:
569 server:
570 backend: k2k
571 k2k:
572 auth_url: 'https://keystone.example.com/v2.0'
573 read_user: 'example_user'
574 read_pass: 'password'
575 read_tenant_id: 'admin'
576 identity_driver: 'sql'
577 id_prefix: 'k2k:'
578 domain: 'default'
579 caching: true
580 cache_time: 600
581
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300582Enable CORS parameters:
Ondrej Smola16e1bb72017-04-18 23:37:49 +0200583
584.. code-block:: yaml
585
586 keystone:
587 server:
588 cors:
589 allowed_origin: https:localhost.local,http:localhost.local
590 expose_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
591 allow_methods: GET,PUT,POST,DELETE,PATCH
592 allow_headers: X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
593 allow_credentials: True
594 max_age: 86400
595
Ales Komarek74a3ba62016-10-05 12:16:52 +0200596Keystone client
597---------------
598
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300599Service endpoints enforcement with service token:
Ales Komarek74a3ba62016-10-05 12:16:52 +0200600
601.. code-block:: yaml
602
603 keystone:
604 client:
605 enabled: true
606 server:
607 keystone01:
608 admin:
609 host: 10.0.0.2
610 port: 35357
611 token: 'service_token'
612 service:
613 nova:
614 type: compute
615 description: OpenStack Compute Service
616 endpoints:
617 - region: region01
618 public_address: 172.16.10.1
619 public_port: 8773
620 public_path: '/v2'
621 internal_address: 172.16.10.1
622 internal_port: 8773
623 internal_path: '/v2'
624 admin_address: 172.16.10.1
625 admin_port: 8773
626 admin_path: '/v2'
627
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300628Project, users, roles enforcement with admin user:
Ales Komarek74a3ba62016-10-05 12:16:52 +0200629
630.. code-block:: yaml
631
632 keystone:
633 client:
634 enabled: true
635 server:
636 keystone01:
637 admin:
638 host: 10.0.0.2
639 port: 5000
Jiri Broulik1703fcc2017-02-13 17:42:29 +0100640 project: admin
Ales Komarek74a3ba62016-10-05 12:16:52 +0200641 user: admin
642 password: 'passwd'
Jiri Broulik1703fcc2017-02-13 17:42:29 +0100643 region_name: RegionOne
644 protocol: https
Ales Komarek74a3ba62016-10-05 12:16:52 +0200645 roles:
646 - admin
647 - member
648 project:
649 tenant01:
650 description: "test env"
Jiri Broulik59000e92017-02-06 18:14:06 +0100651 quota:
652 instances: 100
653 cores: 24
654 ram: 151200
655 floating_ips: 50
656 fixed_ips: -1
657 metadata_items: 128
658 injected_files: 5
659 injected_file_content_bytes: 10240
660 injected_file_path_bytes: 255
661 key_pairs: 100
662 security_groups: 20
663 security_group_rules: 40
664 server_groups: 20
665 server_group_members: 20
Ales Komarek74a3ba62016-10-05 12:16:52 +0200666 user:
667 user01:
668 email: jdoe@domain.com
669 is_admin: true
670 password: some
671 user02:
672 email: jdoe2@domain.com
673 password: some
674 roles:
675 - custom-roles
676
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300677Multiple servers example:
Richard Felkl5ff315e2017-02-01 23:26:23 +0100678
679.. code-block:: yaml
680
Jiri Broulik1703fcc2017-02-13 17:42:29 +0100681 keystone:
682 client:
683 enabled: true
684 server:
685 keystone01:
686 admin:
687 host: 10.0.0.2
688 port: 5000
689 project: 'admin'
690 user: admin
691 password: 'workshop'
692 region_name: RegionOne
693 protocol: https
694 keystone02:
695 admin:
696 host: 10.0.0.3
697 port: 5000
698 project: 'admin'
699 user: admin
700 password: 'workshop'
701 region_name: RegionOne
Richard Felkl5ff315e2017-02-01 23:26:23 +0100702
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300703Tenant quotas:
Jiri Broulik59000e92017-02-06 18:14:06 +0100704
705.. code-block:: yaml
706
707 keystone:
708 client:
709 enabled: true
710 server:
711 keystone01:
712 admin:
713 host: 10.0.0.2
714 port: 5000
Jiri Broulik1703fcc2017-02-13 17:42:29 +0100715 project: admin
Jiri Broulik59000e92017-02-06 18:14:06 +0100716 user: admin
717 password: 'passwd'
Jiri Broulik1703fcc2017-02-13 17:42:29 +0100718 region_name: RegionOne
719 protocol: https
Jiri Broulik59000e92017-02-06 18:14:06 +0100720 roles:
721 - admin
722 - member
723 project:
724 tenant01:
725 description: "test env"
726 quota:
727 instances: 100
728 cores: 24
729 ram: 151200
730 floating_ips: 50
731 fixed_ips: -1
732 metadata_items: 128
733 injected_files: 5
734 injected_file_content_bytes: 10240
735 injected_file_path_bytes: 255
736 key_pairs: 100
737 security_groups: 20
738 security_group_rules: 40
739 server_groups: 20
740 server_group_members: 20
741
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300742Extra config params in ``keystone.conf``
743(since Mitaka release):
Oleksii Chupryn4fec2132017-04-03 17:35:28 +0300744
745.. code-block:: yaml
746
747 keystone:
748 server:
749 ....
750 extra_config:
751 ini_section1:
752 param1: value
753 param2: value
754 ini_section2:
755 param1: value
756 param2: value
757 ....
758
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300759Configuration of ``policy.json`` file:
Dmitry Ukovf58264b2017-04-20 23:08:42 +0200760
761.. code-block:: yaml
762
Dmitry Ukovf58264b2017-04-20 23:08:42 +0200763 keystone:
764 server:
765 ....
766 policy:
767 admin_or_token_subject: 'rule:admin_required or rule:token_subject'
768
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300769Manage ``os-cloud-config`` yml with ``keystone.client``:
Vasyl Saienkod1902592018-03-30 12:51:54 +0300770
771.. code-block:: yaml
772
773 keystone:
774 client:
775 os_client_config:
776 enabled: true
777 cfgs:
778 root:
779 file: /root/.config/openstack/clouds.yml
780 content:
781 clouds:
782 admin_identity:
783 region_name: RegioneOne
784 auth:
785 username: admin
786 password: secretpassword
787 user_domain_name: Default
788 project_name: admin
789 project_domain_name: Default
790 auth_url: "http://1.2.3.4:5000"
791
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300792Setting up default admin project name and domain:
Andrey4b287f02017-10-03 18:40:25 -0500793
794.. code-block:: yaml
795
Andrey4b287f02017-10-03 18:40:25 -0500796 keystone:
797 server:
798 ....
799 admin_project:
800 name: "admin"
801 domain: "default"
802
Dmitry Kalashnik494a17d2017-12-06 16:55:55 +0400803Enhanced logging with logging.conf
804----------------------------------
805
806By default logging.conf is disabled.
807
808That is possible to enable per-binary logging.conf with new variables:
Dmitry Kalashnik494a17d2017-12-06 16:55:55 +0400809
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300810* ``openstack_log_appender``
811 Set to true to enable ``log_config_append`` for all OpenStack services
Dmitry Kalashnik494a17d2017-12-06 16:55:55 +0400812
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300813* ``openstack_fluentd_handler_enabled``
814 Set to true to enable ``FluentHandler`` for all Openstack services
815
816* ``openstack_ossyslog_handler_enabled``
817 Set to true to enable ``OSSysLogHandler`` for all Openstack services
818
819Only ``WatchedFileHandler``, ``OSSysLogHandler``, and ``FluentHandler``
820are available.
821
822Also, it is possible to configure this with pillar:
Dmitry Kalashnik494a17d2017-12-06 16:55:55 +0400823
824.. code-block:: yaml
825
826 keystone:
827 server:
828 logging:
829 log_appender: true
830 log_handlers:
831 watchedfile:
832 enabled: true
833 fluentd:
834 enabled: true
Oleksii Chupryn6529bb32018-02-07 11:55:38 +0200835 ossyslog:
836 enabled: true
Dmitry Kalashnik494a17d2017-12-06 16:55:55 +0400837
Martin Polreich7b710302019-12-17 13:50:04 +0100838
839Change default service policy configuration:
840--------------------------------------------
841
842.. code-block:: yaml
843
844 keystone:
845 server:
846 policy:
847 admin_or_token_subject: 'rule:token_subject'
848 service_admin_or_token_subject": 'rule:service_or_admin'
849 # Add key without value to remove line from policy.json
850 identity:get_region:
851
Jiri Broulik59000e92017-02-06 18:14:06 +0100852Usage
853=====
854
OlgaGusarenkoa9fac4b2018-07-30 19:17:24 +0300855#. Apply the :command:`keystone.client.service` state.
856#. Apply the :command:`keystone.client` state.
Jiri Broulik59000e92017-02-06 18:14:06 +0100857
858
Oleksii Grudev5707e5c2018-06-18 17:31:22 +0300859Fernet-keys rotation without gluster
860------------------------------------
861
862In the future fernet keys supposed to be rotated with rsync+ssh instead of using glusterfs. By default it is assumed
863that the script will run on primary control node (ctl01) and will rotate and transfer fernet keys to secondary
864controller nodes (ctl02, ctl03). Following parameter should be set on cluster level:
865
866keystone_node_role
867
868and fernet_rotation_driver should be set to 'rsync'
869
870By default this parameter is set to "secondary" on system level along with other parameters:
871.. code-block:: yaml
872
873 keystone:
874 server:
875 role: ${_param:keystone_node_role}
876 tokens:
877 fernet_sync_nodes_list:
878 control02:
879 name: ctl02
880 enabled: True
881 control03:
882 name: ctl03
883 enabled: True
884 fernet_rotation_driver: rsync
885
886Prior to running keystone salt states ssh key should be generated and its public part should be placed on secondary controllers.
887It can be accomplished by running following orchestration state before keystone states:
888
889salt-run state.orchestrate keystone.orchestrate.deploy
890
891Currently the default fernet rotation driver is a shared filesystem
892
Oleksandr Shyshko9b152eb2018-08-31 10:23:34 +0300893Enable x509 and ssl communication between Keystone and Galera cluster.
894---------------------
895By default communication between Keystone and Galera is unsecure.
896
Oleksandr Shyshkob97f0542018-09-07 14:00:18 +0300897keystone:
898 server:
899 database:
900 x509:
901 enabled: True
902
Oleksandr Shyshko9b152eb2018-08-31 10:23:34 +0300903You able to set custom certificates in pillar:
Oleksandr Shyshko9b152eb2018-08-31 10:23:34 +0300904
905keystone:
906 server:
907 database:
908 x509:
Oleksandr Shyshkob97f0542018-09-07 14:00:18 +0300909 cacert: (certificate content)
910 cert: (certificate content)
911 key: (certificate content)
Oleksandr Shyshko9b152eb2018-08-31 10:23:34 +0300912
913You can read more about it here:
914 https://docs.openstack.org/security-guide/databases/database-access-control.html
915
Oleksandr Bryndzii49a50832019-02-26 15:38:54 +0200916Enhanced max_active_keys setup
917------------------------------
918
919Rotating keys too frequently, or with ``[fernet_tokens] max_active_keys`` set too low,
920will cause tokens to become invalid prior to their expiration. As tokens may be fetched
921beyond their initial expiration period, keys should not be fully rotated within the
922period of ``[token] expiration`` + ``[token] allow_expired_window`` seconds to prevent the
923tokens becoming unavailable. As an example, the max_active_keys default value can be
924adjusted according to the following specified values:
925``[token] allow_expired_window`` = 86400 (24 hours)
926``[token] expiration`` = 3600 (1 hour)
927rotation_frequency = 1 (1 hour)
928``[fernet_token]max_active_keys`` = (24 + 1)/1 + 2 = 27
929
930.. code-block:: yaml
931
932 keystone:
933 server:
934 ...
935 tokens:
936 engine: fernet
937 expiration: 3600
938 allow_expired_window: 86400
939 max_active_keys: 27
940 ...
941
Oleksandr Shyshko004f17b2019-02-21 12:51:25 +0000942Enable security compliance policies.
943-----------------------------------
944By default security compliance policies disabled. You are able to define follow params independency each other.
945
946Notice: To ignore `change_password_upon_first_use` requirement for specific users, such as service users,
947set the `options` attribute `ignore_change_password_upon_first_use`
948to `True` for the desired user via the update user API
949
950Notice: Symbol "$" should have escape character and looks like "$$".
951
952.. code-block:: yaml
953
954keystone:
955 server:
956 security_compliance:
Oleksandr Shyshko3d95b712019-04-19 11:50:49 +0300957 disable_user_account_days_inactive: 365
958 lockout_failure_attempts: 60
Oleksandr Shyshko004f17b2019-02-21 12:51:25 +0000959 lockout_duration: 600
Oleksandr Shyshko3d95b712019-04-19 11:50:49 +0300960 password_expires_days: 730
961 unique_last_password_count: 5
Oleksandr Shyshko004f17b2019-02-21 12:51:25 +0000962 minimum_password_age: 0
Oleksandr Shyshko3d95b712019-04-19 11:50:49 +0300963 password_regex: '^[a-zA-Z0-9~!@#%^&\*_=+]{32,}$$'
964 password_regex_description: |
965 'Your password could contains capital letters, lowercase letters, digits, symbols "~ ! @ # % ^ & * _ = +" and have a minimum length of 32 characters'
966 change_password_upon_first_use: False
Oleksandr Shyshkoa0b79e22019-02-27 15:02:30 +0000967
968Define extra user options.
969-------------------------
970
971 To ignore `change_password_upon_first_use` requirement for specific users,
972such as service users, set the `options` attribute `ignore_change_password_upon_first_use`
973to `True` for the desired user via the update user API.
974
975 To ignore `password_expires_days` requirement for specific users,
976such as service users, set the `options` attribute `ignore_password_expiry`
977to `True` for the desired user via the update user API.
978
979 To ignore `lockout_failure_attempts` requirement for specific users,
980such as service users, set the `options` attribute `ignore_lockout_failure_attempts`
981to `True` for the desired user via the update user API.
982
983 Also If there exists a user who should not be able to change her own password via
984the keystone password change API, keystone supports setting that user’s option `lock_password`
985to True via the user update API.
986
987#For release since Q
988.. code-block:: yaml
989
990keystone:
991 client:
992 resources:
993 v3:
994 users:
995 cinder:
996 options:
997 ignore_change_password_upon_first_use: True
998 ignore_password_expiry: False
999 ignore_lockout_failure_attempts: False
1000 lock_password: True
1001.. code-block::
1002
1003#For all early releases
1004.. code-block:: yaml
1005
1006keystone:
1007 client:
1008 server:
1009 identity:
1010 project:
1011 service:
1012 user:
1013 cinder:
1014 options:
1015 ignore_change_password_upon_first_use: True
1016 ignore_password_expiry: False
1017 ignore_lockout_failure_attempts: False
1018 lock_password: True
1019.. code-block::
1020
Oleksandr Bryndziiad0ffc52019-05-02 15:40:31 +03001021Keystone configmap setup:
1022---------------
1023# Default type:
1024.. code-block:: yaml
1025
1026 keystone:
1027 server:
1028 configmap:
1029 DEFAULT:
1030 debug: true
1031 rate_limit_except_level: debug
1032 auth:
1033 methods: 'external,password,token'
1034 tokenless_auth:
1035 trusted_issuer: 'O=Mirantis,L=Prague,CN=Salt Master CA,C=cz'
1036
1037.. code-block::
1038
1039
1040# type: 'MultiOpt' for multiline values:
1041.. code-block:: yaml
1042
1043 keystone:
1044 server:
1045 configmap:
1046 tokenless_auth:
1047 trusted_issuer:
1048 type: 'MultiOpt'
1049 values:
1050 value1: 'O=Mirantis,L=Prague,CN=Salt Master CA,C=cz'
1051 value2: 'O=Mirantis,L=Kharkiv,CN=Salt Master CA2,C=ua'
1052
1053.. code-block::
1054
rootf06439a2019-05-27 14:58:46 +00001055Setup auth urls for oidc:
1056---------------
1057.. code-block:: yaml
1058
1059 keystone:
1060 server:
1061 federation:
1062 oidc:
1063 idp_protocols_auth_url: '/v3/OS-FEDERATION/identity_providers/.*?/protocols/oidc/auth_url'
1064 idp_protocols_websso_url: '/v3/OS-FEDERATION/identity_providers/.*?/protocols/oidc/websso_url'
1065 websso_url: '/v3/OS-FEDERATION/websso/oidc_url'
1066
1067
1068.. code-block::
1069
Taras Khlivnyakbdb3e6d2021-08-28 10:09:20 +03001070
1071Change files/directories permissions for keystone service:
Taras Khlivnyak0a64f7e2021-08-19 10:57:43 +03001072=======================================
Taras Khlivnyakbdb3e6d2021-08-28 10:09:20 +03001073In order to change file permissions the following should be set:
1074
1075'files' - block to set permissions for files.
Taras Khlivnyak0a64f7e2021-08-19 10:57:43 +03001076- full path to file
1077- user ( default value is 'root' ) this parameter is optional.
1078- group ( default value is 'keystone' ) this parameter is optional
1079- mode ( default value is '0640' ) this parameter is optional
Taras Khlivnyakbdb3e6d2021-08-28 10:09:20 +03001080
1081'directories' - block to set permissions for directories.
Taras Khlivnyak0a64f7e2021-08-19 10:57:43 +03001082- full path to directory
1083- user ( default value is 'root' ) this parameter is optional
1084- group ( default value is 'keystone' ) this parameter is optional
1085- mode ( default value is '0750' ) this parameter is optional
1086
1087.. code-block:: yaml
Taras Khlivnyakbdb3e6d2021-08-28 10:09:20 +03001088
Taras Khlivnyak0a64f7e2021-08-19 10:57:43 +03001089 keystone:
1090 files:
1091 /etc/keystone/keystone.conf:
1092 user: 'root'
1093 group: 'keystone'
1094 mode: '0750'
1095 directories:
1096 /etc/keystone:
1097 user: 'root'
1098 group: 'keystone'
1099 mode: '0750'
1100
1101
Vasyl Saienko52bed882018-09-10 10:52:39 +00001102Upgrades
1103========
1104
1105Each openstack formula provide set of phases (logical bloks) that will help to
1106build flexible upgrade orchestration logic for particular components. The list
1107of phases and theirs descriptions are listed in table below:
1108
1109+-------------------------------+------------------------------------------------------+
1110| State | Description |
1111+===============================+======================================================+
1112| <app>.upgrade.service_running | Ensure that all services for particular application |
1113| | are enabled for autostart and running |
1114+-------------------------------+------------------------------------------------------+
1115| <app>.upgrade.service_stopped | Ensure that all services for particular application |
1116| | disabled for autostart and dead |
1117+-------------------------------+------------------------------------------------------+
1118| <app>.upgrade.pkgs_latest | Ensure that packages used by particular application |
1119| | are installed to latest available version. |
1120| | This will not upgrade data plane packages like qemu |
1121| | and openvswitch as usually minimal required version |
1122| | in openstack services is really old. The data plane |
1123| | packages should be upgraded separately by `apt-get |
1124| | upgrade` or `apt-get dist-upgrade` |
1125| | Applying this state will not autostart service. |
1126+-------------------------------+------------------------------------------------------+
1127| <app>.upgrade.render_config | Ensure configuration is rendered actual version. +
1128+-------------------------------+------------------------------------------------------+
1129| <app>.upgrade.pre | We assume this state is applied on all nodes in the |
1130| | cloud before running upgrade. |
1131| | Only non destructive actions will be applied during |
1132| | this phase. Perform service built in service check |
1133| | like (keystone-manage doctor and nova-status upgrade)|
1134+-------------------------------+------------------------------------------------------+
1135| <app>.upgrade.upgrade.pre | Mostly applicable for data plane nodes. During this |
1136| | phase resources will be gracefully removed from |
1137| | current node if it is allowed. Services for upgraded |
1138| | application will be set to admin disabled state to |
1139| | make sure node will not participate in resources |
1140| | scheduling. For example on gtw nodes this will set |
1141| | all agents to admin disable state and will move all |
1142| | routers to other agents. |
1143+-------------------------------+------------------------------------------------------+
1144| <app>.upgrade.upgrade | This state will basically upgrade application on |
1145| | particular target. Stop services, render |
1146| | configuration, install new packages, run offline |
1147| | dbsync (for ctl), start services. Data plane should |
1148| | not be affected, only OpenStack python services. |
1149+-------------------------------+------------------------------------------------------+
1150| <app>.upgrade.upgrade.post | Add services back to scheduling. |
1151+-------------------------------+------------------------------------------------------+
1152| <app>.upgrade.post | This phase should be launched only when upgrade of |
1153| | the cloud is completed. Cleanup temporary files, |
1154| | perform other post upgrade tasks. |
1155+-------------------------------+------------------------------------------------------+
1156| <app>.upgrade.verify | Here we will do basic health checks (API CRUD |
1157| | operations, verify do not have dead network |
1158| | agents/compute services) |
1159+-------------------------------+------------------------------------------------------+
1160
1161
Jakub Pavlikffc280d2016-05-20 11:19:14 +02001162Documentation and Bugs
Ales Komarek74a3ba62016-10-05 12:16:52 +02001163======================
Filip Pytloun943d6882015-10-06 16:28:32 +02001164
Jakub Pavlikffc280d2016-05-20 11:19:14 +02001165To learn how to deploy OpenStack Salt, consult the documentation available
1166online at:
1167
1168 https://wiki.openstack.org/wiki/OpenStackSalt
1169
1170In the unfortunate event that bugs are discovered, they should be reported to
1171the appropriate bug tracker. If you obtained the software from a 3rd party
1172operating system vendor, it is often wise to use their own bug tracker for
1173reporting problems. In all other cases use the master OpenStack bug tracker,
1174available at:
1175
1176 http://bugs.launchpad.net/openstack-salt
1177
1178Developers wishing to work on the OpenStack Salt project should always base
1179their work on the latest formulas code, available from the master GIT
1180repository at:
1181
1182 https://git.openstack.org/cgit/openstack/salt-formula-keystone
1183
1184Developers should also join the discussion on the IRC list, at:
1185
1186 https://wiki.openstack.org/wiki/Meetings/openstack-salt