From ed7941c34605e4469dcf2140e6c4e9725fb0a60b Mon Sep 17 00:00:00 2001 From: zhurong Date: Fri, 27 Jul 2018 11:07:32 +0800 Subject: [PATCH] Sanitizer some sensitive logs information Murano engine maybe outputs some sensitive logs information, This patch sanitizer the sensitive info. Change-Id: Icd24a0388274454af335ce217614606b9bad0344 Closes-Bug: #1655265 --- murano/common/engine.py | 3 ++- murano/engine/system/heat_stack.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/murano/common/engine.py b/murano/common/engine.py index be89fe347..77c169fcc 100644 --- a/murano/common/engine.py +++ b/murano/common/engine.py @@ -141,8 +141,9 @@ class TaskProcessingEndpoint(object): result = task_executor.execute() return result finally: + s_result = token_sanitizer.TokenSanitizer().sanitize(result) LOG.info('Finished processing task: {task_desc}'.format( - task_desc=jsonutils.dumps(result))) + task_desc=jsonutils.dumps(s_result))) class StaticActionEndpoint(object): diff --git a/murano/engine/system/heat_stack.py b/murano/engine/system/heat_stack.py index 090bbd1af..459462c6e 100644 --- a/murano/engine/system/heat_stack.py +++ b/murano/engine/system/heat_stack.py @@ -23,6 +23,7 @@ from oslo_config import cfg from oslo_log import log as logging from murano.common import auth_utils +from murano.common.helpers import token_sanitizer from murano.dsl import dsl from murano.dsl import helpers from murano.dsl import session_local_storage @@ -212,7 +213,9 @@ class HeatStack(object): def _push(self, object_store=None): template = copy.deepcopy(self._template) - LOG.debug('Pushing: {template}'.format(template=json.dumps(template))) + s_template = token_sanitizer.TokenSanitizer().sanitize(template) + LOG.debug('Pushing: {template}'.format( + template=json.dumps(s_template))) object_store = object_store or helpers.get_object_store() while True: try: