Selaa lähdekoodia

fix(postdetails): mask beta passwords, tokens and API keys (#5182)

Mask beta branch passwords and additional game credentials in postdetails and alert output. Preserve real credentials in the calling shell for subsequent starts and updates.

Fixes #5181
BorzakA 1 päivä sitten
vanhempi
sitoutus
000cf45750
3 muutettua tiedostoa jossa 30 lisäystä ja 6 poistoa
  1. 2 2
      lgsm/modules/core_dl.sh
  2. 4 4
      lgsm/modules/core_steamcmd.sh
  3. 24 0
      lgsm/modules/info_messages.sh

+ 2 - 2
lgsm/modules/core_dl.sh

@@ -42,8 +42,8 @@ fn_dl_steamcmd() {
 		fn_script_log_info "Branch: ${branch}"
 	fi
 	if [ -n "${betapassword}" ]; then
-		echo -e "Branch password: ${betapassword}"
-		fn_script_log_info "Branch password: ${betapassword}"
+		echo -e "Branch password: ********"
+		fn_script_log_info "Branch password: ********"
 	fi
 	if [ -d "${steamcmddir}" ]; then
 		cd "${steamcmddir}" || exit

+ 4 - 4
lgsm/modules/core_steamcmd.sh

@@ -223,7 +223,7 @@ fn_update_steamcmd_compare() {
 			fn_print_nl "* Branch: ${branch}"
 		fi
 		if [ -n "${betapassword}" ]; then
-			fn_print_nl "* Branch password: ${betapassword}"
+			fn_print_nl "* Branch password: ********"
 		fi
 		fn_print_nl "${italic}https://steamdb.info/app/${appid}/history"
 		fn_print "\n"
@@ -234,7 +234,7 @@ fn_update_steamcmd_compare() {
 			fn_script_log_info "Branch: ${branch}"
 		fi
 		if [ -n "${betapassword}" ]; then
-			fn_script_log_info "Branch password: ${betapassword}"
+			fn_script_log_info "Branch password: ********"
 		fi
 		fn_script_log_info "${localbuild} > ${remotebuild}"
 
@@ -256,7 +256,7 @@ fn_update_steamcmd_compare() {
 			fn_print_nl "* Branch: ${branch}"
 		fi
 		if [ -n "${betapassword}" ]; then
-			fn_print_nl "* Branch password: ${betapassword}"
+			fn_print_nl "* Branch password: ********"
 		fi
 		fn_print_nl "https://steamdb.info/app/${appid}/history"
 		fn_print "\n"
@@ -267,7 +267,7 @@ fn_update_steamcmd_compare() {
 			fn_script_log_info "Branch: ${branch}"
 		fi
 		if [ -n "${betapassword}" ]; then
-			fn_script_log_info "Branch password: ${betapassword}"
+			fn_script_log_info "Branch password: ********"
 		fi
 	fi
 }

+ 24 - 0
lgsm/modules/info_messages.sh

@@ -64,6 +64,30 @@ fn_info_messages_password_strip() {
 		if [ "${gslt}" ]; then
 			gslt="********"
 		fi
+
+		if [ "${betapassword}" ]; then
+			betapassword="********"
+		fi
+
+		if [ "${authtoken}" ]; then
+			authtoken="********"
+		fi
+
+		if [ "${usertoken}" ]; then
+			usertoken="********"
+		fi
+
+		if [ "${apikey}" ]; then
+			apikey="********"
+		fi
+
+		if [ "${gspassword}" ]; then
+			gspassword="********"
+		fi
+
+		if [ "${eosclientsecret}" ]; then
+			eosclientsecret="********"
+		fi
 	fi
 }