From: Redouane Kachach Date: Thu, 30 Jun 2022 12:10:34 +0000 (+0200) Subject: mgr/cephadm: limitting ingress/keepalived pass to 8 chars X-Git-Tag: v17.2.4~184^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=570ea39c25a265da4a7314cca7d9b6f2a25c7387;p=ceph.git mgr/cephadm: limitting ingress/keepalived pass to 8 chars Fixes: https://tracker.ceph.com/issues/55491 Signed-off-by: Redouane Kachach (cherry picked from commit 4fe59545ec8a4d7677bb7949ab283acf4b15b6cf) --- diff --git a/src/pybind/mgr/cephadm/services/ingress.py b/src/pybind/mgr/cephadm/services/ingress.py index cd5936ec69778..cf735798ba7cf 100644 --- a/src/pybind/mgr/cephadm/services/ingress.py +++ b/src/pybind/mgr/cephadm/services/ingress.py @@ -15,6 +15,7 @@ logger = logging.getLogger(__name__) class IngressService(CephService): TYPE = 'ingress' + MAX_KEEPALIVED_PASS_LEN = 8 def primary_daemon_type(self) -> str: return 'haproxy' @@ -77,7 +78,7 @@ class IngressService(CephService): password = self.mgr.get_store(pw_key) if password is None: if not spec.monitor_password: - password = ''.join(random.choice(string.ascii_lowercase) for _ in range(20)) + password = ''.join(random.choice(string.ascii_lowercase) for _ in range(self.MAX_KEEPALIVED_PASS_LEN)) self.mgr.set_store(pw_key, password) else: if spec.monitor_password: @@ -176,7 +177,7 @@ class IngressService(CephService): password = self.mgr.get_store(pw_key) if password is None: if not spec.keepalived_password: - password = ''.join(random.choice(string.ascii_lowercase) for _ in range(20)) + password = ''.join(random.choice(string.ascii_lowercase) for _ in range(self.MAX_KEEPALIVED_PASS_LEN)) self.mgr.set_store(pw_key, password) else: if spec.keepalived_password: