Blob Blame History Raw
From d03c2fa4439c87783293c922b2825cf86e8818bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Po=C5=82awski?= <ppolawsk@redhat.com>
Date: Fri, 12 Mar 2021 12:42:30 +0100
Subject: [PATCH] [sssd] Enable collecting SSSD memory cache
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

SSSD plugin by default collects only logs and configuration.
This patch enables collecting memory cache maintained
by SSSD daemon. Cache does not contain any client sensible
data so can be safely included in the sos-report.

Resolves: #2444

Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
 sos/report/plugins/sssd.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sos/report/plugins/sssd.py b/sos/report/plugins/sssd.py
index 9469c41c..aeb68c4f 100644
--- a/sos/report/plugins/sssd.py
+++ b/sos/report/plugins/sssd.py
@@ -10,6 +10,7 @@
 
 from sos.report.plugins import (Plugin, RedHatPlugin, DebianPlugin,
                                 UbuntuPlugin, SoSPredicate)
+from glob import glob
 
 
 class Sssd(Plugin):
@@ -22,11 +23,22 @@ class Sssd(Plugin):
 
     def setup(self):
         self.add_copy_spec([
+            # main config file
             "/etc/sssd/sssd.conf",
-            "/var/log/sssd/*",
-            "/var/lib/sss/pubconf/krb5.include.d/*",
             # SSSD 1.14
-            "/etc/sssd/conf.d/*.conf"
+            "/etc/sssd/conf.d/*.conf",
+            # dynamic Kerberos configuration
+            "/var/lib/sss/pubconf/krb5.include.d/*"
+        ])
+
+        # add individual log files
+        self.add_copy_spec(glob("/var/log/sssd/*log*"))
+
+        # add memory cache
+        self.add_copy_spec([
+            "/var/lib/sss/mc/passwd",
+            "/var/lib/sss/mc/group",
+            "/var/lib/sss/mc/initgroups"
         ])
 
         # call sssctl commands only when sssd service is running,
-- 
2.26.3