From f1c2b23e505eee817934b3c4c032346cd09c48c1 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Tue, 24 Nov 2026 08:42:27 +0100 Subject: [PATCH] operations guide: validate the cephx keys osism/ansible-playbooks adds validate-ceph-keys, run as osism validate ceph-keys (python-osism), a read-only validator for the cephx keys. Nothing in the documentation describes it yet. Add an operations-guide page for it and link it from the Ceph page's section on the validators. The page says what the command checks and where it writes its report: - It runs on the first manager, fails if a check fails, prints a line per check and every row that did not pass, and writes the JSON report to /opt/reports/validator/ceph-keys-validator-- report.json. Comparisons show no key or part of one. - pending-keys: a pending key is a rotation that is not finished; each is named with what commits it (the repository step and the service applies, osism apply cephclient, the next start of an OSD for a lockbox key). For any other entity: find out what uses it, then ceph auth commit-pending or ceph auth clear-pending. - old-key-type: keys of the type aes are listed, and fail the check only with ceph_validate_strict true or when auth_allowed_ciphers excludes aes. - monitor-copies: /etc/ceph/ceph..keyring on every monitor node for client.admin and the openstack_keys on the cluster; a missing file or a pending key line fails. - checkout: the keyring files copy-ceph-keys writes into the manager's checkout hold the current key and are unmodified in git. Without configuration_directory (the OSISM defaults set /opt/configuration) the check fails with "checkout @ manager: failed - configuration_directory is not set". - running-guests: each QEMU process started after libvirt loaded the current secrets; a compute node whose secrets do not hold the current keys fails on its own, and a nova_libvirt restart without a key change can name instances that are fine, never the reverse. - An unreachable monitor or compute node fails its part only. The page does not name the rotation play, which is a separate change; it describes the validator as it is on its own. The page needs validate-ceph-keys (osism/ansible-playbooks) and osism validate ceph-keys (python-osism) in a release before it can be published. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Roger Luethi --- .../ceph/cephx-key-validation.md | 88 +++++++++++++++++++ docs/guides/operations-guide/ceph/index.md | 3 + 2 files changed, 91 insertions(+) create mode 100644 docs/guides/operations-guide/ceph/cephx-key-validation.md diff --git a/docs/guides/operations-guide/ceph/cephx-key-validation.md b/docs/guides/operations-guide/ceph/cephx-key-validation.md new file mode 100644 index 0000000000..6021f30ad1 --- /dev/null +++ b/docs/guides/operations-guide/ceph/cephx-key-validation.md @@ -0,0 +1,88 @@ +--- +sidebar_label: cephx key validation +--- + +# cephx key validation + +`osism validate ceph-keys` checks the cephx keys of the Ceph cluster: that no +rotation is left unfinished, that every copy of a key the deployment keeps holds the +current key, and that every running instance uses it. It changes nothing. + +```console +osism validate ceph-keys +``` + +It runs on the first manager node and fails if any of its checks fails. It prints one line +per check and, below it, every entry that did not pass. The same results are written as a +JSON report on the manager: +`/opt/reports/validator/ceph-keys-validator--report.json`, as the other Ceph +validators do. Neither the output nor the report contains a key or any part of one: +comparisons say only whether two copies hold the same key. + +## The checks + +### pending-keys + +No entity has a pending key. A pending key is a new key that Ceph keeps next to the old +one until its first use commits it, so a pending key is a rotation that is not finished. +Each one is named with what commits it: for the keys of the OpenStack services, putting +the keyring files of the manager's checkout into the configuration repository and applying +the services; for `client.admin`, `osism apply cephclient`; for the lockbox key of an +encrypted OSD, the next start of that OSD. For a pending key of any other entity, find out +what uses the entity, then commit the key with `ceph auth commit-pending ` or drop it +with `ceph auth clear-pending `. + +### old-key-type + +Lists the entities whose key is of the old key type `aes`. Ceph 19.2.6 and 20.2.4 add the +stronger type `aes256k` and report every key of the old type in `ceph health detail`. + +Keys of the old type are listed without failing the check, unless `ceph_validate_strict` +is true (as in the other Ceph validators) or the monitors no longer allow the old type +(`auth_allowed_ciphers` excludes `aes`): + +```console +osism validate ceph-keys -e ceph_validate_strict=true +``` + +### monitor-copies + +`/etc/ceph/ceph..keyring` on every monitor node holds the current key, for +`client.admin` and the keys of the OpenStack services (`openstack_keys`) that exist on the +cluster. `osism apply copy-ceph-keys` copies the keyrings into the configuration +repository from here, so a missing file fails as well. A file that carries a pending key +line fails, because Ceph clients cannot read it. + +### checkout + +Each keyring file that `osism apply copy-ceph-keys` writes into the manager's checkout of +the configuration repository, and that exists there, holds the current key and is +unmodified in git. A file that holds the current key but is modified has not reached the +repository yet, and the next `osism apply configuration` would bring back what the +repository holds. Encrypted keyring files are decrypted for the comparison. + +The check needs `configuration_directory`, which the OSISM defaults set to +`/opt/configuration`. If it is not set, the check fails with +`checkout @ manager: failed - configuration_directory is not set`. + +### running-guests + +On every compute node (inventory group `compute`), every QEMU process started after +libvirt loaded the current keys of its Ceph secrets. A running instance keeps the key its +QEMU process was started with. Once the old key is no longer valid, such an instance keeps +working only as long as it keeps its connection to the monitors; once it loses that +connection, its I/O freezes at the next new connection to an OSD. The +check names each instance that still holds the old key, with its UUID and compute node: +live-migrate it, or stop and start it. + +Before the instances are compared, the libvirt secrets themselves have to hold the current +keys, in kolla's copy (`/etc/kolla/nova-libvirt/secrets`) and in the `nova_libvirt` +container. A compute node whose secrets do not fails on its own, without its instances: +`osism apply nova` has not given it the current keys. Run `osism apply nova` again. + +A restart of the `nova_libvirt` container without a key change makes the check name +instances that started before it, although they hold the current key; it never misses an +instance that holds the old key. Without compute nodes, the check is skipped. + +A monitor or compute node that cannot be reached fails its part of the checks; the other +nodes are still checked. diff --git a/docs/guides/operations-guide/ceph/index.md b/docs/guides/operations-guide/ceph/index.md index e5691bc535..0370d1486e 100644 --- a/docs/guides/operations-guide/ceph/index.md +++ b/docs/guides/operations-guide/ceph/index.md @@ -654,6 +654,9 @@ These playbooks will validate that the deployed Ceph environment matches the configuration and is overall in a healthy state. The playbooks will generate report files in JSON format on the first manager node in `/opt/reports/validator`. +`osism validate ceph-keys` checks the cephx keys, see +[cephx key validation](./cephx-key-validation.md). + ### Shutdown a Ceph cluster In order to fully shutdown a Ceph cluster safely, you first do the following steps: