pve-manager/PVE/API2
Max Carrara 11edd5d88d fix #4759: ceph: configure ceph-crash.service and its key
Due to Ceph dropping privileges when running the 'ceph-crash' daemon
[0], it is necessary to allow the daemon to authenticate with its
cluster in a safe manner.

In order to avoid exposing sensitive keyrings or somehow escalating
its privileges again, 'ceph-crash' is therefore provided with its own
keyring in the '/etc/pve/ceph' directory. This directory, due to being
on 'pmxcfs', may be read by members of the 'www-data' group, which
'ceph-crash' is made part of [1].

Expected Configuration
----------------------

 1. A keyring file named '/etc/pve/ceph/ceph.client.crash.keyring'
    exists
 2. A section named 'client.crash' exists in '/etc/pve/ceph.conf'
 3. The 'client.crash' section has a key named 'keyring' which
    references the keyring file as '/etc/pve/ceph/$cluster.$name.keyring'
 4. The 'client.crash' section has *no* key named 'key'

New Clusters
------------

The keyring file is created and the conf file is updated after the first
monitor has been created (when calling `pveceph mon create`).

Existing Clusters
-----------------

A new helper script creates and configures the 'client.crash' keyring in
`postinst`, if:
 * Ceph is installed
 * Ceph is initialized ('/etc/pve/ceph.conf' and '/etc/pve/ceph' exist)
 * Connection to RADOS is successful

If the above conditions are met, the helper script ensures that the
existing configuration matches the expected configuration mentioned
above.

The configuration is not changed if it is already as expected.

The helper script may be called again manually if the `postinst` hook
fails. It is installed to '/usr/share/pve-manager/helpers/pve-init-ceph-crash'.

Existing `client.crash` Key
---------------------------

If a key named 'client.crash' already exists within the cluster, it is
reused and not regenerated.

[0]: https://github.com/ceph/ceph/pull/48713
[1]: https://git.proxmox.com/?p=ceph.git;a=commitdiff;h=f72c698a55905d93e9a0b7b95674616547deba8a

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
2024-04-11 10:42:11 +02:00
..
Ceph fix #4759: ceph: configure ceph-crash.service and its key 2024-04-11 10:42:11 +02:00
Cluster api: notification: simplify ACLs for notification 2023-11-17 16:20:03 +01:00
Hardware makefile: convert to use simple parenthesis 2023-05-29 18:24:00 +02:00
ACME.pm api: ACME revoke: do not abort if CA is just expired 2020-08-19 18:52:48 +02:00
ACMEAccount.pm acme: mark caaIdentities as an array 2023-11-13 15:15:22 +01:00
ACMEPlugin.pm ACME: add comment for implicit standalone plugin fallback 2020-05-07 13:53:05 +02:00
APT.pm add missing library packages 2024-01-12 16:48:24 +01:00
Backup.pm api: backup: refactor backup permission check 2023-07-27 10:40:17 +02:00
Capabilities.pm api: move cpu path into qemu/capabilities 2021-06-09 11:29:34 +02:00
Ceph.pm ceph: introduce '/etc/pve/ceph' 2024-04-11 10:42:11 +02:00
Certificates.pm fix #2771: relax cert API endpoints permissions 2020-06-17 14:00:43 +02:00
Cluster.pm api: prepare api handler module for notification config 2023-08-16 11:10:15 +02:00
HAConfig.pm use new ha infrastructure 2015-04-03 08:36:59 +02:00
Hardware.pm api: add resource map api endpoints for PCI and USB 2023-06-16 16:25:42 +02:00
Makefile makefile: convert to use simple parenthesis 2023-05-29 18:24:00 +02:00
Network.pm sdn: regenerate DHCP config on reload 2023-11-21 20:27:38 +01:00
NodeConfig.pm api: fill in nodeconfig schema 2022-03-17 14:24:20 +01:00
Nodes.pm node: wake-on-lan: document defaults and small style clean-up 2024-03-28 17:52:25 +01:00
Pool.pm fix #1148: api: pools: support nested pools 2023-11-20 12:26:21 +01:00
Replication.pm api: replication: adapt to matcher-based notification system 2023-11-17 16:20:03 +01:00
ReplicationConfig.pm api: replication: allow users to enumerate accessible replication jobs 2023-12-04 16:53:38 +01:00
Services.pm api/services: add pvescheduler to the service list 2021-11-12 16:17:36 +01:00
Subscription.pm subscription: remove ceph APT auth if invalid 2023-10-25 18:45:48 +02:00
Tasks.pm fix #4521: api/tasks: replace upid as filename for task log downloads 2023-02-09 17:18:52 +01:00
VZDump.pm vzdump: adapt to new matcher based notification system 2023-11-17 16:20:03 +01:00