From: Kefu Chai Date: Wed, 18 Sep 2019 03:04:24 +0000 (+0800) Subject: mgr/dashboard: do not log tokens X-Git-Tag: v15.1.0~1480^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F30445%2Fhead;p=ceph.git mgr/dashboard: do not log tokens sensitive information should not go to logging messages. see https://tracker.ceph.com/issues/41320 Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/dashboard/controllers/auth.py b/src/pybind/mgr/dashboard/controllers/auth.py index 90752a03f4d4..d98c1387c062 100644 --- a/src/pybind/mgr/dashboard/controllers/auth.py +++ b/src/pybind/mgr/dashboard/controllers/auth.py @@ -21,7 +21,6 @@ class Auth(RESTController): logger.debug('Login successful') token = JwtManager.gen_token(username) token = token.decode('utf-8') - logger.debug("JWT Token: %s", token) cherrypy.response.headers['Authorization'] = "Bearer: {}".format(token) return { 'token': token, diff --git a/src/pybind/mgr/dashboard/controllers/saml2.py b/src/pybind/mgr/dashboard/controllers/saml2.py index a0ad345b1c99..4bafc6933ac9 100644 --- a/src/pybind/mgr/dashboard/controllers/saml2.py +++ b/src/pybind/mgr/dashboard/controllers/saml2.py @@ -12,7 +12,7 @@ try: except ImportError: python_saml_imported = False -from .. import mgr, logger +from .. import mgr from ..exceptions import UserDoesNotExist from ..services.auth import JwtManager from ..tools import prepare_url_prefix @@ -70,7 +70,6 @@ class Saml2(BaseController): token = JwtManager.gen_token(username) JwtManager.set_user(JwtManager.decode_token(token)) token = token.decode('utf-8') - logger.debug("JWT Token: %s", token) raise cherrypy.HTTPRedirect("{}/#/login?access_token={}".format(url_prefix, token)) return {