STEP 4: Grant access to key vaults
This step is optional
The Cloudneeti application requires special permission on desired key vaults to get policy data related to secrets. If the Key Vault access policy is not added, Cloudneeti application will not be able to collect data of security policies listed here.
Access policy can be added using either an automation account or manual steps.
4.1 Manual Steps
- Login to Azure portal.
- Go to the Key vaults (1)
- Select key vault (2)
- Select Access policies (1)
- Click on Add Access Policy (2)
- Select List in Key Permissions and Secret Permissions (1) (2)
- Select Principal as Cloudneeti Application registered in step 1 (3)
- Click Add access policy (4) Note: Perform this step on all the key vaults present in your subscription.
4.2 Automatically add Key Vault access policy for Key Vaults within Azure subscriptions
4.2.1 Register Contributor Application
Register Contributor Application
Login to Azure Portal with Global AD Administrator role.
-
Select Azure Active Directory in the primary menu
-
Select App Registrations in the secondary menu
-
Click on New Registration
-
Enter the name
-
Click Register
-
Copy to clipboard and paste the Application id to your notepad
Add Client Secret
- Click on new client secret in Certificates & secrets section
- Add Description and select expiry time
- Click on Add
-
Copy to clipboard and paste the Client Secret to your notepad. Note: You will not be able to copy this value after you move away from this screen.
Grant admin consent for API permissions
Add Read All Microsoft Graph permissions and grant admin consent
The Contributor Application should have "Azure Active Directory Graph - Application.ReadWrite.All" permission over tenant.
- Click API Permissions
-
Click Add permission and add the following information:
API Permission Name Type Microsoft.Graph Application.ReadWrite.All Refer here Application -
Click on Grant admin consent for … button in the Grant consent section.
Grant Azure Subscription Contributor role
Add contributor role for Cloudneeti application in Azure Subscription.
Login to Azure Portal with Microsoft Azure Subscription Owner role.
- Go to the subscription’s Access control (IAM) in the third level menu
- Click on the Add button and select Add role assignment
- Select Contributor role and Cloudneeti
-
Select Save to complete the role assignment
4.2.2 Provision automation account
Provision automation account to check and assign List permissions to key-vaults within given subscriptions, at scheduled time.
Login to Azure portal https://portal.azure.com as Subscription Contributor or Subscription Owner access.
Switch to Azure AD with the Azure Subscription with pre-requisite access.
-
Open CloudShell
-
Click on Cloudshell icon on the navigation bar to open Cloudshell
-
Choose PowerShell from shell drop down
-
Select storage
-
Execute below command in Cloudshell to download the Cloudneeti data collector provisioning script.
wget https://raw.githubusercontent.com/Cloudneeti/docs_cloudneeti/master/scripts/Provision-KeyVaultAccessAutomation.ps1 -O Provision-KeyVaultAccessAutomation.ps1
wget https://raw.githubusercontent.com/Cloudneeti/docs_cloudneeti/master/scripts/AutoAssign-PermissionsToKeyvault.ps1 -O AutoAssign-PermissionsToKeyvault.ps1
-
Switch to the User directory
cd $User
-
Run provisioning script with inline parameters
./Provision-KeyVaultAccessAutomation.ps1 ` -CloudneetiRegisteredApplicationObjectId <Data Collector Object Id> ` -ApplicationId <Contributor Application Id>` -SubscriptionId <Azure Subscription Id where keyvaults are present>` -AzureActiveDirectoryId <Azure Active Directory Id> ` -AutomationAccountName <Automation Account Name> ` -Location <Location>
-
The script will execute and prompt you for below details: Cloudneeti data collector Contributor Application secret
-
This will create a runbook inside automation account with a schedule to start the runbook which will assign List permissions to all key-vaults.
Security Polices with required roles, permissions
The following Security Policies will be excluded if one or multiple roles are not assigned.
Key Vault List
Special permission on key vaults is needed to collect data for security policies listed below.
Policy Title | Category |
---|---|
Ensure that the expiry date is set on all Secrets in a Key Vault | Key Management |