From d284301b6a7a1579f7398ea2b348e8ca8a87b96e Mon Sep 17 00:00:00 2001 From: kkuzmin Date: Thu, 5 Oct 2017 19:25:22 +0100 Subject: [PATCH 1/2] Amend creation of AL key section. (#23) * Amend creation of AL key section. * Fix wording. * Address comments * Address comments. * Change example username * Address comments * Fix quotes --- README.md | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 16bb6b0..252fcdf 100644 --- a/README.md +++ b/README.md @@ -48,37 +48,36 @@ blade itself. ## Create an Alert Logic Access Key -Login and get an authentication token from the Alert Logic Cloud Insight product [AIMS API](https://console.product.dev.alertlogic.com/api/aims/). From the command line use [curl](https://en.wikipedia.org/wiki/CURL) as follows (where `` is your CloudInsight user and `` is your CloudInsight password): - -``` -curl -X POST -v -u ':' https://api.global-services.global.alertlogic.com/aims/v1/authenticate -``` - -Make a note of the following fields returned in the response: - - * USER ID - * ACCOUNT ID - * TOKEN - -Use the authentication token returned in the response to create access keys for the Azure application deployed in the next section. Issue the following curl command (where `` is the auth token, `` is the account ID, and `` is the user ID returned above): - +From the Bash command line in [Azure Cloud Shell](https://docs.microsoft.com/en-us/azure/cloud-shell/quickstart) run the following commands, where `` is your Alert Logic user and `` is your Alert Logic password: ``` -curl -X POST -H "x-aims-auth-token: " https://api.global-services.global.alertlogic.com/aims/v1//users//access_keys +export AL_USERNAME='' +export AL_PASSWORD='' +auth=$(curl -X POST -s -u $AL_USERNAME:$AL_PASSWORD https://api.global-services.global.alertlogic.com/aims/v1/authenticate); export AL_ACCOUNT_ID=$(echo $auth | jq -r '.authentication.account.id'); export AL_USER_ID=$(echo $auth | jq -r '.authentication.user.id'); export AL_TOKEN=$(echo $auth | jq -r '.authentication.token'); [ -z $AL_TOKEN ] && echo "Authentication failure"; unset AL_USERNAME; unset AL_PASSWORD; curl -s -X POST -H "x-aims-auth-token: $AL_TOKEN" https://api.global-services.global.alertlogic.com/aims/v1/$AL_ACCOUNT_ID/users/$AL_USER_ID/access_keys | jq ``` - An example of a successful response is: ``` -{"access_key_id":"8bb72b92eb43f0bb","secret_key":"15b74g7fe32b9a0083172b724fa8b84aebfa9325bba2b3bc8933216013e220c1"} +{ + "access_key_id": "712c0b413eef41f6", + "secret_key": "1234567890b3eea8880d292fb31aa96902242a076d3d0e320cc036eb51bf25ad" +} ``` +**Note:** if the output is blank please double-check the Alert Logic user permission, you should have administrator access. More details about AIMS APIs can be found [here](https://console.product.dev.alertlogic.com/api/aims/). + Make a note of the `access_key_id` and `secret_key` values for use in the deployment steps below. **Note:** Only five access keys can be created per user. If you get a "limit exceeded" response you will need to -delete some keys in order to create new ones. Use the following command to delete access keys: +delete some keys in order to create new ones. Use the following command to list access keys: + +``` +curl -s -X GET -H "x-aims-auth-token: $AL_TOKEN" https://api.global-services.global.alertlogic.com/aims/v1/$AL_ACCOUNT_ID/users/$AL_USER_ID/access_keys | jq +``` +Then use the selected access_key_id in the following curl command to delete it: ``` -curl -X DELETE -H "x-aims-auth-token: " https://api.global-services.global.alertlogic.com/aims/v1//users//access_keys/ + +curl -X DELETE -H "x-aims-auth-token: $AL_TOKEN" https://api.global-services.global.alertlogic.com/aims/v1/$AL_ACCOUNT_ID/users/$AL_USER_ID/access_keys/ ``` ## Function deployment From 7426063278d0dc11c1fe84b8809d3b4a486f78df Mon Sep 17 00:00:00 2001 From: tomdos Date: Wed, 11 Oct 2017 14:03:37 +0100 Subject: [PATCH 2/2] remove the default deployment name bla bla minor change --- README.md | 9 ++++----- template.json | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 252fcdf..8025b25 100644 --- a/README.md +++ b/README.md @@ -114,17 +114,16 @@ _Managed application in local directory_ -> _Properties_ -> _Object ID_ You can use either [Azure Cloud Shell](https://docs.microsoft.com/en-gb/azure/cloud-shell/quickstart#start-cloud-shell) or local installation of [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest). -1. Create a resource group with name "AlertLogicCollect" in location "Central US" by executing following command +1. Create a new resource group in, for example, the "Central US" location by executing following command: ``` - az group create --name AlertLogicCollect --location "Central US" + az group create --name --location "Central US" ``` 1. Once created go to `Resource groups` blade and select the resource group. 1. Select `Access Control (IAM)` and add `Website Contributor` role to AD application identity created above. -1. Deploy a template by using following command, during its execution enter required parameters when asked +1. Deploy a template by using following command, during its execution enter required parameters when asked. ``` az group deployment create \ - --name AlertLogicCollector \ - --resource-group AlertLogicCollect \ + --resource-group \ --template-uri "https://raw.githubusercontent.com/alertlogic/azure-collector/master/template.json" ``` diff --git a/template.json b/template.json index 0563607..5d62c03 100644 --- a/template.json +++ b/template.json @@ -3,8 +3,7 @@ "contentVersion": "1.0.0.0", "parameters": { "Name": { - "type": "String", - "defaultValue": "AlertLogicCollector" + "type": "String" }, "Storage Name": { "type": "String"