]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
auth: add a configurable to control rotating keys cipher type
authorYehuda Sadeh <ysadehwe@ibm.com>
Fri, 7 Mar 2025 18:20:58 +0000 (13:20 -0500)
committerPatrick Donnelly <pdonnell@ibm.com>
Mon, 22 Sep 2025 16:31:30 +0000 (12:31 -0400)
auth_service_cipher: a mon configurable that determines what type of cipher
the rotating keys are using. The configurable can change at runtime. Note
that the change does not invalidate existing keys, these would expire
based on their ttl.

Signed-off-by: Yehuda Sadeh <ysadehwe@ibm.com>
(cherry picked from commit c37d1f44b64e0079c5c71232b6472a7841768d40)

src/auth/cephx/CephxKeyServer.cc
src/common/options/global.yaml.in

index 55df5c5d422b45e8ee9e31e1ff1ccf4bc6c9c196..2a3e5364bf52344985e6acbdc581daa085b6a76f 100644 (file)
@@ -182,7 +182,14 @@ int KeyServer::_rotate_secret(uint32_t service_id, KeyServerData &pending_data)
 
   while (r.need_new_secrets(now)) {
     ExpiringCryptoKey ek;
-    generate_secret(ek.key);
+    auto s = cct->_conf.get_val<string>("auth_service_cipher");
+
+    int key_type = CryptoManager::get_key_type(s);
+    if (key_type < 0 || key_type == CEPH_CRYPTO_NONE) {
+      key_type = CEPH_CRYPTO_AES256KRB5;
+    }
+    
+    generate_secret(ek.key, key_type);
     if (r.empty()) {
       ek.expiration = now;
     } else {
index 5b7d589277cc16937ebf103f4381112a28eeaab7..b69bbad5d36db99afb5dfcede0bfbbe17d159a26 100644 (file)
@@ -2155,6 +2155,33 @@ options:
    Ceph services. Valid settings are ``cephx`` or ``none``.
   default: cephx
   with_legacy: true
+- name: auth_service_cipher
+  type: str
+  level: advanced
+  desc: cipher type that is used to encrypt service tickets.
+  fmt_desc: When service tickets are being generaeted, this would
+   be the cipher that will be used to encrypt them. This requires
+   that all the services support the specific cipher. Valid settings
+   are ``aes` or ``aes256k``.
+  default: aes
+  services:
+  - mon
+  enum_values:
+  - aes
+  - aes256k
+  with_legacy: false
+  flags:
+  - runtime
+- name: auth_cipher_allow
+  type: str
+  level: advanced
+  desc: cipher types that are allowed to be used for authentication
+  fmt_desc: This list of cipher types determines which ciphers are
+   allowed to be used for the clients and services to establish
+   a connection to the cluster via the cephx autentication protocol.
+   Valid options are ``aes` or ``aes256k``.
+  default: aes, aes256k
+  with_legacy: true
 # what clients require of daemons
 - name: auth_client_required
   type: str