pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0097-Hide-PKI-Client-database-password-in-log-file.patch

483b06
From 4106c7dcfc685580eeb0f2074872036cd5faaaae Mon Sep 17 00:00:00 2001
483b06
From: Abhijeet Kasurde <akasurde@redhat.com>
483b06
Date: Thu, 27 Apr 2017 16:23:41 +0530
483b06
Subject: [PATCH] Hide PKI Client database password in log file
483b06
483b06
This fix masks PKI client database password from showing
483b06
in CA/KRA installer log file
483b06
483b06
Fixes https://pagure.io/freeipa/issue/6904
483b06
483b06
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
483b06
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
483b06
---
483b06
 ipaserver/install/cainstance.py  | 5 ++++-
483b06
 ipaserver/install/krainstance.py | 9 ++++++---
483b06
 2 files changed, 10 insertions(+), 4 deletions(-)
483b06
483b06
diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
483b06
index 0672bccf79d7cc6133fdb20f0854366306bfc2e0..84d60bfddc0fb968f31706e54e36557e9543846e 100644
483b06
--- a/ipaserver/install/cainstance.py
483b06
+++ b/ipaserver/install/cainstance.py
483b06
@@ -610,7 +610,10 @@ class CAInstance(DogtagInstance):
483b06
         try:
483b06
             DogtagInstance.spawn_instance(
483b06
                 self, cfg_file,
483b06
-                nolog_list=(self.dm_password, self.admin_password, pki_pin)
483b06
+                nolog_list=(self.dm_password,
483b06
+                            self.admin_password,
483b06
+                            pki_pin,
483b06
+                            self.tmp_agent_pwd)
483b06
             )
483b06
         finally:
483b06
             os.remove(cfg_file)
483b06
diff --git a/ipaserver/install/krainstance.py b/ipaserver/install/krainstance.py
483b06
index fc25ac72b0dc593f06a8b070b67b5d54a0ab8bce..c39d6874a9d685f91b5d30ea1954320b8ee0c1ed 100644
483b06
--- a/ipaserver/install/krainstance.py
483b06
+++ b/ipaserver/install/krainstance.py
483b06
@@ -150,6 +150,7 @@ class KRAInstance(DogtagInstance):
483b06
         os.chown(cfg_file, pent.pw_uid, pent.pw_gid)
483b06
         self.tmp_agent_db = tempfile.mkdtemp(
483b06
                 prefix="tmp-", dir=paths.VAR_LIB_IPA)
483b06
+        tmp_agent_pwd = ipautil.ipa_generate_password()
483b06
 
483b06
         # Create KRA configuration
483b06
         config = ConfigParser()
483b06
@@ -173,8 +174,7 @@ class KRAInstance(DogtagInstance):
483b06
 
483b06
         # Client security database
483b06
         config.set("KRA", "pki_client_database_dir", self.tmp_agent_db)
483b06
-        config.set("KRA", "pki_client_database_password",
483b06
-                   ipautil.ipa_generate_password())
483b06
+        config.set("KRA", "pki_client_database_password", tmp_agent_pwd)
483b06
         config.set("KRA", "pki_client_database_purge", "True")
483b06
         config.set("KRA", "pki_client_pkcs12_password", self.admin_password)
483b06
 
483b06
@@ -283,7 +283,10 @@ class KRAInstance(DogtagInstance):
483b06
         try:
483b06
             DogtagInstance.spawn_instance(
483b06
                 self, cfg_file,
483b06
-                nolog_list=(self.dm_password, self.admin_password, pki_pin)
483b06
+                nolog_list=(self.dm_password,
483b06
+                            self.admin_password,
483b06
+                            pki_pin,
483b06
+                            tmp_agent_pwd)
483b06
             )
483b06
         finally:
483b06
             os.remove(p12_tmpfile_name)
483b06
-- 
483b06
2.12.2
483b06