Mask passwords with iscsiadm commands

This patch adds the fix that exists in the nova
libvirt volume code to use oslo_utils strutils
to mask passwords that might show up in debug log
messages.

Change-Id: I632eb4d71588736ab21327824d0506c13f3933ae
Closes-Bug: 1445137
This commit is contained in:
Walter A. Boring IV 2015-04-16 10:42:47 -07:00
parent a1a4c7e644
commit 7ee5a43a75
2 changed files with 7 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import time
from oslo_concurrency import lockutils
from oslo_concurrency import processutils as putils
from oslo_log import log as logging
from oslo_utils import strutils
import six
S390X = "s390x"
@ -451,8 +452,11 @@ class ISCSIConnector(InitiatorConnector):
*iscsi_command, run_as_root=True,
root_helper=self._root_helper,
check_exit_code=check_exit_code)
LOG.debug("iscsiadm %(iscsi_command)s: stdout=%(out)s stderr=%(err)s",
{'iscsi_command': iscsi_command, 'out': out, 'err': err})
msg = ("iscsiadm %(iscsi_command)s: stdout=%(out)s stderr=%(err)s",
{'iscsi_command': iscsi_command, 'out': out, 'err': err})
# don't let passwords be shown in log output
LOG.debug(strutils.mask_password(msg))
return (out, err)
def _iscsiadm_update(self, connection_properties, property_key,

View File

@ -10,4 +10,5 @@ oslo.log>=1.0.0,<1.1.0
oslo.rootwrap>=1.3.0
oslo.serialization>=1.2.0
oslo.i18n>=1.0.0
oslo.utils>=1.4.0,<1.5.0
six>=1.7.0