From 090df1435f1e9a1674be7f802cf28cf3fe5a2914 Mon Sep 17 00:00:00 2001 From: Benjamin Diaz Date: Wed, 30 Jan 2019 13:01:54 -0300 Subject: [PATCH] Adds decryption of passwords in vim config block Change-Id: Iba064f9fb0dd38511b90410c5073fc13ce8cbeac Signed-off-by: Benjamin Diaz --- osm_mon/server/server.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osm_mon/server/server.py b/osm_mon/server/server.py index a1e848b..0f17d99 100755 --- a/osm_mon/server/server.py +++ b/osm_mon/server/server.py @@ -84,7 +84,16 @@ class Server: values['vim_password'] = self.common_db.decrypt_vim_password(values['vim_password'], values['schema_version'], values['_id']) + + vim_config_encrypted = ("admin_password", "nsx_password", "vcenter_password") + if 'config' in values: + for key in values['config']: + if key in vim_config_encrypted: + values['config'][key] = self.common_db.decrypt_vim_password(values['config'][key], + values['schema_version'], + values['_id']) self.auth_manager.store_auth_credentials(values) + if message.key == "delete": self.auth_manager.delete_auth_credentials(values) -- 2.25.1