From 102c0fab4beb6c660d40d037cc2f9827323e15e3 Mon Sep 17 00:00:00 2001 From: Kirby Chin <37311900+kabicin@users.noreply.github.com> Date: Wed, 4 Sep 2024 12:35:01 -0400 Subject: [PATCH] Revert password length to 15 characters (#621) --- internal/controller/assets/create_ltpa_keys.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/controller/assets/create_ltpa_keys.sh b/internal/controller/assets/create_ltpa_keys.sh index 5a906ee1e..c60d9fae7 100644 --- a/internal/controller/assets/create_ltpa_keys.sh +++ b/internal/controller/assets/create_ltpa_keys.sh @@ -57,7 +57,7 @@ rm -f $NOT_FOUND_LOG_FILE; curl --cacert ${CACERT} --header "Content-Type: application/json" --header "Authorization: Bearer ${TOKEN}" -X GET ${APISERVER}/api/v1/namespaces/${NAMESPACE}/secrets/${PASSWORD_KEY_SECRET_NAME} &> $NOT_FOUND_LOG_FILE; NOT_FOUND_COUNT=$(cat $NOT_FOUND_LOG_FILE | grep -c "NotFound"); TIME_SINCE_EPOCH_SECONDS=$(date '+%s'); -PASSWORD=$(openssl rand -base64 32); +PASSWORD=$(openssl rand -base64 15); if [ "$ENCRYPTION_KEY_SHARING_ENABLED" == "true" ] && [ $NOT_FOUND_COUNT -eq 0 ]; then LAST_ROTATION=$(curl --cacert ${CACERT} --header "Content-Type: application/json" --header "Authorization: Bearer ${TOKEN}" -X GET ${APISERVER}/api/v1/namespaces/${NAMESPACE}/secrets/${PASSWORD_KEY_SECRET_NAME} | grep -o '"lastRotation": "[^"]*' | grep -o '[^"]*$' | base64 -d); PASSWORD_KEY=$(curl --cacert ${CACERT} --header "Content-Type: application/json" --header "Authorization: Bearer ${TOKEN}" -X GET ${APISERVER}/api/v1/namespaces/${NAMESPACE}/secrets/${PASSWORD_KEY_SECRET_NAME} | grep -o '"passwordEncryptionKey": "[^"]*' | grep -o '[^"]*$' | base64 -d);