Blame SOURCES/sos-bz1925419-gluster-pubkeys-statusfile.patch

bffc8a
From 51e8213fd3a83e717fe7ef35d48d5c541b077c5f Mon Sep 17 00:00:00 2001
bffc8a
From: Jose Castillo <jcastillo@redhat.com>
bffc8a
Date: Mon, 8 Feb 2021 16:25:34 +0100
bffc8a
Subject: [PATCH] [gluster] Add glusterd public keys and status files
bffc8a
bffc8a
This patch helps capture some missing files in the
bffc8a
gluster plugin, i.e.:
bffc8a
bffc8a
Files inside /var/lib/glusterd/glusterfind, like
bffc8a
*.status files, that store the required timestamps,
bffc8a
*.pem.pub files, that store ssh public keys.
bffc8a
We also need to omit the glusterfind_*_secret.pem,
bffc8a
which contains the openssh private key.
bffc8a
bffc8a
Files inside /var/lib/glusterd/.keys, that contains
bffc8a
*.pem.pub,  the ssh public key.
bffc8a
bffc8a
Closes: RHBZ#1925035, RHBZ#1925419
bffc8a
bffc8a
Resolves: #2411
bffc8a
bffc8a
Signed-off-by: Jose Castillo <jcastillo@redhat.com>
bffc8a
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
bffc8a
---
bffc8a
 sos/report/plugins/gluster.py | 8 +++++++-
bffc8a
 1 file changed, 7 insertions(+), 1 deletion(-)
bffc8a
bffc8a
diff --git a/sos/report/plugins/gluster.py b/sos/report/plugins/gluster.py
bffc8a
index 7b6a9298..e1a89df2 100644
bffc8a
--- a/sos/report/plugins/gluster.py
bffc8a
+++ b/sos/report/plugins/gluster.py
bffc8a
@@ -55,6 +55,9 @@ class Gluster(Plugin, RedHatPlugin):
bffc8a
 
bffc8a
     def setup(self):
bffc8a
         self.add_forbidden_path("/var/lib/glusterd/geo-replication/secret.pem")
bffc8a
+        self.add_forbidden_path(
bffc8a
+            "/var/lib/glusterd/glusterfind/glusterfind_*_secret.pem"
bffc8a
+        )
bffc8a
 
bffc8a
         self.add_cmd_output([
bffc8a
             "gluster peer status",
bffc8a
@@ -72,7 +75,10 @@ class Gluster(Plugin, RedHatPlugin):
bffc8a
             "/etc/glusterfs",
bffc8a
             "/var/lib/glusterd/",
bffc8a
             # collect nfs-ganesha related configuration
bffc8a
-            "/run/gluster/shared_storage/nfs-ganesha/"
bffc8a
+            "/run/gluster/shared_storage/nfs-ganesha/",
bffc8a
+            # collect status files and public ssh keys
bffc8a
+            "/var/lib/glusterd/.keys/",
bffc8a
+            "/var/lib/glusterd/glusterfind/"
bffc8a
         ] + glob.glob('/run/gluster/*tier-dht/*'))
bffc8a
 
bffc8a
         if not self.get_option("all_logs"):
bffc8a
-- 
bffc8a
2.26.2
bffc8a
bffc8a
From 4fb834ec862228afb276ccbd45aa86c66044ea66 Mon Sep 17 00:00:00 2001
bffc8a
From: Pavel Moravec <pmoravec@redhat.com>
bffc8a
Date: Mon, 15 Mar 2021 09:09:51 +0100
bffc8a
Subject: [PATCH] [gluster] collect public keys from the right dir
bffc8a
bffc8a
Collection of glusterfind dir is achieved by /var/lib/gluster
bffc8a
so it doesn't be collected explicitly.
bffc8a
bffc8a
/var/lib/glusterd/glusterfind/.keys/ subdir is required to be
bffc8a
explicitly collected, as add_copy_spec uses glob.glob() that skips
bffc8a
hidden files.
bffc8a
bffc8a
Resolves: #2451
bffc8a
bffc8a
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
bffc8a
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
bffc8a
---
bffc8a
 sos/report/plugins/gluster.py | 5 ++---
bffc8a
 1 file changed, 2 insertions(+), 3 deletions(-)
bffc8a
bffc8a
diff --git a/sos/report/plugins/gluster.py b/sos/report/plugins/gluster.py
bffc8a
index e1a89df2..952cab63 100644
bffc8a
--- a/sos/report/plugins/gluster.py
bffc8a
+++ b/sos/report/plugins/gluster.py
bffc8a
@@ -76,9 +76,8 @@ class Gluster(Plugin, RedHatPlugin):
bffc8a
             "/var/lib/glusterd/",
bffc8a
             # collect nfs-ganesha related configuration
bffc8a
             "/run/gluster/shared_storage/nfs-ganesha/",
bffc8a
-            # collect status files and public ssh keys
bffc8a
-            "/var/lib/glusterd/.keys/",
bffc8a
-            "/var/lib/glusterd/glusterfind/"
bffc8a
+            # collect public ssh keys (a_s_c skips implicit hidden files)
bffc8a
+            "/var/lib/glusterd/glusterfind/.keys/",
bffc8a
         ] + glob.glob('/run/gluster/*tier-dht/*'))
bffc8a
 
bffc8a
         if not self.get_option("all_logs"):
bffc8a
-- 
bffc8a
2.26.2
bffc8a