Skip to content

Commit 1ceb714

Browse files
committed
Secret rotation docs post-review changes
1 parent 43477f7 commit 1ceb714

File tree

2 files changed

+59
-54
lines changed

2 files changed

+59
-54
lines changed

doc/source/operations/secret-rotation.rst

Lines changed: 58 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ be automatically regenerated with a ``kayobe overcloud service deploy``.
1616
Some secrets require manual input from the operator to change.
1717

1818
Following this process, there may be a few seconds of network downtime for
19-
running VMs when Neutron is reconfigured.
19+
running VMs when Neutron is reconfigured when using ML2/OVS.
2020

2121
There will be API downtime for all services. The main reason for the outage is
2222
that RabbitMQ must be completely stopped to change the secrets it uses. The
@@ -77,8 +77,7 @@ Full method
7777
``kolla_docker`` dict in ``ansible/roles/nova/tasks/bootstrap_service.yml`` See
7878
`here
7979
<https://github.com/stackhpc/kolla-ansible/pull/496/commits/9da473a63414493517da668075b8c958fec56e96>`__
80-
for an example. (If you are using the latest ``stackhpc/yoga`` branch of
81-
Kolla-Ansible this should already be set)
80+
for an example.
8281

8382
.. code::
8483
@@ -144,9 +143,20 @@ Full method
144143
``kayobe-config/etc/kayobe/ansible/`` if not, merge the latest
145144
``stackhpc-kayobe-config``
146145

147-
.. code:: bash
146+
1. Run the playbook to generate a new keypair and add it to the authorised
147+
keys of your hosts.
148+
149+
.. code:: bash
150+
151+
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/rekey-hosts.yml
152+
153+
2. Ensure you can SSH to other nodes using the new keypair
154+
155+
3. Re-run the playbook with arguments to remove the old keypair.
156+
157+
.. code:: bash
148158
149-
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/rekey-hosts.yml
159+
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/rekey-hosts.yml -t remove-key -e rekey_remove_existing_key=true
150160
151161
10. Update the Pulp password
152162

@@ -165,8 +175,7 @@ Full method
165175
kayobe seed service deploy -t seed-deploy-containers -kt none
166176
167177
(note you may need to skip docker registry login since the password will
168-
now be ‘incorrect’ e.g. ``-e``
169-
``deploy_containers_registry_attempt_login``)
178+
now be ‘incorrect’ e.g. ``-e deploy_containers_registry_attempt_login=false``)
170179

171180
11. Rotate ``horizon_secret_key``
172181

@@ -197,20 +206,20 @@ Full method
197206
198207
pwgen -s 40 1
199208
200-
2. Exec into the Grafana container on a controller
209+
2. Update the value of ``grafana_admin_password`` in ``passwords.yml``
210+
211+
3. Exec into the Grafana container on a controller
201212

202213
.. code:: bash
203214
204215
sudo docker exec -it grafana bash
205216
206-
3. Run the password reset command, then enter the new password
217+
4. Run the password reset command, then enter the new password
207218

208219
.. code:: bash
209220
210221
grafana-cli admin reset-admin-password --password-from-stdin
211222
212-
4. Update the value of ``grafana_admin_password`` in ``passwords.yml``
213-
214223
13. Update the MariaDB database password
215224

216225
1. Generate a new secret:
@@ -219,52 +228,51 @@ Full method
219228
220229
pwgen -s 40 1
221230
222-
2. Exec into the MariaDB container on a controller
231+
2. Update ``database_password`` in ``passwords.yml`` with your new
232+
password. Make a note of the old password.
233+
234+
3. Exec into the MariaDB container on a controller
223235

224236
.. code:: bash
225237
226238
sudo docker exec -it mariadb bash
227239
228-
3. Log in to the database. You will be prompted for the password. Use the
229-
existing value of ``database_password``
240+
4. Log in to the database. You will be prompted for the password. Use the
241+
old value of ``database_password``
230242

231243
.. code:: bash
232244
233245
mysql -uroot -p
234246
235-
4. Check the current state of the ``root`` user
247+
5. Check the current state of the ``root`` user
236248

237249
.. code:: bash
238250
239251
SELECT Host,User,Password FROM mysql.user WHERE User='root';
240252
241-
5. Update the password for the ``root`` user
253+
6. Update the password for the ``root`` user
242254

243255
.. code:: bash
244256
245257
SET PASSWORD FOR 'root'@'%' = PASSWORD('newpassword');
246258
247-
6. Check that the password hash has changed in the user list
259+
7. Check that the password hash has changed in the user list
248260

