Replace dummy secret generation with random secret for improved security
This commit is contained in:
@@ -193,10 +193,9 @@ if yq eval '.requiredSecrets' "${DEST_APP_DIR}/manifest.yaml" | grep -q -v '^nul
|
||||
current_value=$(yq eval ".${secret_path} // \"null\"" "${SECRETS_FILE}")
|
||||
|
||||
if [ "${current_value}" = "null" ]; then
|
||||
echo "Adding dummy secret: ${secret_path}"
|
||||
# Extract just the key name for the dummy value
|
||||
secret_key=$(basename "${secret_path}")
|
||||
yq eval ".${secret_path} = \"CHANGE_ME_${secret_key^^}\"" -i "${SECRETS_FILE}"
|
||||
echo "Adding random secret: ${secret_path}"
|
||||
random_secret=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 6)
|
||||
yq eval ".${secret_path} = \"${random_secret}\"" -i "${SECRETS_FILE}"
|
||||
fi
|
||||
done
|
||||
|
||||
|
Reference in New Issue
Block a user