From 9d570f9feb806ee96a478a55f641cfd5a19c7863 Mon Sep 17 00:00:00 2001 From: Manpreet Kaur Date: Tue, 17 Nov 2020 02:04:16 +0000 Subject: [PATCH] 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 --- tacker/alarm_receiver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tacker/alarm_receiver.py b/tacker/alarm_receiver.py index 75aabcb91..028f9573f 100644 --- a/tacker/alarm_receiver.py +++ b/tacker/alarm_receiver.py @@ -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