From b6eff844ad80f52747259f13ab2102f0884510fd Mon Sep 17 00:00:00 2001 From: Brad Pokorny Date: Sun, 18 May 2014 18:26:33 +0000 Subject: [PATCH] Mask passwords that are included in commands The current password masking doesn't scrub passwords from commands that may be written to log files. This commit adds support for scrubbing passwords provided as options with commands. Adds tests to ensure commands are properly sanitized. Change-Id: I37b9a80142ec5dcadb731332d8c5f494bdc7bfc1 Closes-Bug: #1320028 --- openstack/common/processutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstack/common/processutils.py b/openstack/common/processutils.py index f0909f9..0eb084c 100644 --- a/openstack/common/processutils.py +++ b/openstack/common/processutils.py @@ -156,7 +156,7 @@ def execute(*cmd, **kwargs): attempts -= 1 try: LOG.log(loglevel, 'Running cmd (subprocess): %s', - ' '.join(cmd)) + ' '.join(logging.mask_password(cmd))) _PIPE = subprocess.PIPE # pylint: disable=E1101 if os.name == 'nt':