Skip to content

BCG WhitelistedAppKeys

📝 Overview

The whitelisted appKeys are stored in AWS secrets and can be added/updated using the manage_secrets.sh script with following changes.

Creating and Updating the whitelisted app Keys

Creating aws secret

// Make the following changes
create_secret() {  
    echo "Creating secret: $SECRET_NAME in $ENVIRONMENT environment..."    aws secretsmanager create-secret \  
        --name "$SECRET_NAME" \  
        --description "Whitelisted app keys for TLA $TLA" \  
        --secret-string "{\"$API_KEY\":\"$API_SECRET\"}" \  
        --tags "[{\"Key\":\"Platform:Environment\",\"Value\":\"$ENVIRONMENT\"}, \  
                {\"Key\":\"Platform:BusinessVertical\",\"Value\":\"$BUSINESS_VERTICAL\"}, \  
                {\"Key\":\"Platform:CostCode\",\"Value\":\"$COST_CODE\"}, \  
                {\"Key\":\"Platform:TLA\",\"Value\":\"$TLA\"}]" \  
        --profile "$PROFILE" > /dev/null  
    echo "Secret created successfully!"  
}
//command
 ./manage_secret.sh bcg/whitelistedAppKeys/pp APP_KEYS your_app_keys profile tla env

Adding to existing aws secret

// Make the following changes to the manage_secrets
update_secret() {  
    echo "Updating secret value for: $SECRET_NAME..."  
    aws secretsmanager put-secret-value \  
        --secret-id "$SECRET_NAME" \  
        --secret-string "{\"APP_KEYS\":\"$API_SECRET\"}" \  
        --profile "$PROFILE" > /dev/null  
    echo "Secret updated successfully!"  
}

//command
 ./manage_secret.sh bcg/whitelistedAppKeys/pp APP_KEYS old_keys,new_keys profile
Note: whitelistedAppKeys can many separated by commas, so if we are adding the new ones then we should add both old and new ones separated by commas.

Existing Whitelisted AppKeys

Service : Fred, Contact: Callisto ask_personalisation

s.n service name whitelistedAppKeys
1 Fred AWS-Secrets
------------------------------------------------------------------------