From 12766b9dc2c6faf7a66131d28a22b66d4eedaaf5 Mon Sep 17 00:00:00 2001 From: ajasnosz Date: Mon, 24 Jun 2024 13:21:01 +0200 Subject: [PATCH] chore: add encoding --- .github/pre-req.sh | 4 ++-- .github/update_manifest.sh | 2 +- .github/workflows/main.yml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/pre-req.sh b/.github/pre-req.sh index a687f103..d7d7d69c 100755 --- a/.github/pre-req.sh +++ b/.github/pre-req.sh @@ -10,7 +10,7 @@ sudo apt-get update sudo apt-get install apt-transport-https ca-certificates sudo apt-get install cf-cli #CF Login -API_PASSWORD_DEC=$(echo $API_PASSWORD | openssl aes-256-cbc -d -a -pass pass:$ENCRYPT_KEY) +API_PASSWORD_DEC=$(echo $API_PASSWORD | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:$ENCRYPT_KEY) cf login --skip-ssl-validation -a $API_ENDPOINT -u $API_USER -p $API_PASSWORD_DEC #Create splunk-ci org and space @@ -27,7 +27,7 @@ fi gem install cf-uaac uaac target $API_UAA_ENDPOINT --skip-ssl-validation -API_CLIENT_PASSWORD_DEC=$(echo $API_CLIENT_PASSWORD | openssl aes-256-cbc -d -a -pass pass:$ENCRYPT_KEY) +API_CLIENT_PASSWORD_DEC=$(echo $API_CLIENT_PASSWORD | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:$ENCRYPT_KEY) uaac token client get $API_USER -s $API_CLIENT_PASSWORD_DEC if [ $(uaac client get $CLIENT_ID | grep -woc $CLIENT_ID) -eq 0 ]; then diff --git a/.github/update_manifest.sh b/.github/update_manifest.sh index e97f3aaf..9ad0be21 100755 --- a/.github/update_manifest.sh +++ b/.github/update_manifest.sh @@ -2,7 +2,7 @@ set -e #Set below params in github env variable settings # API_ENDPOINT, API_USER, API_PASSWORD, SPLUNK_TOKEN, SPLUNK_HOST, SPLUNK_INDEX, SPLUNK_METRIC_INDEX -API_PASSWORD_DEC=$(echo $API_PASSWORD | openssl aes-256-cbc -d -a -pass pass:$ENCRYPT_KEY) +API_PASSWORD_DEC=$(echo $API_PASSWORD | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:$ENCRYPT_KEY) #Update manifest for deployment sed -i 's@API_ENDPOINT:.*@'"API_ENDPOINT: $API_ENDPOINT"'@' scripts/ci_nozzle_manifest.yml sed -i 's@API_USER:.*@'"API_USER: $API_USER"'@' scripts/ci_nozzle_manifest.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35794de0..67721242 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -112,12 +112,12 @@ jobs: echo API_ENDPOINT="https://api.$(jq -r '.sys_domain' ./env.json)" >> "$GITHUB_OUTPUT" echo API_UAA_ENDPOINT="https://uaa.$(jq -r '.sys_domain' ./env.json)" >> "$GITHUB_OUTPUT" - echo API_PASSWORD="$(hammer -t ./env.json om credentials -- -p cf -t json -c .uaa.admin_credentials | jq -r '.password')" >> "$GITHUB_OUTPUT" - echo $API_PASSWORD | openssl aes-256-cbc -a -salt -pass pass:$ENCRYPT_KEY + API_PASSWORD="$(hammer -t ./env.json om credentials -- -p cf -t json -c .uaa.admin_credentials | jq -r '.password')" + echo $API_PASSWORD | openssl aes-256-cbc -a -pbkdf2 -salt -pass pass:$ENCRYPT_KEY echo API_PASSWORD=$API_PASSWORD >> "$GITHUB_OUTPUT" API_CLIENT_PASSWORD="$(hammer -t ./env.json om credentials -- -p cf -t json -c .uaa.admin_client_credentials | jq -r '.password')" - echo $API_CLIENT_PASSWORD | openssl aes-256-cbc -a -salt -pass pass:$ENCRYPT_KEY + echo $API_CLIENT_PASSWORD | openssl aes-256-cbc -a -pbkdf2 -salt -pass pass:$ENCRYPT_KEY echo API_CLIENT_PASSWORD=$API_CLIENT_PASSWORD >> "$GITHUB_OUTPUT" echo ENV_ID=$ENV_ID >> "$GITHUB_OUTPUT"