Configuring Key Vault Analytics solution and creating KeyVault alerts.
-
Go to the
ResourceGroup
gab2018-dev, select the KeyVault gab2018-dev-kv. -
In the menu, select Log analytics (OMS).
-
Select + Add and type Key Vault Analytics in the search box.
-
In the results select Key Vault Analytics.
- Select Create
- Select the OMS workspace named gab2018-dev-oms-all
- To deploy the solution, select Create
- The Key Vault Analytics solution should now be available in the
ResourceGroup
gab2018-dev.
-
Go to the
ResourceGroup
gab2018-dev, select the KeyVault gab2018-dev-kv. -
In the menu, select Diagnostics logs.
- Select + Add diagnostic setting.
-
In the
Name
textbox type Log Analytics. -
Select
Send to Log Analytics
. -
Select
Configure
and choose the OMS workspace named gab2018-dev-oms-all -
In
Log
, check the checkbox AuditEvent -
Select Save
-
Go to the
ResourceGroup
gab2018-dev, select the KeyVault gab2018-dev-kv. -
In the menu, select Secrets.
- Select a secret in the list, select the current version and select the Show secret value.
The goal here is to create access logs to the KeyVault, so we will be able to use it later. It should take up to 15-20 minutes to be able to use those logs.
-
Go to the
ResourceGroup
gab2018-dev, select the Key Vault Analytics resource KeyVaultAnalytics(gab2018-dev-oms-all). -
In the overview summary, select the Key Vault Analytics.
- In ALL OPERATIONS, select the
SecretGet
operation.
- Select + New Alert Rule
- In 1.Define alert condition select Alert Criteria
- In the Alert Logic, set the Threshold value to
1
and select Done
- In 2.Define alert details, enter the following values:
- Alert rule name: KeyVault Secret Accessed
- Description: Triggered when Key Vault secrets are accessed more than two times in 5 minutes.
- Severity: Informational(Sev 2)
- In 3.Define action group, select + New action group.
Enter the following values:
- Action group name: Email Alert group
- Short name: EmailGroup.
- In the actions, create an action with the following values:
- Action name: SendEmail
- Action Type: Email/SMS/Push/Voice
-
Select Edit details, enter your Email and select OK.
-
Finalize the creation of the by selecting OK
-
Wait for the action group to be created, and select Select action group.
-
Choose the created action group in the list and select Add.
-
Now select Create alert rule to finalize the creation of the alert and wait for it to be created.
-
Go to the
ResourceGroup
gab2018-dev, select the Log Analytics resource gab2018-dev-oms-all. -
Select Alerts and ensure the alert was properly created.
-
Go to the
ResourceGroup
gab2018-dev, select the KeyVault gab2018-dev-kv. -
Then in the menu, select Secrets.
-
Select the first secret in the list and select the current version.
-
Go back to the list, select the second secret and select the current version.
It should take up a few minutes to receive the KeyVault secrets accessed alert.