From 750306f877aa71d2e6842093ded33c1b1f62ec23 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 30 May 2024 12:01:43 +0200 Subject: [PATCH] Masking RHSM password in logging output of snippet --- snippets/tpl.110.register-rhel.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/snippets/tpl.110.register-rhel.sh b/snippets/tpl.110.register-rhel.sh index 2a18e1b..d789871 100644 --- a/snippets/tpl.110.register-rhel.sh +++ b/snippets/tpl.110.register-rhel.sh @@ -14,14 +14,16 @@ register_rhel() { local err_msg= local fqdn=$( hostname -f ) local cmd="${rhsm} register --no-progress-messages --username '${rhsm_user}' --password '${rhsm_pwd}' " + local cmd_out="${rhsm} register --no-progress-messages --username '${rhsm_user}' --password '********' " cmd+="--auto-attach --name '${fqdn}'" + cmd_out+="--auto-attach --name '${fqdn}'" if [[ -z "${rhsm_user}" || -z "${rhsm_pwd}" ]] ; then err_msg="Either RHSM_USER or RHSM_PWD are not defined as meta variables." else if [[ -x "${rhsm}" ]] ; then echo - echo "Executing: ${cmd}" + echo "Executing: ${cmd_out}" if [[ -n "${rhsm_system_id}" ]] ; then if eval ${cmd} --consumerid "${rhsm_system_id}" ; then rhsm_registred='y' -- 2.39.5