Fix to encrypt password print in debug logs

In the case of OpenStack VIM registration, tacker/event_alarm.py
prints request details along with the password of the user in
tacker debug logs.
This patch encrypts sensitive information such as passwords in
log messages.

Change-Id: Iebcd726b081ebfa33332dbfae132638600b5cc87
Closes-Bug: #1903955
This commit is contained in:
Manpreet Kaur 2020-11-17 02:04:16 +00:00
parent b1a02ec7d3
commit 9d570f9feb
1 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@ from urllib import parse
from oslo_config import cfg
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import strutils
from tacker._i18n import _
from tacker.vnfm.monitor_drivers.token import Token
@ -48,7 +49,7 @@ def config_opts():
class AlarmReceiver(wsgi.Middleware):
def process_request(self, req):
LOG.debug('Process request: %s', req)
LOG.debug('Process request: %s', strutils.mask_password(req))
if req.method != 'POST':
return
url = req.url