Fix leaking password in murano-api logs.
Change-Id: I40df94d13ed4d1af0867c119a3954387a74162f0 Fixes: bug MRN-861.
This commit is contained in:
parent
daf9aef13e
commit
7b1656ecad
|
@ -19,6 +19,7 @@ from muranoapi import utils
|
|||
from muranoapi.db.services.core_services import CoreServices
|
||||
from muranoapi.openstack.common import wsgi
|
||||
from muranoapi.openstack.common import log as logging
|
||||
from muranocommon.helpers.token_sanitizer import TokenSanitizer
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -55,8 +56,9 @@ class Controller(object):
|
|||
@utils.verify_session
|
||||
@normalize_path
|
||||
def post(self, request, environment_id, path, body):
|
||||
secure_data = TokenSanitizer().sanitize(body)
|
||||
log.debug(_('Services:Post <EnvId: {0}, Path: {2}, '
|
||||
'Body: {1}>'.format(environment_id, body, path)))
|
||||
'Body: {1}>'.format(environment_id, secure_data, path)))
|
||||
|
||||
post_data = CoreServices.post_data
|
||||
session_id = request.context.session
|
||||
|
|
|
@ -17,6 +17,7 @@ from muranoapi.db.models import Status, Session, Environment, Deployment
|
|||
from muranoapi.db.session import get_session
|
||||
from muranoapi.openstack.common import log as logging, timeutils, service
|
||||
from muranoapi.common import config
|
||||
from muranocommon.helpers.token_sanitizer import TokenSanitizer
|
||||
from muranocommon.messaging import MqClient
|
||||
from sqlalchemy import desc
|
||||
import eventlet
|
||||
|
@ -83,8 +84,9 @@ class TaskResultHandlerService(service.Service):
|
|||
def handle_result(message):
|
||||
try:
|
||||
environment_result = message.body
|
||||
secure_result = TokenSanitizer().sanitize(environment_result)
|
||||
log.debug(_('Got result message from '
|
||||
'orchestration engine:\n{0}'.format(environment_result)))
|
||||
'orchestration engine:\n{0}'.format(secure_result)))
|
||||
|
||||
if 'deleted' in environment_result:
|
||||
log.debug(_('Result for environment {0} is dropped. Environment '
|
||||
|
|
|
@ -16,9 +16,8 @@ from collections import namedtuple
|
|||
from muranoapi.common import config
|
||||
from muranoapi.db.models import Session, Environment, Deployment, Status
|
||||
from muranoapi.db.session import get_session
|
||||
from muranocommon.helpers.token_sanitizer import TokenSanitizer
|
||||
from muranocommon.messaging import MqClient, Message
|
||||
|
||||
from muranocommon.helpers.token_sanitizer import TokenSanitizer
|
||||
|
||||
rabbitmq = config.CONF.rabbitmq
|
||||
|
||||
|
@ -27,11 +26,6 @@ SessionState = namedtuple('SessionState', ['open', 'deploying', 'deployed'])(
|
|||
)
|
||||
|
||||
|
||||
def secure_description(description):
|
||||
sanitizer = TokenSanitizer()
|
||||
return sanitizer.sanitize(description)
|
||||
|
||||
|
||||
class SessionServices(object):
|
||||
@staticmethod
|
||||
def get_sessions(environment_id, state=None):
|
||||
|
@ -131,7 +125,8 @@ class SessionServices(object):
|
|||
session.state = SessionState.deploying
|
||||
deployment = Deployment()
|
||||
deployment.environment_id = environment['id']
|
||||
deployment.description = secure_description(dict(session.description))
|
||||
deployment.description = TokenSanitizer().sanitize(
|
||||
dict(session.description))
|
||||
status = Status()
|
||||
status.text = "Deployment scheduled"
|
||||
status.level = "info"
|
||||
|
|
Loading…
Reference in New Issue