From 6aaac81ca219fa8188c0c9025a132eb60f195a56 Mon Sep 17 00:00:00 2001 From: kishan Date: Tue, 17 Jan 2012 15:08:34 +0530 Subject: [PATCH] Bug 12639: while logging events, hide value for configs containing password string in config name Status 12639: resolved fixed Reviewed-By: Nitin --- .../src/com/cloud/configuration/ConfigurationManagerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index bb430fe27b3..0f8ec158120 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -397,7 +397,8 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura Long userId = UserContext.current().getCallerUserId(); String name = cmd.getCfgName(); String value = cmd.getValue(); - UserContext.current().setEventDetails(" Name: "+name +" New Value: "+((value == null) ? "" : value)); + UserContext.current().setEventDetails(" Name: "+name +" New Value: "+ (((name.toLowerCase()).contains("password")) ? "*****" : + (((value == null) ? "" : value)))); // check if config value exists if (_configDao.findByName(name) == null) { throw new InvalidParameterValueException("Config parameter with name " + name + " doesn't exist");