Set Up Azure Application

This section provides information about registering your azure application in the active directory, assigning vault API permission to authorize the application to use vault APIs, creating and uploading a self-signed certificate and specifying a vault access policy for the application.

When you create an Azure key Vault authentication record, you will provide the ID of your azure application and to authenticate to this application provide the same certificate that you have uploaded in the application with the private key of the certificate. This enables the scanner to access the vault on behalf of the application.

1) Create an Azure Application

- Sign in to the Azure Portal using your account credentials.  

- Select Active Directory > App registrations > New registration.

New registration link under App Registrations.

- Provide application name and other required information and click Register to create the application.

Configuration fields for registering an application.

 2) Assign Vault API permissions to the Application

Authorize the application to use vault APIs to communicate with vaults.

- On the Azure portal, select Active Directory > App registrations and select the application that you have created.

- Go to Settings > API permissions > Add a permission and click Azure Key Vault.

Azure Key Vault option in API permissions.

- Select Delegated Permissions > Have full access to the Azure Key Vault service in Request API permission.  

Note that Full access means that the application is authorized to access the vault API. It does not mean that the application is granted full access to any vault or secrets. Actual vault access permissions are configured later.

Delegated Permissions option in Request API Permission.

- Click Done and Choose Yes for Grant Permissions.

3) Create a Self-Sign Certificate

- Create a self-signed certificate. Create the certificate in OpenSSL using the following command:

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3650 -nodes

- Next, you will be prompted to enter other information at the command prompt. Provide all the information to create the certificate.

- Specify the certificate along with the private key when you create an Azure key vault record in VM for the scanner to use the certificate to obtain a login token for accessing the vault.  

4) Add the Certificate to the application

This allows clients or scanner appliances which are in possession of the certificate and private key to authenticate on behalf of the application.

- On the Azure portal, select Active Directory > App registrations and select the application that you have created.  

- Go to Settings > Certificates & secrets > Upload certificate.

- Select the "cert.pem" file created in the previous step and then click Save. The certificate will show up under "Public Keys".

Upload certificate button under Certificates and secrets.

 5) Create a vault access policy for the application

Configure what the application (and, on its behalf, scanner appliances) can do in a vault.

- On the Azure portal, go to Dashboard. Select your vault.  

- Go to settings and select Access policies > Add new to create a new policy for the vault application.

Add new link under Access policies.

- Specify the application name in the “Select principal” field and from the Secret permissions drop-down, select “Get” in Secret Management Operations. This gives the application permission to fetch the secret from the vault.

Get permission enabled for the application under Secret permissions in Add access policy.

To prepare for future hardware security modules (HSM) the following permissions should also be enabled:

- Go to Key permissions > Key Management Operations and select Get.

- Go to Key permissions > Cryptographic Operations > Decrypt.

- Go to Key permissions > Cryptographic Operations > Sign.

- Click OK and Save.

Get, Decrypt and Sign permissions enabled for the application under Secret permissions in Add access policy.