Add CHAPPASSWORD to list of sanitize keys

The Huawei cinder driver needs to mask out any instances of the
CHAPPASSWORD in the logs [1]. This patch adds to the sanitize
keys list so that cinder may make use of the common mask_password
function.

[1] https://review.openstack.org/#/c/271595

Change-Id: I679e576121e2a74ac6684ecc634690708cf39315
Partial-Bug: #1535706
This commit is contained in:
Eric Brown 2016-02-20 16:00:02 -08:00
parent 04e34e7265
commit 811fb7f279
1 changed files with 5 additions and 1 deletions

View File

@ -53,7 +53,8 @@ SLUGIFY_HYPHENATE_RE = re.compile(r"[-\s]+")
# NOTE(flaper87): The following globals are used by `mask_password`
_SANITIZE_KEYS = ['adminPass', 'admin_pass', 'password', 'admin_password',
'auth_token', 'new_pass', 'auth_password', 'secret_uuid',
'secret', 'sys_pswd', 'token', 'configdrive']
'secret', 'sys_pswd', 'token', 'configdrive',
'CHAPPASSWORD']
# NOTE(ldbragst): Let's build a list of regex objects using the list of
# _SANITIZE_KEYS we already have. This way, we only have to add the new key
@ -265,6 +266,9 @@ def mask_password(message, secret="***"): # nosec
.. versionchanged:: 3.4
Replace also ``'configdrive'`` key.
.. versionchanged:: 3.8
Replace also ``'CHAPPASSWORD'`` key.
"""
try: