Skip to content

Commit

Permalink
[iscsi] Scrub password_in strings
Browse files Browse the repository at this point in the history
Scrub strings in password_in in /etc/iscsi/iscsid.conf
and the files within te directory /var/lib/iscsi/nodes/,
i.e. /var/lib/iscsi/nodes/*/*/default and others.

Fixes: RHBZ#2187859

Signed-off-by: Jose Castillo <jcastillo@redhat.com>
  • Loading branch information
jcastill authored and TurboTurtle committed Apr 25, 2023
1 parent 8309f6b commit d8794b9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sos/report/plugins/iscsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,18 @@ def postproc(self):
# to
#
# node.session.auth.password = ********
nodesessionpwd = r"(node\.session\.auth\.password\s+=\s+)(\S+)"
discoverypwd = r"(discovery\.sendtargets\.auth\.password\s+=\s+)(\S+)"
nodesessionpwd = r"(node\.session\.auth\.password(_in)?\s+=\s+)(\S+)"
discoverypwd = (
r"(discovery\.sendtargets\.auth\.password(_in)?"
r"\s+=\s+)(\S+)"
)
repl = r"\1********\n"
self.do_path_regex_sub('/etc/iscsi/iscsid.conf', nodesessionpwd, repl)
self.do_path_regex_sub('/etc/iscsi/iscsid.conf', discoverypwd, repl)
self.do_path_regex_sub(
'/var/lib/iscsi/nodes/*/*/*', nodesessionpwd, repl)
self.do_path_regex_sub(
'/var/lib/iscsi/nodes/*/*/*', discoverypwd, repl)


class RedHatIscsi(Iscsi, RedHatPlugin):
Expand Down

0 comments on commit d8794b9

Please sign in to comment.