4.3 Ensure that Data Factory is using Azure Key Vault to store Credentials and Secrets (Manual)
Profile Applicability
- Level 2
Description
Azure Key Vault is a way to securely store secrets and keys, and create role based access control permissions to services and users to access them.
Rationale
Use of Azure Key Vault is greatly recommended over less secure options like hard coding credentials into code.
Impact
This will create technical overhead as your organization will need to manage the lifecycle, expiration, and rotation of secrets and keys to fit your security baseline.
Audit
Audit from Azure Portal
- From
Data Factoriesselect a factory to audit. - Under the
Overviewselection scroll down in the right pane and selectLaunch studiounderAzure Data Factory Studio. - In the left column select the briefcase and wrench for
Manage. - In the left column select
Linked ServicesunderConnections. - Browse the linked services to determine if there is a connection to an Azure key vault. It has a circle icon with a key in it.
Audit From Azure Policy
If referencing a digital copy of this Benchmark, clicking a Policy ID will open a link to the associated Policy definition in Azure.
If referencing a printed copy, you can search Policy IDs from this URL: https://portal.azure.com/#view/Microsoft_Azure_Policy/PolicyMenuBlade/~/Definitions
- Policy ID:
127ef6d7-242f-43b3-9eef-947faf1725d0- Name: 'Azure Data Factory linked services should use Key Vault for storing secrets'
Expected Result
A linked service connection to an Azure Key Vault should be present under Manage > Linked Services > Connections in Azure Data Factory Studio.
Remediation
Remediate from Azure Portal
Retrieve Managed Identity Object ID
- From
Azure Data Factoriesselect a factory to link to an Azure Key Vault. - In the left column, expand
> Settingsand selectProperties. - Select
Managed Identity Object IDand save this code for later.
Set Permissions for Key Vault
Note this presumes the use of RBAC Access control, not Access policies.
- From
Key vaultsselect a key vault to grant access to. - Select
+ Add, and selectAdd role assignmentfrom the dropdown. - For the
Role, search forkey vault. Listed are various permissions to be assigned. Determine your organization's permission need, butKey Vault Readeris satisfactory for basic key and secrets access. - Select
Next. - In the new screen, next to
Assign access to, select Managed identity. - Next to Members select
+ Select members. - Choose your subscription, and either under
Managed identityscroll toData Factoryand select it, or search by your Data Factory's name. - Select your Data Factory.
- Choose
Select. - Select
Review + assign.
Create Connection Between Key Vault and Data Factory
- From
Data Factoriesselect your data factory. - Under the
Overviewselection scroll down in the right pane and selectLaunch studiounderAzure Data Factory Studio. - In the left column select the briefcase and wrench for
Manage. - In the left column select
Linked ServicesunderConnections. - Select
+ New. - Search for
Azure Key Vaultand select it. - In the new window, name your connection and enter a desired description.
- Under
Azure key vault selection method, chooseFrom Azure Subscription. - Select your Azure Subscription.
- Select your key vault by name.
- Under
Authentication MethodselectSystem-assigned managed identityorUser-assigned managed identitydepending on what managed identity is in use on your data factory. - Select
Create.
Default Value
By default Azure Data Factories do not use Azure Key Vault to store credentials or secrets.