Blame SOURCES/sos-bz1956672-add-plugin-for-pulp-3_2.patch
|
|
5866eb |
From c7ddda1bb6dc85c0d509b656511fd79d3c1d7e06 Mon Sep 17 00:00:00 2001
|
|
|
5866eb |
From: Jan Jansky <jjansky@redhat.com>
|
|
|
5866eb |
Date: Tue, 15 Jun 2021 17:15:15 +0200
|
|
|
5866eb |
Subject: [PATCH] [pulpcore] obfuscate two passwords from 'dynaconf list'
|
|
|
5866eb |
|
|
|
5866eb |
The command also prints content of /etc/pulp/settings.py
|
|
|
5866eb |
where we need to also obfuscate the SECRET_KEY and PASSWORD values.
|
|
|
5866eb |
|
|
|
5866eb |
Related: #2583
|
|
|
5866eb |
Resolves: #2584
|
|
|
5866eb |
|
|
|
5866eb |
Signed-off-by: Jan Jansky <jjansky@redhat.com>
|
|
|
5866eb |
---
|
|
|
5866eb |
sos/plugins/pulpcore.py | 11 ++++++++++-
|
|
|
5866eb |
1 file changed, 10 insertions(+), 1 deletion(-)
|
|
|
5866eb |
|
|
|
5866eb |
diff --git a/sos/plugins/pulpcore.py b/sos/plugins/pulpcore.py
|
|
|
5866eb |
index 46fa0d5..f4ac467 100644
|
|
|
5866eb |
--- a/sos/plugins/pulpcore.py
|
|
|
5866eb |
+++ b/sos/plugins/pulpcore.py
|
|
|
5866eb |
@@ -115,6 +115,15 @@ class PulpCore(Plugin, IndependentPlugin):
|
|
|
5866eb |
"/etc/pulp/settings.py",
|
|
|
5866eb |
r"(PASSWORD\S*\s*:\s*)(.*)",
|
|
|
5866eb |
r"\1********")
|
|
|
5866eb |
-
|
|
|
5866eb |
+ # apply the same for "dynaconf list" output that prints settings.py
|
|
|
5866eb |
+ # in a pythonic format
|
|
|
5866eb |
+ self.do_cmd_output_sub(
|
|
|
5866eb |
+ "dynaconf list",
|
|
|
5866eb |
+ r"(SECRET_KEY<str>\s*)'(.*)'",
|
|
|
5866eb |
+ r"\1********")
|
|
|
5866eb |
+ self.do_cmd_output_sub(
|
|
|
5866eb |
+ "dynaconf list",
|
|
|
5866eb |
+ r"(PASSWORD\S*\s*:\s*)(.*)",
|
|
|
5866eb |
+ r"\1********")
|
|
|
5866eb |
|
|
|
5866eb |
# vim: set et ts=4 sw=4 :
|
|
|
5866eb |
--
|
|
|
5866eb |
1.8.3.1
|
|
|
5866eb |
|