diff options
author | Bryan Quigley <bryan.quigley@canonical.com> | 2015-03-06 17:24:25 -0500 |
---|---|---|
committer | Adam Stokes <adam.stokes@ubuntu.com> | 2015-03-26 12:42:42 -0400 |
commit | 0940031a1496027d3ac38b7ae642ee493d8ae3d5 (patch) | |
tree | 289e0aadc46c061957dc5b6d056410641174c51e | |
parent | ec30e7eaa14552c50125a0598ba86f7be107ed67 (diff) | |
download | sos-0940031a1496027d3ac38b7ae642ee493d8ae3d5.tar.gz |
[logs] Remove passwords from rsyslog
Specifically this removes passwords
from the following patterns
$ActionLibdbiPassword <removes rest of line>
pwd=<removes rest of line>
Closes #525
Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
-rw-r--r-- | sos/plugins/logs.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py index f7bb667a..e423b637 100644 --- a/sos/plugins/logs.py +++ b/sos/plugins/logs.py @@ -50,6 +50,18 @@ class Logs(Plugin): if os.path.isfile(i): self.add_copy_spec_limit(i, sizelimit=self.limit) + def postproc(self): + self.do_path_regex_sub( + r"/etc/rsyslog*", + r"ActionLibdbiPassword (.*)", + r"ActionLibdbiPassword [********]" + ) + self.do_path_regex_sub( + r"/etc/rsyslog*", + r"pwd=.*", + r"pwd=[******]" + ) + class RedHatLogs(Logs, RedHatPlugin): @@ -95,5 +107,4 @@ class DebianLogs(Logs, DebianPlugin, UbuntuPlugin): else: self.add_copy_spec("/var/log/") - # vim: et ts=4 sw=4 |