blob: 25f5219239c616023940bcc66744e281b7cac999 [file] [log] [blame]
sgarbuz6875ed12018-11-16 13:14:57 +02001ssl_enabled = attribute("ssl", default: false)
2
3keystone_oslo_messaging_default = {
4 'transport_url' => 'rabbit://openstack:password@127.0.0.1:5672//openstack',
5}
6
7keystone_oslo_messaging_default_ssl = {
8 'transport_url' => 'rabbit://openstack:password@127.0.0.1:5671//openstack'
9}
10
11keystone_default = {
12 'log_config_append' => '/etc/keystone/logging.conf',
13 'debug' => 'false',
14 'log_file' => 'keystone.log',
15 'log_dir' => '/var/log/keystone',
16 'use_syslog' => 'false',
17 'syslog_log_facility' => 'LOG_USER',
18 'notification_format' => 'cadf',
19 'executor_thread_pool_size' => '64',
20 'rpc_response_timeout' => '60',
21 'control_exchange' => 'keystone',
22}
23
24keystone_assignment = {
25 'driver' => 'sql'
26}
27
28keystone_auth = {
29 'methods' => 'password,token',
30 'oidc' => 'keystone.auth.plugins.mapped.Mapped',
31 'saml2' => 'keystone.auth.plugins.mapped.Mapped',
32}
33
34#hardcod in config
35keystone_catalog = {
36 'template_file' => 'default_catalog.templates',
37 'driver' => 'sql',
38}
39
40keystone_credential = {
41 'key_repository' => '/var/lib/keystone/credential-keys'
42}
43
44keystone_fernet_tokens = {
45 'key_repository' => '/var/lib/keystone/fernet-keys',
46 'max_active_keys' => '3',
47}
48
49#hardcod in config
50keystone_identity = {
51 'driver' => 'sql',
52 'default_domain_id' => 'default',
53 'domain_specific_drivers_enabled' => 'True',
54 'domain_config_dir' => '/etc/keystone/domains',
55}
56
57#hardcod in config
58keystone_policy = {
59 'driver' => 'sql'
60}
61
62keystone_token = {
63 'expiration' => '86400',
64 'provider' => 'fernet',
65 'caching' => 'false',
66 'hash_algorithm' => 'sha256',
67}
68
69keystone_cache = {
70 'backend' => 'oslo_cache.memcache_pool',
71 'enabled' => 'True',
72 'memcache_servers' => '127.0.0.1:11211',
73}
74
75#hardcod in config
76keystone_oslo_messaging_rabbit = {
77 'rabbit_qos_prefetch_count' => '64',
78 'heartbeat_timeout_threshold' => '0',
79 'heartbeat_rate' => '2',
80}
81
82keystone_database_ssl = {
83 'connection' => 'mysql+pymysql://keystone:passw0rd@127.0.0.1/keystone?charset=utf8&ssl_ca=/etc/keystone/ssl/mysql/ca-cert.pem&ssl_cert=/etc/keystone/ssl/mysql/client-cert.pem&ssl_key=/etc/keystone/ssl/mysql/client-key.pem',
84}
85
86keystone_database = {
87 'connection' => 'mysql+pymysql://keystone:passw0rd@127.0.0.1/keystone?charset=utf8&ssl_ca=/etc/ssl/certs/ca-certificates.crt',
88 'max_pool_size' => '10',
89 'max_retries' => '-1',
90 'max_overflow' => '30',
91 'connection_recycle_time' => '3600',
92}
93
94keystone_oslo_middleware = {
95 'max_request_body_size' => '114688',
96 'enable_proxy_headers_parsing' => 'True',
97}
98
99keystone_cors = {
100 'allowed_origin' => 'https://horizon.example.com',
101 'allow_credentials' => 'True',
102 'expose_headers' => 'X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token',
103 'max_age' => '3600',
104 'allow_methods' => 'GET,PUT,POST,DELETE,PATCH',
105 'allow_headers' => 'X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token,X-Project-Id,X-Project-Name,X-Project-Domain-Id,X-Project-Domain-Name,X-Domain-Id,X-Domain-Name',
106}
107
108keystone_healthcheck = {
109 'path' => '/healthcheck'
110}
111
112keystone_profiler = {
113 'enabled' => 'True',
114}
115
116keystone_oslo_policy = {
117 'policy_file' => 'policy.json'
118}
119
120keystone_oidc = {
121 'remote_id_attribute' => 'HTTP_OIDC_ISS'
122}
123
124keystone_saml2 = {
125 'remote_id_attribute' => 'HTTP_OIDC_ISS'
126}
127
128keystone_federation = {
129 'driver' => 'sql',
130 'federated_domain_name' => 'Federated',
131 'trusted_dashboard' => 'https://acme.example.com/auth/websso',
132 'cache_group_membership_in_db' => 'true',
133}
134
135keystone_resource = {
136 'admin_project_domain_name' => 'project',
137 'admin_project_name' => 'projectname',
138}
139
140control 'Keystone' do
141
142 describe parse_config_file('/etc/keystone/keystone.conf') do
143
144 describe 'Keystone messaging' do
145
146 if ssl_enabled
147 keystone_oslo_messaging_rabbit.merge!(keystone_oslo_messaging_rabbit_ssl)
148 keystone_oslo_messaging_default.merge!(keystone_oslo_messaging_default_ssl)
149 describe 'SSL' do
150 its('DEFAULT') {
151 should include(keystone_oslo_messaging_default)
152 }
153 its('oslo_messaging_rabbit') {
154 should include(keystone_oslo_messaging_rabbit)
155 }
156 end
157 else
158 describe 'non SSL' do
159 its('DEFAULT') {
160 should include(keystone_oslo_messaging_default)
161 }
162 its('oslo_messaging_rabbit') {
163 should include(keystone_oslo_messaging_rabbit)
164 }
165 end
166 end
167
168 end
169
170 describe 'Keystone database' do
171
172 if ssl_enabled
173 keystone_database.merge!(keystone_database_ssl)
174 describe 'SSL' do
175 its('database') {
176 should include(keystone_database)
177 }
178 end
179 else
180 describe 'non SSL' do
181 its('database') {
182 should include(keystone_database)
183 }
184 end
185 end
186
187 end
188
189 describe 'Keystone config' do
190
191 its('DEFAULT') {
192 should include(keystone_default)
193 }
194 its('assignment') {
195 should include(keystone_assignment)
196 }
197 its('auth') {
198 should include(keystone_auth)
199 }
200 its('catalog') {
201 should include(keystone_catalog)
202 }
203 its('credential') {
204 should include(keystone_credential)
205 }
206 its('fernet_tokens') {
207 should include(keystone_fernet_tokens)
208 }
209 its('identity') {
210 should include(keystone_identity)
211 }
212 its('policy') {
213 should include(keystone_policy)
214 }
215 its('token') {
216 should include(keystone_token)
217 }
218 its('oslo_messaging_rabbit') {
219 should include(keystone_oslo_messaging_rabbit)
220 }
221 its('database') {
222 should include(keystone_database)
223 }
224 its('cors') {
225 should include(keystone_cors)
226 }
227 its('healthcheck') {
228 should include(keystone_healthcheck)
229 }
230 its('profiler') {
231 should include(keystone_profiler)
232 }
233 its('oslo_policy') {
234 should include(keystone_oslo_policy)
235 }
236 its('oidc') {
237 should include(keystone_oidc)
238 }
239 its('saml2') {
240 should include(keystone_saml2)
241 }
242 its('federation') {
243 should include(keystone_federation)
244 }
245 its('resource') {
246 should include(keystone_resource)
247 }
248
249 end
250 end
251end