249261
.. code:: bash
250262
251263
SELECT Host,User,Password FROM mysql.user WHERE User='root';
252264
253-
7. If there are any remaining root users with the old password e.g.
265+
8. If there are any remaining root users with the old password e.g.
254266
``root@localhost``, change the password for them too
255267

256-
8. Update ``database_password`` in ``passwords.yml`` with your new
257-
password
258-
259-
260268
.. _nova-change:
261269

262270
14. Update the Nova Database password
271+
263272
.. warning::
264273

265274
From this point onward, service may be disrupted
266275

267-
268276
#. Create a new ``nova_database_password`` and store it in
269277
``passwords.yml``
270278

@@ -296,51 +304,30 @@ Full method
296304
``00000000-0000-0000-0000-000000000000``, change the above command
297305
accordingly)
298306

299-
300307
15. Re-encrypt your ``passwords.yml`` file
301308

309+
16. Stop all OpenStack services
310+
311+
.. code:: bash
312+
313+
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/stop-openstack-services.yml
302314
303315
.. _k-a-change:
304316

305-
16. Delete the service users in Keystone. The exact users will depend on the
317+
17. Delete the service users in Keystone. The exact users will depend on the
306318
deployment. Multinode example:
307319

308320
.. note::
309321

310322
Alternatively, cherry-pick
311-
`this patch <https://review.opendev.org/c/openstack/kolla-ansible/+/903178>`__
323+
`this patch<https://review.opendev.org/c/openstack/kolla-ansible/+/903178>`__
312324

313325

314326
.. code:: bash
315327
316328
openstack user delete glance cinder placement nova neutron heat magnum magnum_trustee_domain_admin barbican designate
317329
318-
17. Stop services using RabbitMQ
319-
320-
.. code:: bash
321-
322-
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/stop-openstack-services.yml
323-
324-
18. Nuke RabbitMQ
325-
326-
.. code:: bash
327-
328-
kayobe overcloud host command run -l controllers --become --command "docker stop rabbitmq && docker rm rabbitmq && docker volume rm rabbitmq"
329-
330-
19. Reconfigure Overcloud services to apply changes
331-
332-
333-
.. warning::
334-
335-
VMs should continue running, but connections to them will briefly be
336-
disrupted when Neutron is redeployed
337-
338-
.. code:: bash
339-
340-
kayobe overcloud service deploy
341-
342-
343-
20. Flush the Memcached data on all controllers (any old data will now be
330+
18. Flush the Memcached data on all controllers (any old data will now be
344331
inaccessible)
345332

346333
#. Install Telnet (on one of the controllers)
@@ -367,6 +354,23 @@ Full method
367354
flush_all
368355
quit
369356
357+
19. Nuke RabbitMQ
358+
359+
.. code:: bash
360+
361+
kayobe overcloud host command run -l controllers --become --command "docker stop rabbitmq && docker rm rabbitmq && docker volume rm rabbitmq"
362+
363+
20. Reconfigure Overcloud services to apply changes
364+
365+
.. warning::
366+
367+
VMs should continue running, but connections to them will briefly be
368+
disrupted when Neutron is redeployed when using ML2/OVS
369+
370+
.. code:: bash
371+
372+
kayobe overcloud service deploy
373+
370374
21. Manually update ``heat_domain_admin_password``
371375

372376
#. TODO: Instructions
@@ -381,7 +385,7 @@ Full method
381385
if individual user accounts are used
382386

383387
2. Any existing ``openrc`` files generated by Kolla Ansible will need to be
384-
re-generated or edited to use the new Kolla admin password
388+
re-generated or edited to use the new Keystone admin password
385389

386390
24. Create a PR to merge the new secrets into your main Kayobe configuration
387391
branch
@@ -505,6 +509,7 @@ Full password list
505509
docker_registry_password
506510
secrets_pulp_password
507511
redis_master_password
512+
haproxy_password
508513
keystone_ssh_key
509514
private_key
510515
public_key

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ commands =
1414
yamllint etc/kayobe
1515
reno lint
1616
# secret-rotation must be skipped because it includes purposeful whitespace
17-
doc8 README.rst doc/source --ignore D001 --ignore-path doc/source/operations/secret-rotation.rst
17+
doc8 README.rst doc/source --ignore D001 --ignore-path-errors doc/source/operations/secret-rotation.rst;D002
1818
# StackHPC Kayobe configuration release notes:
1919
[testenv:releasenotes]
2020
allowlist_externals = rm

0 commit comments

Comments
 (0)