From 293d2192ef9a47a4243f13c0828f83c0fed09d5c Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Tue, 23 Jun 2020 16:28:09 +0300 Subject: [PATCH] Added masking for secure params --- agent2/alpine/docker-entrypoint.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/agent2/alpine/docker-entrypoint.sh b/agent2/alpine/docker-entrypoint.sh index 43b5e09f5..45aa51a94 100755 --- a/agent2/alpine/docker-entrypoint.sh +++ b/agent2/alpine/docker-entrypoint.sh @@ -44,12 +44,18 @@ update_config_var() { local var_value=$3 local is_multiple=$4 + local masklist=("TLSPSKIdentity") + if [ ! -f "$config_path" ]; then echo "**** Configuration file '$config_path' does not exist" return fi - echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'... " + if [[ " ${masklist[@]} " =~ " $var_name " ]] && [ ! -z "$var_value" ]; then + echo -n "** Updating '$config_path' parameter \"$var_name\": '****'. Enable DEBUG_MODE to view value ..." + else + echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..." + fi # Remove configuration parameter definition in case of unset parameter value if [ -z "$var_value" ]; then