Skip to content

Commit

Permalink
Fixed style issues
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Breitweg [email protected]

Signed-off-by: Dr. Jason Breitweg <[email protected]>
  • Loading branch information
tuxpreacher committed Oct 10, 2023
1 parent 28317d5 commit ef30e53
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sos/report/plugins/pulp.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,13 @@ def postproc(self):
repl = r"\1********"
self.do_path_regex_sub("/etc/pulp(.*)(.json$)", jreg, repl)

# obfuscate SECRET_KEY = .., 'PASSWORD': .., and AUTH_LDAP_BIND_PASSWORD = .. in dynaconf list output
# and also in settings.py
# obfuscate SECRET_KEY = .., 'PASSWORD': ..,
# and AUTH_LDAP_BIND_PASSWORD = ..
# in dynaconf list output and also in settings.py
# count with option that PASSWORD is with(out) quotes or in capitals
key_pass_re = r"((?:SECRET_KEY|AUTH_LDAP_BIND_PASSWORD)(?:\<.+\>)?(\s*=)?|(password|PASSWORD)(\"|'|:)+)\s*(\S*)"
key_pass_re = "((?:SECRET_KEY|AUTH_LDAP_BIND_PASSWORD)" \
"(?:\<.+\>)?(\s*=)?|(password|PASSWORD)" \
"(\"|'|:)+)\s*(\S*)"
repl = r"\1 ********"
self.do_path_regex_sub("/etc/pulp/settings.py", key_pass_re, repl)
self.do_cmd_output_sub("dynaconf list", key_pass_re, repl)
Expand Down

0 comments on commit ef30e53

Please sign in to comment.