cloud-init/cloud-init-19.4-cc_set_password-increase-random-pwlength-from-9-to-2.patch
Eduardo Otubo 34fecf9a1f Backport for CVE-2020-8631 and CVE-2020-8632
This commit backports the upstream commits for the CVEs:

- CVE-2020-8632 cloud-init: Too short random password length in
  cc_set_password in config/cc_set_passwords.py
  <https://bugzilla.redhat.com/show_bug.cgi?id=1798729>
  ./cloud-init-19.4-cc_set_password-increase-random-pwlength-from-9-to-2.patch

- CVE-2020-8631 cloud-init: Use of random.choice when generating random
  password
  <https://bugzilla.redhat.com/show_bug.cgi?id=1798732>
  ./cloud-init-19.4-utils-use-SystemRandom-when-generating-random-passwo.patch

Signed-off-by: Eduardo Otubo <otubo@redhat.com>
2020-04-14 15:57:28 +02:00

29 lines
831 B
Diff

From 42788bf24a1a0a5421a2d00a7f59b59e38ba1a14 Mon Sep 17 00:00:00 2001
From: Ryan Harper <ryan.harper@canonical.com>
Date: Fri, 24 Jan 2020 21:33:12 +0200
Subject: [PATCH] cc_set_password: increase random pwlength from 9 to 20 (#189)
Increasing the bits of security from 52 to 115.
LP: #1860795
---
cloudinit/config/cc_set_passwords.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cloudinit/config/cc_set_passwords.py b/cloudinit/config/cc_set_passwords.py
index e3b39d8b..4943d545 100755
--- a/cloudinit/config/cc_set_passwords.py
+++ b/cloudinit/config/cc_set_passwords.py
@@ -236,7 +236,7 @@ def handle(_name, cfg, cloud, log, args):
raise errors[-1]
-def rand_user_password(pwlen=9):
+def rand_user_password(pwlen=20):
return util.rand_str(pwlen, select_from=PW_SET)
--
2.18.1