Back to Compliances
azure

CIS Microsoft Azure Foundations Benchmark v2.1.0

cis_2.1_azure
CISv2.1
CIS framework logo
OfficialVerified

The CIS Azure Foundations Benchmark provides prescriptive guidance for configuring security options for a subset of Azure with an emphasis on foundational, testable, and architecture agnostic settings.

149requirements114checks

Run this compliance with Prowler

Run in Prowler Cloud
Run
prowler azure --compliance cis_2.1_azure

Requirements (149)

1 Identity and Access Management3416
1.1.1Ensure Security Defaults is enabled on Microsoft Entra ID1
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Sub Section

1.1 Security Defaults Security Defaults

Description

Security defaults in Microsoft Entra ID make it easier to be secure and help protect your organization. Security defaults contain preconfigured security settings for common attacks. Security defaults is available to everyone. The goal is to ensure that all organizations have a basic level of security enabled at no extra cost. You may turn on security defaults in the Azure portal.

Default Value

If your tenant was created on or after October 22, 2019, security defaults may already be enabled in your tenant.

Audit Procedure

From Azure Portal To ensure security defaults is enabled in your directory: 1. From Azure Home select the Portal Menu. 2. Browse to Microsoft Entra ID > Properties. 3. Select Manage security defaults. 4. Verify the Enable security defaults toggle is Enabled.

Impact Statement

This recommendation should be implemented initially and then may be overridden by other service/product specific CIS Benchmarks. Administrators should also be aware that certain configurations in Microsoft Entra ID may impact other Microsoft services such as Microsoft 365.

Assessment Status

Manual

Rationale Statement

Security defaults provide secure default settings that we manage on behalf of organizations to keep customers safe until they are ready to manage their own identity security settings. For example, doing the following: - Requiring all users and admins to register for MFA. - Challenging users with MFA - when necessary, based on factors such as location, device, role, and task. - Disabling authentication from legacy authentication clients, which can’t do MFA.

Remediation Procedure

From Azure Portal To enable security defaults in your directory: 1. From Azure Home select the Portal Menu. 1. Browse to Microsoft Entra ID > Properties 1. Select Manage security defaults 1. Set the Enable security defaults to Enabled 1. Select Save

Additional Information

This recommendation differs from the Microsoft 365 Benchmark. This is because the potential impact associated with disabling Security Defaults is dependent upon the security settings implemented in the environment. It is recommended that organizations disabling Security Defaults implement appropriate security settings to replace the settings configured by Security Defaults.

1.1.2Ensure that 'Multi-Factor Auth Status' is 'Enabled' for all Privileged Users1
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Sub Section

1.1 Security Defaults Security Defaults

Description

Enable multi-factor authentication for all roles, groups, and users that have write access or permissions to Azure resources. These include custom created objects or built-in roles such as; - Service Co-Administrators - Subscription Owners - Contributors

Default Value

By default, multi-factor authentication is disabled for all users.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select the Microsoft Entra ID blade 1. Select Users 1. Take note of all users with the role Service Co-Administrators, Owners or Contributors 1. Click on the Per-User MFA button in the top row menu 1. Ensure that MULTI-FACTOR AUTH STATUS is Enabled for all noted users From REST API For Every Subscription, For Every Tenant Step 1: Identify Users with Administrative Access 1. List All Users Using Microsoft Graph API: GET https://graph.microsoft.com/v1.0/users Capture id and corresponding userPrincipalName ('$uid', '$userPrincipalName') 2. List all Role Definitions Using Azure management API: https://management.azure.com/subscriptions/:subscriptionId/providers/Microsoft.Authorization/roleDefinitions?api-version=2017-05-01 Capture Role Definition IDs/Name ('$name') and role names ('$properties/roleName') where properties/roleName contains (Owner or *contributor or admin ) 3. List All Role Assignments (Mappings $A.uid to $B.name) Using Azure Management API: GET https://management.azure.com/subscriptions/:subscriptionId/providers/Microsoft.Authorization/roleassignments?api-version=2017-10-01-preview Find all administrative roles ($B.name) in Properties/roleDefinitionId mapped with user ids ($A.id) in Properties/principalId where Properties/principalType == User 4. Now Match ($CProperties/principalId) with $A.uid and get $A.userPrincipalName save this as D.userPrincipalName Step 2: Run MSOL PowerShell command: Get-MsolUser -All | where {$_.StrongAuthenticationMethods.Count -eq 0} | Select-Object -Property UserPrincipalName If the output contains any of the $D.userPrincipalName, then this recommendation is non-compliant. 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: e3e008c3-56b9-4133-8fd7-d3347377402a - Name: 'Accounts with owner permissions on Azure resources should be MFA enabled' - Policy ID: 931e118d-50a1-4457-a5e4-78550e086c52 - Name: 'Accounts with write permissions on Azure resources should be MFA enabled'

Impact Statement

Users would require two forms of authentication before any access is granted. Additional administrative time will be required for managing dual forms of authentication when enabling multi-factor authentication.

Assessment Status

Manual

Rationale Statement

Multi-factor authentication requires an individual to present a minimum of two separate forms of authentication before access is granted. Multi-factor authentication provides additional assurance that the individual attempting to gain access is who they claim to be. With multi-factor authentication, an attacker would need to compromise at least two different authentication mechanisms, increasing the difficulty of compromise and thus reducing the risk.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID blade 1. Select Users 1. Take note of all users with the role Service Co-Administrators, Owners or Contributors 1. Click on the Per-User MFA button in the top row menu 1. Check the box next to each noted user 1. Click Enable under quick steps in the right-hand panel 1. Click enable multi-factor auth 1. Click close Other Options within Azure Portal Follow Microsoft Azure documentation and enable multi-factor authentication in your environment. https://docs.microsoft.com/en-us/azure/active-directory/authentication/tutorial-enable-azure-mfa Enabling and configuring MFA with conditional access policy is a multi-step process. Here are some additional resources on the process within Entra ID to enable multi-factor authentication for users within your subscriptions with conditional access policy. https://docs.microsoft.com/en-us/azure/active-directory/conditional-access/howto-conditional-access-policy-admin-mfa https://docs.microsoft.com/en-us/azure/active-directory/authentication/howto-mfa-getstarted#enable-multi-factor-authentication-with-conditional-access https://docs.microsoft.com/en-us/azure/active-directory/authentication/howto-mfa-mfasettings

Additional Information

Please note that at the time of writing, there is no API, Azure CLI or Powershell mechanism available to programmatically conduct security assessment or remediation for this recommendation. The only option is MSOL.

1.1.3Ensure that 'Multi-Factor Auth Status' is 'Enabled' for all Non-Privileged Users1
Attributes
Profile

Level 2

Section

1 Identity and Access Management

Sub Section

1.1 Security Defaults Security Defaults

Description

Enable multi-factor authentication for all non-privileged users.

Default Value

By default, multi-factor authentication is disabled for all users.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 2. Select the Microsoft Entra ID blade 3. Select Users 4. Take note of all users with the role Service Co-Administrators, Owners or Contributors 5. Click on the Per-User MFA button in the top row menu 6. Check the box next to each noted user 7. Click Enable under quick steps in the right-hand panel 8. Click enable multi-factor auth 9. Click close From REST API For Every Subscription, For Every Tenant Step 1: Identify Users with non-administrative Access 1. List All Users Using Microsoft Graph API: GET https://graph.microsoft.com/v1.0/users Capture id and corresponding userPrincipalName ($uid, $userPrincipalName) 2. List all Role Definitions Using Azure management API: https://management.azure.com/subscriptions/<subscriptionId>/providers/Microsoft.Authorization/roleDefinitions?api-version=2017-05-01 Capture Role Definition IDs/Name ($name) and role names ($properties/roleName) where properties/roleName does NOT contain (Owner or *contributor or admin ) 3. List All Role Assignments (Mappings $A.uid to $B.name) Using Azure Management API: GET https://management.azure.com/subscriptions/<subscriptionId>/providers/Microsoft.Authorization/roleassignments?api-version=2017-10-01-preview Find all non-administrative roles ($B.name) in Properties/roleDefinationId mapped with user ids ($A.id) in Properties/principalId where Properties/principalType == User D> Now Match ($CProperties/principalId) with $A.uid and get $A.userPrincipalName save this as D.userPrincipleName Step 2: Run MSOL PowerShell command: Get-MsolUser -All | where {$_.StrongAuthenticationMethods.Count -eq 0} | Select-Object -Property UserPrincipalName If the output contains any of the $D.userPrincipleName, then this recommendation is non-compliant. 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: 81b3ccb4-e6e8-4e4a-8d05-5df25cd29fd4 - Name: 'Accounts with read permissions on Azure resources should be MFA enabled'

Impact Statement

Users would require two forms of authentication before any access is granted. Also, this requires an overhead for managing dual forms of authentication.

Assessment Status

Manual

Rationale Statement

Multi-factor authentication requires an individual to present a minimum of two separate forms of authentication before access is granted. Multi-factor authentication provides additional assurance that the individual attempting to gain access is who they claim to be. With multi-factor authentication, an attacker would need to compromise at least two different authentication mechanisms, increasing the difficulty of compromise and thus reducing the risk.

1.1.4Ensure that 'Allow users to remember multi-factor authentication on devices they trust' is Disabled0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Sub Section

1.1 Security Defaults Security Defaults

Description

Do not allow users to remember multi-factor authentication on devices.

Default Value

By default, Allow users to remember multi-factor authentication on devices they trust is disabled.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Click the Per-user MFA button on the top bar 1. Click on service settings 1. Ensure that Allow users to remember multi-factor authentication on devices they trust is not enabled

Impact Statement

For every login attempt, the user will be required to perform multi-factor authentication.

Assessment Status

Manual

Rationale Statement

Remembering Multi-Factor Authentication (MFA) for devices and browsers allows users to have the option to bypass MFA for a set number of days after performing a successful sign-in using MFA. This can enhance usability by minimizing the number of times a user may need to perform two-step verification on the same device. However, if an account or device is compromised, remembering MFA for trusted devices may affect security. Hence, it is recommended that users not be allowed to bypass MFA.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Click the Per-user MFA button on the top bar 1. Click on service settings 1. Uncheck the box next to Allow users to remember multi-factor authentication on devices they trust

1.2.1Ensure Trusted Locations Are Defined1
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Sub Section

1.2 Conditional Access

Description

Microsoft Entra ID Conditional Access allows an organization to configure Named locations and configure whether those locations are trusted or untrusted. These settings provide organizations the means to specify Geographical locations for use in conditional access policies, or define actual IP addresses and IP ranges and whether or not those IP addresses and/or ranges are trusted by the organization.

Default Value

By default, no locations are configured under the Named locations blade within the Microsoft Entra ID Conditional Access blade.

Audit Procedure

From Azure Portal 1. In the Azure Portal, navigate to Microsoft Entra ID Conditional Access 1. Click on Manage 1. Click on Named Locations Ensure there are IP ranges location settings configured and marked as Trusted From PowerShell Get-AzureADMSNamedLocationPolicy In the output from the above command, for each Named location group, make sure at least one entry contains the IsTrusted parameter with a value of True. Otherwise, if there is no output as a result of the above command or all of the entries contain the IsTrusted parameter with an empty value, a NULL value, or a value of False, the results are out of compliance with this check.

Impact Statement

When configuring Named locations, the organization can create locations using Geographical location data or by defining source IP addresses or ranges. Configuring Named locations using a Country location does not provide the organization the ability to mark those locations as trusted, and any Conditional Access policy relying on those Countries location setting will not be able to use the All trusted locations setting within the Conditional Access policy. They instead will have to rely on the Select locations setting. This may add additional resource requirements when configuring, and will require thorough organizational testing. In general, Conditional Access policies may completely prevent users from authenticating to Microsoft Entra ID, and thorough testing is recommended. To avoid complete lockout, a 'Break Glass' account with full Global Administrator rights is recommended in the event all other administrators are locked out of authenticating to Microsoft Entra ID. This 'Break Glass' account should be excluded from Conditional Access Policies and should be configured with the longest pass phrase feasible. This account should only be used in the event of an emergency and complete administrator lockout.

Assessment Status

Manual

Rationale Statement

Defining trusted source IP addresses or ranges helps organizations create and enforce Conditional Access policies around those trusted or untrusted IP addresses and ranges. Users authenticating from trusted IP addresses and/or ranges may have less access restrictions or access requirements when compared to users that try to authenticate to Microsoft Entra ID from untrusted locations or untrusted source IP addresses/ranges.

Remediation Procedure

From Azure Portal 1. Navigate to the Microsoft Entra ID Conditional Access Blade 1. Click on the Named locations blade 1. Within the Named locations blade, click on IP ranges location 1. Enter a name for this location setting in the Name text box 1. Click on the + sign 1. Add an IP Address Range in CIDR notation inside the text box that appears 1. Click on the Add button 1. Repeat steps 5 through 7 for each IP Range that needs to be added 1. If the information entered are trusted ranges, select the Mark as trusted location check box 1. Once finished, click on Create From PowerShell Create a new trusted IP-based Named location policy [System.Collections.Generic.List`1[Microsoft.Open.MSGraph.Model.IpRange]]$ipRanges = @() $ipRanges.Add(<first IP range in CIDR notation>) $ipRanges.Add(<second IP range in CIDR notation>) $ipRanges.Add(<third IP range in CIDR notation>) New-AzureADMSNamedLocationPolicy -OdataType #microsoft.graph.ipNamedLocation -DisplayName <name of IP Named location policy> -IsTrusted $true -IpRanges $ipRanges Set an existing IP-based Named location policy to trusted Set-AzureADMSNamedLocationPolicy -PolicyId <ID of the policy> -OdataType #microsoft.graph.ipNamedLocation -IsTrusted $true

1.2.2Ensure that an exclusionary Geographic Access Policy is considered0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Sub Section

1.2 Conditional Access

Description

CAUTION: If these policies are created without first auditing and testing the result, misconfiguration can potentially lock out administrators or create undesired access issues. Conditional Access Policies can be used to block access from geographic locations that are deemed out-of-scope for your organization or application. The scope and variables for this policy should be carefully examined and defined.

Default Value

This policy does not exist by default.

Audit Procedure

From Azure Portal 1. From Azure Home open the Portal menu in the top left, and select Microsoft Entra ID. 1. Scroll down in the menu on the left, and select Security. 1. Select on the left side Conditional Access. 1. Select the policy you wish to audit, then: - Under Assignments, Review the Users and Groups for the personnel the policy will apply to - Under Assignments, Review the Cloud apps or actions for the systems the policy will apply to - Under Conditions, Review the Include locations for those that should be blocked - Under Conditions, Review the Exclude locations for those that should be allowed (Note: locations set up in the previous recommendation for Trusted Location should be in the Exclude list.) - Under Access Controls > Grant - Confirm that Block Access is selected. From Azure CLI As of this writing there are no subcommands for Conditional Access Policies within the Azure CLI From PowerShell $conditionalAccessPolicies = Get-AzureADMSConditionalAccessPolicy foreach($policy in $conditionalAccessPolicies) {$policy | Select-Object @{N='Policy ID'; E={$policy.id}}, @{N=Included Locations; E={$policy.Conditions.Locations.IncludeLocations}}, @{N=Excluded Locations; E={$policy.Conditions.Locations.ExcludeLocations}}, @{N=BuiltIn GrantControls; E={$policy.GrantControls.BuiltInControls}}} Make sure there is at least 1 row in the output of the above PowerShell command that contains Block under the BuiltIn GrantControls column and location IDs under the Included Locations and Excluded Locations columns. If not, a policy containing these options has not been created and is considered a finding.

Impact Statement

Microsoft Entra ID P1 or P2 is required. Limiting access geographically will deny access to users that are traveling or working remotely in a different part of the world. A point-to-site or site to site tunnel such as a VPN is recommended to address exceptions to geographic access policies.

Assessment Status

Manual

Rationale Statement

Conditional Access, when used as a deny list for the tenant or subscription, is able to prevent ingress or egress of traffic to countries that are outside of the scope of interest (e.g.: customers, suppliers) or jurisdiction of an organization. This is an effective way to prevent unnecessary and long-lasting exposure to international threats such as APTs.

Remediation Procedure

From Azure Portal Part 1 of 2 - Create the policy and enable it in Report-only mode. 1. From Azure Home open the portal menu in the top left, and select Microsoft Entra ID. 1. Scroll down in the menu on the left, and select Security. 1. Select on the left side Conditional Access. 1. Click the + New policy button, then: 1. Provide a name for the policy. 1. Under Assignments, select Users or workload identities then: - Under Include, select All users - Under Exclude, check Users and groups and only select emergency access accounts and service accounts (NOTE: Service accounts are excluded here because service accounts are non-interactive and cannot complete MFA) 1. Under Assignments, select Cloud apps or actions then: - Under Include, select All cloud apps - Leave Exclude blank unless you have a well defined exception 1. Under Conditions, select Locations then: - Select Include, then add entries for locations for those that should be blocked - Select Exclude, then add entries for those that should be allowed (IMPORTANT: Ensure that all Trusted Locations are in the Exclude list.) 1. Under Access Controls, select Grant and Confirm that Block Access is selected. 1. Set Enable policy to Report-only. 1. Click Create. NOTE: The policy is not yet 'live,' since Report-only is being used to audit the effect of the policy. Part 2 of 2 - Confirm that the policy is not blocking access that should be granted, then toggle to On. 1. With your policy now in report-only mode, return to the Microsoft Entra blade and click on Sign-in logs. 1. Review the recent sign-in events - click an event then review the event details (specifically the Report-only tab) to ensure: - The sign-in event you're reviewing occurred after turning on the policy in report-only mode - The policy name from step 5 above is listed in the Policy Name column - The Result column for the new policy shows that the policy was Not applied (indicating the location origin was not blocked) 1. If the above conditions are present, navigate back to the policy name in Conditional Access and open it. 1. Toggle the policy from Report-only to On. 1. Click Save. From PowerShell First, set up the conditions objects values before updating an existing conditional access policy or before creating a new one. You may need to use additional PowerShell cmdlets to retrieve specific IDs such as the Get-AzureADMSNamedLocationPolicy which outputs the Location IDs for use with conditional access policies. $conditions = New-Object -TypeName Microsoft.Open.MSGraph.Model.ConditionalAccessConditionSet $conditions.Applications = New-Object -TypeName Microsoft.Open.MSGraph.Model.ConditionalAccessApplicationCondition $conditions.Applications.IncludeApplications = <All | Office365 | app ID | @(app ID 1, app ID 2, etc...> $conditions.Applications.ExcludeApplications = <Office365 | app ID | @(app ID 1, app ID 2, etc...)> $conditions.Users = New-Object -TypeName Microsoft.Open.MSGraph.Model.ConditionalAccessUserCondition $conditions.Users.IncludeUsers = <All | None | GuestsOrExternalUsers | Specific User ID | @(User ID 1, User ID 2, etc.)> $conditions.Users.ExcludeUsers = <GuestsOrExternalUsers | Specific User ID | @(User ID 1, User ID 2, etc.)> $conditions.Users.IncludeGroups = <group ID | All | @(Group ID 1, Group ID 2, etc...)> $conditions.Users.ExcludeGroups = <group ID | @(Group ID 1, Group ID 2, etc...)> $conditions.Users.IncludeRoles = <Role ID | All | @(Role ID 1, Role ID 2, etc...)> $conditions.Users.ExcludeRoles = <Role ID | @(Role ID 1, Role ID 2, etc...)> $conditions.Locations = New-Object -TypeName Microsoft.Open.MSGraph.Model.ConditionalAccessLocationCondition $conditions.Locations.IncludeLocations = <Location ID | @(Location ID 1, Location ID 2, etc...) > $conditions.Locations.ExcludeLocations = <AllTrusted | Location ID | @(Location ID 1, Location ID 2, etc...)> $controls = New-Object -TypeName Microsoft.Open.MSGraph.Model.ConditionalAccessGrantControls $controls._Operator = OR $controls.BuiltInControls = block Next, update the existing conditional access policy with the condition set options configured with the previous commands. Set-AzureADMSConditionalAccessPolicy -PolicyId <policy ID> -Conditions $conditions -GrantControls $controls To create a new conditional access policy that complies with this best practice, run the following commands after creating the condition set above New-AzureADMSConditionalAccessPolicy -Name Policy Name -State <enabled|disabled> -Conditions $conditions -GrantControls $controls

Additional Information

These policies should be tested by using the What If tool in the References. Setting these can and will create issues with logging in for users until they use an MFA device linked to their accounts. Further testing can also be done via the insights and reporting resource in References which monitors Azure sign ins.

1.2.3Ensure that A Multi-factor Authentication Policy Exists for Administrative Groups0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Sub Section

1.2 Conditional Access

Description

For designated users, they will be prompted to use their multi-factor authentication (MFA) process on login.

Default Value

By default, MFA is not enabled for any administrative accounts.

Audit Procedure

From Azure Portal 1. From Azure Home open the Portal Menu in the top left, and select Microsoft Entra ID. 1. Select Security. 1. Select Conditional Access. 1. Select the policy you wish to audit. 1. View under Users and Groups the corresponding users and groups to whom the policy is applied. Be certain the emergency access account is not in the list. 1. View under Exclude to determine which Users and groups to whom the policy is not applied.

Impact Statement

There is an increased cost, as Conditional Access policies require Microsoft Entra ID P1. Similarly, MFA may require additional overhead to maintain. There is also a potential scenario in which the multi-factor authentication method can be lost, and administrative users are no longer able to log in. For this scenario, there should be an emergency access account. Please see References for creating this.

Assessment Status

Manual

Rationale Statement

Enabling multi-factor authentication is a recommended setting to limit the use of Administrative accounts to authenticated personnel.

Remediation Procedure

From Azure Portal 1. From Azure Home open the Portal Menu in top left, and select Microsoft Entra ID. 1. Select Security. 1. Select Conditional Access. 1. Click + New policy. 1. Enter a name for the policy. 1. Select Users or workload identities. 1. Check Users and groups. 1. Select administrative groups this policy should apply to and click Select. 1. Under Exclude, check Users and groups. 1. Select users this policy not should apply to and click Select. 1. Select Cloud apps or actions. 1. Select All cloud apps. 1. Select Grant. 1. Under Grant access, check Require multifactor authentication and click Select. 1. Set Enable policy to Report-only. 1. Click Create. After testing the policy in report-only mode, update the Enable policy setting from Report-only to On.

Additional Information

These policies should be tested by using the What If tool in the References. Setting these can and will create issues with logging in for users until they use an MFA device linked to their accounts. Further testing can also be done via the insights and reporting resource in References which monitors Azure sign ins.

1.2.4Ensure that A Multi-factor Authentication Policy Exists for All Users0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Sub Section

1.2 Conditional Access

Description

For designated users, they will be prompted to use their multi-factor authentication (MFA) process on logins.

Default Value

MFA is not enabled by default.

Audit Procedure

From Azure Portal 1. From Azure Home open the Portal Menu in the top left, and select Microsoft Entra ID. 2. Scroll down in the menu on the left, and select Security. 3. Select on the left side Conditional Access. 4. Select the policy you wish to audit. 5. View under Users and Groups the corresponding users and groups to whom the policy is applied. 6. View under Exclude to determine which users and groups to whom the policy is not applied.

Impact Statement

There is an increased cost, as Conditional Access policies require Microsoft Entra ID P1 or P2. Similarly, this may require additional overhead to maintain if users lose access to their MFA.

Assessment Status

Manual

Rationale Statement

Enabling multi-factor authentication is a recommended setting to limit the potential of accounts being compromised and limiting access to authenticated personnel.

Remediation Procedure

From Azure Portal 1. From Azure Home open Portal menu in the top left, and select Microsoft Entra ID. 1. Select Security. 1. Select Conditional Access. 1. Click + New policy. 1. Enter a name for the policy. 1. Select Users or workload identities. 1. Under Include, select All users. 1. Under Exclude, check Users and groups. 1. Select users this policy should not apply to and click Select. 1. Select Cloud apps or actions. 1. Select All cloud apps. 1. Select Grant. 1. Under Grant access, check Require multifactor authentication and click Select. 1. Set Enable policy to Report-only. 1. Click Create. After testing the policy in report-only mode, update the Enable policy setting from Report-only to On.

Additional Information

These policies should be tested by using the What If tool in the References. Setting these can and will create issues with logging in for users until they use an MFA device linked to their accounts. Further testing can also be done via the insights and reporting resource the in References which monitors Azure sign ins.

1.2.5Ensure Multi-factor Authentication is Required for Risky Sign-ins0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Sub Section

1.2 Conditional Access

Description

For designated users, they will be prompted to use their multi-factor authentication (MFA) process on login.

Default Value

MFA is not enabled by default.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu in the top left, and select Microsoft Entra ID. 1. Select Security. 1. Select on the left side Conditional Access. 1. Select the policy you wish to audit. 1. View under Users and Groups the corresponding users and groups to whom the policy is applied. 1. View under Exclude to determine which users and groups to whom the policy is not applied.

Impact Statement

There is an increased cost, as Conditional Access policies require Microsoft Entra ID P1 or P2. Similarly, they may require additional overhead to maintain if users lose access to their MFA.

Assessment Status

Manual

Rationale Statement

Enabling multi-factor authentication is a recommended setting to limit the potential of accounts being compromised and limiting access to authenticated personnel.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu in the top left, and select Microsoft Entra ID. 1. Select Security 1. Select Conditional Access. 1. Click + New policy. 1. Enter a name for the policy. 1. Select Users or workload identities. 1. Under Include, select All users. 1. Under Exclude, check Users and groups. 1. Select users this policy should not apply to and click Select. 1. Select Cloud apps or actions. 1. Select All cloud apps. 1. Select Conditions. 1. Select Sign-in risk. 1. Update the Configure toggle to Yes. 1. Check the sign-in risk level this policy should apply to, e.g. High and Medium. 1. Select Done. 1. Click the blue text under Grant access and check Require multifactor authentication then click the Select button. 1. Click the blue text under Session then check Sign-in frequency and select Every time and click the Select button. 1. Set Enable policy to Report-only. 1. Click Create. After testing the policy in report-only mode, update the Enable policy setting from Report-only to On.

Additional Information

These policies should be tested by using the What If tool in the References. Setting these can and will create issues with logging in for users until they use an MFA device linked to their accounts. Further testing can also be done via the insights and reporting resource the in References which monitors Azure sign ins.

1.2.6Ensure Multifactor Authentication is Required for Windows Azure Service Management API1
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Sub Section

1.2 Conditional Access

Description

This recommendation ensures that users accessing the Windows Azure Service Management API (i.e. Azure Powershell, Azure CLI, Azure Resource Manager API, etc.) are required to use multifactor authentication (MFA) credentials when accessing resources through the Windows Azure Service Management API.

Default Value

MFA is not enabled by default for administrative actions.

Audit Procedure

From Azure Portal 1. From the Azure Admin Portal dashboard, open Microsoft Entra ID. 1. In the menu on the left of the Entra ID blade, click Security. 1. In the menu on the left of the Security blade, click Conditional Access. 1. In the menu on the left of the Conditional Access blade, click Policies. 1. Click on the name of the policy you wish to audit. 1. Click the blue text under Users. 1. Under the Include section of Users, review Users and Groups to ensure that All Users is selected. 1. Under the Exclude section of Users, review the Users and Groups that are excluded from the policy (NOTE: this should be limited to break-glass emergency access accounts, non-interactive service accounts, and other carefully considered exceptions). 1. On the left side, click the blue text under Target Resources. 1. Select what this policy applies to should have Cloud apps selected. 1. Under the Include section of Target Resources, the Select apps radio button should be selected. 1. Click the blue text under Select. 1. From the select prompt that appears, the checkbox for Windows Azure Service Management API should be checked.

Impact Statement

Conditional Access policies require Microsoft Entra ID P1 or P2 licenses. Similarly, they may require additional overhead to maintain if users lose access to their MFA. Any users or groups which are granted an exception to this policy should be carefully tracked, be granted only minimal necessary privileges, and conditional access exceptions should be regularly reviewed or investigated.

Assessment Status

Manual

Rationale Statement

Administrative access to the Windows Azure Service Management API should be secured with a higher level of scrutiny to authenticating mechanisms. Enabling multifactor authentication is recommended to reduce the potential for abuse of Administrative actions, and to prevent intruders or compromised admin credentials from changing administrative settings. IMPORTANT: While this recommendation allows exceptions to specific Users or Groups, they should be very carefully tracked and reviewed for necessity on a regular interval through an Access Review process. It is important that this rule be built to include All Users to ensure that all users not specifically excepted will be required to use MFA to access the Azure Service Management API.

Remediation Procedure

From Azure Portal 1. From the Azure Admin Portal dashboard, open Microsoft Entra ID. 1. Click Security in the Entra ID blade. 1. Click Conditional Access in the Security blade. 1. Click Policies in the Conditional Access blade. 1. Click + New policy. 1. Enter a name for the policy. 1. Click the blue text under Users. 1. Under Include, select All users. 1. Under Exclude, check Users and groups. 1. Select users or groups to be exempted from this policy (e.g. break-glass emergency accounts, and non-interactive service accounts) then click the Select button. 1. Click the blue text under Target Resources. 1. Under Include, click the Select apps radio button. 1. Click the blue text under Select. 1. Check the box next to Windows Azure Service Management APIs then click the Select button. 1. Click the blue text under Grant. 1. Under Grant access check the box for Require multifactor authentication then click the Select button. 1. Before creating, set Enable policy to Report-only. 1. Click Create. After testing the policy in report-only mode, update the Enable policy setting from Report-only to On.

Additional Information

These policies should be tested by using the What If tool in the References. Setting these can and will create issues with administrators changing settings until they use an MFA device linked to their accounts. An emergency access account is recommended for this eventuality if all administrators are locked out. Please see the documentation in the references for further information. Similarly further testing can also be done via the insights and reporting resource in References which monitors Azure sign ins.

1.2.7Ensure Multifactor Authentication is Required to access Microsoft Admin Portals0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Sub Section

1.2 Conditional Access

Description

This recommendation ensures that users accessing Microsoft Admin Portals (i.e. Microsoft 365 Admin, Microsoft 365 Defender, Exchange Admin Center, Azure Portal, etc.) are required to use multifactor authentication (MFA) credentials when logging into an Admin Portal.

Default Value

MFA is not enabled by default for administrative actions.

Audit Procedure

From Azure Portal 1. From the Azure Admin Portal dashboard, open Microsoft Entra ID. 1. In the menu on the left of the Entra ID blade, click Security. 1. In the menu on the left of the Security blade, click Conditional Access. 1. In the menu on the left of the Conditional Access blade, click Policies. 1. Click on the name of the policy you wish to audit. 1. Click the blue text under Users. 1. Under the Include section of Users, review Users and Groups to ensure that All Users is selected. 1. Under the Exclude section of Users, review the Users and Groups that are excluded from the policy (NOTE: this should be limited to break-glass emergency access accounts, non-interactive service accounts, and other carefully considered exceptions). 1. On the left side, click the blue text under Target Resources. 1. Select what this policy applies to should have Cloud apps selected. 1. Under the Include section of Target Resources, the Select apps radio button should be selected. 1. Click the blue text under Select. 1. From the select prompt that appears, the checkbox for Microsoft Admin Portals should be checked.

Impact Statement

Conditional Access policies require Microsoft Entra ID P1 or P2 licenses. Similarly, they may require additional overhead to maintain if users lose access to their MFA. Any users or groups which are granted an exception to this policy should be carefully tracked, be granted only minimal necessary privileges, and conditional access exceptions should be reviewed or investigated.

Assessment Status

Manual

Rationale Statement

Administrative Portals for Microsoft Azure should be secured with a higher level of scrutiny to authenticating mechanisms. Enabling multifactor authentication is recommended to reduce the potential for abuse of Administrative actions, and to prevent intruders or compromised admin credentials from changing administrative settings. IMPORTANT: While this recommendation allows exceptions to specific Users or Groups, they should be very carefully tracked and reviewed for necessity on a regular interval through an Access Review process. It is important that this rule be built to include All Users to ensure that all users not specifically excepted will be required to use MFA to access Admin Portals.

Remediation Procedure

From Azure Portal 1. From the Azure Admin Portal dashboard, open Microsoft Entra ID. 1. Click Security in the Entra ID blade. 1. Click Conditional Access in the Security blade. 1. Click Policies in the Conditional Access blade. 1. Click + New policy. 1. Enter a name for the policy. 1. Click the blue text under Users. 1. Under Include, select All users. 1. Under Exclude, check Users and groups. 1. Select users or groups to be exempted from this policy (e.g. break-glass emergency accounts, and non-interactive service accounts) then click the Select button. 1. Click the blue text under Target Resources. 1. Under Include, click the Select apps radio button. 1. Click the blue text under Select. 1. Check the box next to Microsoft Admin Portals then click the Select button. 1. Click the blue text under Grant. 1. Under Grant access check the box for Require multifactor authentication then click the Select button. 1. Before creating, set Enable policy to Report-only. 1. Click Create. After testing the policy in report-only mode, update the Enable policy setting from Report-only to On.

Additional Information

These policies should be tested by using the What If tool in the References. Setting these can and will create issues with administrators changing settings until they use an MFA device linked to their accounts. An emergency access account is recommended for this eventuality if all administrators are locked out. Please see the documentation in the references for further information. Similarly further testing can also be done via the insights and reporting resource in References which monitors Azure sign ins.

1.3Ensure that 'Restrict non-admin users from creating tenants' is set to 'Yes'1
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Require administrators or appropriately delegated users to create new tenants.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Select User settings 1. Ensure that Restrict non-admin users from creating tenants is set to Yes From PowerShell Import-Module Microsoft.Graph.Identity.SignIns Connect-MgGraph -Scopes 'Policy.ReadWrite.Authorization' Get-MgPolicyAuthorizationPolicy | Select-Object -ExpandProperty DefaultUserRolePermissions | Format-List Review the DefaultUserRolePermissions section of the output. Ensure that AllowedToCreateTenants is not True.

Impact Statement

Enforcing this setting will ensure that only authorized users are able to create new tenants.

Assessment Status

Manual

Rationale Statement

It is recommended to only allow an administrator to create new tenants. This prevent users from creating new Microsoft Entra ID or Azure AD B2C tenants and ensures that only authorized users are able to do so.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Select User settings 1. Set Restrict non-admin users from creating tenants to Yes From PowerShell Import-Module Microsoft.Graph.Identity.SignIns Connect-MgGraph -Scopes 'Policy.ReadWrite.Authorization' Select-MgProfile -Name beta $params = @{ DefaultUserRolePermissions = @{ AllowedToCreateTenants = $false } } Update-MgPolicyAuthorizationPolicy -AuthorizationPolicyId -BodyParameter $params

1.4Ensure Guest Users Are Reviewed on a Regular Basis0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Microsoft Entra ID is extended to include Azure AD B2B collaboration, allowing you to invite people from outside your organization to be guest users in your cloud account and sign in with their own work, school, or social identities. Guest users allow you to share your company's applications and services with users from any other organization, while maintaining control over your own corporate data. Work with external partners, large or small, even if they don't have Azure AD or an IT department. A simple invitation and redemption process lets partners use their own credentials to access your company's resources as a guest user. Guest users in every subscription should be review on a regular basis to ensure that inactive and unneeded accounts are removed.

Default Value

By default no guest users are created.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Click on Add filter 1. Select User type 1. Select Guest from the Value dropdown 1. Click Apply 1. Audit the listed guest users From Azure CLI az ad user list --query [?userType=='Guest'] Ensure all users listed are still required and not inactive. From Azure PowerShell Get-AzureADUser |Where-Object {$_.UserType -like Guest} |Select-Object DisplayName, UserPrincipalName, UserType -Unique 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: e9ac8f8e-ce22-4355-8f04-99b911d6be52 - Name: 'Guest accounts with read permissions on Azure resources should be removed' - Policy ID: 94e1c2ac-cbbe-4cac-a2b5-389c812dee87 - Name: 'Guest accounts with write permissions on Azure resources should be removed' - Policy ID: 339353f6-2387-4a45-abe4-7f529d121046 - Name: 'Guest accounts with owner permissions on Azure resources should be removed'

Impact Statement

Before removing guest users, determine their use and scope. Like removing any user, there may be unforeseen consequences to systems if it is deleted.

Assessment Status

Manual

Rationale Statement

Guest users in the Microsoft Entra ID are generally required for collaboration purposes in Office 365, and may also be required for Azure functions in enterprises with multiple Azure tenants. Guest users are typically added outside your employee on-boarding/off-boarding process and could potentially be overlooked indefinitely, leading to a potential vulnerability. To prevent this, guest users should be reviewed on a regular basis. During this audit, guest users should also be determined to not have administrative privileges.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Click on Add filter 1. Select User type 1. Select Guest from the Value dropdown 1. Click Apply 1. Delete all Guest users that are no longer required or are inactive From Azure CLI Before deleting the user, set it to inactive using the ID from the Audit Procedure to determine if there are any dependent systems. az ad user update --id <exampleaccountid@domain.com> --account-enabled {false} After determining that there are no dependent systems delete the user. Remove-AzureADUser -ObjectId <exampleaccountid@domain.com> From Azure PowerShell Before deleting the user, set it to inactive using the ID from the Audit Procedure to determine if there are any dependent systems. Set-AzureADUser -ObjectId <exampleaccountid@domain.com> -AccountEnabled false After determining that there are no dependent systems delete the user. PS C:\>Remove-AzureADUser -ObjectId <exampleaccountid@domain.com>

Additional Information

It is good practice to use a dynamic security group to manage guest users. To create the dynamic security group: 1. Navigate to the 'Microsoft Entra ID' blade in the Azure Portal 2. Select the 'Groups' item 3. Create new 4. Type of 'dynamic' 5. Use the following dynamic selection rule. (user.userType -eq Guest) 6. Once the group has been created, select access reviews option and create a new access review with a period of monthly and send to relevant administrators for review.

1.5Ensure That 'Number of methods required to reset' is set to '2'0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Ensures that two alternate forms of identification are provided before allowing a password reset.

Default Value

By default, the Number of methods required to reset is set to 2.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Users 1. Select Password reset 1. Then Authentication methods 1. Ensure that Number of methods required to reset is set to 2

Impact Statement

There may be administrative overhead, as users who lose access to their secondary authentication methods will need an administrator with permissions to remove it. There will also need to be organization-wide security policies and training to teach administrators to verify the identity of the requesting user so that social engineering can not render this setting useless.

Assessment Status

Manual

Rationale Statement

A Self-service Password Reset (SSPR) through Azure Multi-factor Authentication (MFA) ensures the user's identity is confirmed using two separate methods of identification. With multiple methods set, an attacker would have to compromise both methods before they could maliciously reset a user's password.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Users 1. Select Password reset 1. Then Authentication methods 1. Set the Number of methods required to reset to 2

1.6Ensure that a Custom Bad Password List is set to 'Enforce' for your Organization0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Microsoft Azure provides a Global Banned Password policy that applies to Azure administrative and normal user accounts. This is not applied to user accounts that are synced from an on-premise Active Directory unless Microsoft Entra ID Connect is used and you enable EnforceCloudPasswordPolicyForPasswordSyncedUsers. Please see the list in default values on the specifics of this policy. To further password security, it is recommended to further define a custom banned password policy.

Default Value

By default the custom bad password list is not 'Enabled'. Organizational-specific terms can be added to the custom banned password list, such as the following examples: - Brand names - Product names - Locations, such as company headquarters - Company-specific internal terms - Abbreviations that have specific company meaning - Months and weekdays with your company's local languages The default Azure bad password policy is already applied to your resources which applies the following basic requirements: Characters allowed: - Uppercase characters (A - Z) - Lowercase characters (a - z) - Numbers (0 - 9) - Symbols: - @ # $ % ^ & * - _ ! + = [ ] { } | \ : ' , . ? / ` ~ ( ) ; < > - blank space Characters not allowed: - Unicode characters - Password length Passwords require - A minimum of eight characters - A maximum of 256 characters Password complexity: Passwords require three out of four of the following categories: - Uppercase characters - Lowercase characters - Numbers - Symbols Note: Password complexity check isn't required for Education tenants. Password not recently used: - When a user changes or resets their password, the new password can't be the same as the current or recently used passwords. - Password isn't banned by Entra ID Password Protection. - The password can't be on the global list of banned passwords for Azure AD Password Protection, or on the customizable list of banned passwords specific to your organization.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID. 1. Select 'Security'. 1. Under Manage, select Authentication Methods. 1. Select Password Protection. 1. Ensure Enforce custom list is set to Yes. 1. Scroll through the list to view the enforced passwords.

Impact Statement

Increasing needed password complexity might increase overhead on administration of user accounts. Licensing requirement for Global Banned Password List and Custom Banned Password list requires Microsoft Entra ID P1 or P2. On-premises Active Directory Domain Services users that are not synchronized to Microsoft Entra ID also benefit from Microsoft Entra ID Password Protection based on existing licensing for synchronized users.

Assessment Status

Manual

Rationale Statement

Enabling this gives your organization further customization on what secure passwords are allowed. Setting a bad password list enables your organization to fine-tune its password policy further, depending on your needs. Removing easy-to-guess passwords increases the security of access to your Azure resources.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Security. 1. Under Manage, select Authentication Methods. 1. Select Password Protection. 1. Set the Enforce custom list option to Yes. 1. Double click the custom banned password list to add a string.

1.7Ensure that 'Number of days before users are asked to re-confirm their authentication information' is not set to '0'0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Ensure that the number of days before users are asked to re-confirm their authentication information is not set to 0.

Default Value

By default, the Number of days before users are asked to re-confirm their authentication information is set to 180 days.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Users 1. Select Password reset 1. Then Registration 1. Ensure that Number of days before users are asked to re-confirm their authentication information is not set to 0

Impact Statement

Users will be prompted for their multifactor authentication at the duration set here.

Assessment Status

Manual

Rationale Statement

This setting is necessary if you have setup 'Require users to register when signing in option'. If authentication re-confirmation is disabled, registered users will never be prompted to re-confirm their existing authentication information. If the authentication information for a user changes, such as a phone number or email, then the password reset information for that user reverts to the previously registered authentication information.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Users 1. Select Password reset 1. Then Registration 1. Set the Number of days before users are asked to re-confirm their authentication information to your organization-defined frequency.

1.8Ensure that 'Notify users on password resets?' is set to 'Yes'0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Ensure that users are notified on their primary and secondary emails on password resets.

Default Value

By default, Notify users on password resets? is set to Yes.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Go to Password reset 1. Under Manage, select Notifications 1. Ensure that Notify users on password resets? is set to Yes

Impact Statement

Users will receive emails alerting them to password changes to both their primary and secondary emails.

Assessment Status

Manual

Rationale Statement

User notification on password reset is a proactive way of confirming password reset activity. It helps the user to recognize unauthorized password reset activities.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Select Password reset 1. Under Manage, select Notifications 1. Set Notify users on password resets? to Yes

1.9Ensure That 'Notify all admins when other admins reset their password?' is set to 'Yes'0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Ensure that all Global Administrators are notified if any other administrator resets their password.

Default Value

By default, Notify all admins when other admins reset their password? is set to No.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Select Password reset 1. Under Manage, select Notifications 1. Ensure that notify all admins when other admins reset their password? is set to Yes

Impact Statement

All Global Administrators will receive a notification from Azure every time a password is reset. This is useful for auditing procedures to confirm that there are no out of the ordinary password resets for Global Administrators. There is additional overhead, however, in the time required for Global Administrators to audit the notifications. This setting is only useful if all Global Administrators pay attention to the notifications, and audit each one.

Assessment Status

Manual

Rationale Statement

Global Administrator accounts are sensitive. Any password reset activity notification, when sent to all Global Administrators, ensures that all Global administrators can passively confirm if such a reset is a common pattern within their group. For example, if all Global Administrators change their password every 30 days, any password reset activity before that may require administrator(s) to evaluate any unusual activity and confirm its origin.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Select Password reset 1. Under Manage, select Notifications 1. Set Notify all admins when other admins reset their password? to Yes

1.10Ensure `User consent for applications` is set to `Do not allow user consent`1
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Require administrators to provide consent for applications before use.

Default Value

By default, Users consent for applications is set to Allow user consent for apps.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Enterprise Applications 1. Select Consent and permissions 1. Select User consent settings 1. Ensure User consent for applications is set to Do not allow user consent From PowerShell Connect-MsolService Get-MsolCompanyInformation | Select-Object UsersPermissionToUserConsentToAppEnabled Command should return UsersPermissionToUserConsentToAppEnabled with the value of False

Impact Statement

Enforcing this setting may create additional requests that administrators need to review.

Assessment Status

Manual

Rationale Statement

If Microsoft Entra ID is running as an identity provider for third-party applications, permissions and consent should be limited to administrators or pre-approved. Malicious applications may attempt to exfiltrate data or abuse privileged user accounts.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Enterprise Applications 1. Select Consent and permissions 1. Select User consent settings 1. Set User consent for applications to Do not allow user consent 1. Click save

1.11Ensure ‘User consent for applications’ Is Set To ‘Allow for Verified Publishers’1
Attributes
Profile

Level 2

Section

1 Identity and Access Management

Description

Allow users to provide consent for selected permissions when a request is coming from a verified publisher.

Default Value

By default, User consent for applications is set to Allow user consent for apps.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Enterprise Applications 1. Select Consent and permissions 1. Select User consent settings 1. Under User consent for applications, ensure Allow user consent for apps from verified publishers, for selected permissions is selected From PowerShell Connect-MsolService Get-MsolCompanyInformation | Select-Object UsersPermissionToUserConsentToAppEnabled Command should return UsersPermissionToUserConsentToAppEnabled with the value of False

Impact Statement

Enforcing this setting may create additional requests that administrators need to review.

Assessment Status

Manual

Rationale Statement

If Microsoft Entra ID is running as an identity provider for third-party applications, permissions and consent should be limited to administrators or pre-approved. Malicious applications may attempt to exfiltrate data or abuse privileged user accounts.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Enterprise Applications 1. Select Consent and permissions 1. Select User consent settings 1. Under User consent for applications, select Allow user consent for apps from verified publishers, for selected permissions 1. Select Save From PowerShell Connect-MsolService Set-MsolCompanyInformation --UsersPermissionToUserConsentToAppEnabled $False

1.12Ensure that 'Users can add gallery apps to My Apps' is set to 'No'0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Require administrators to provide consent for the apps before use.

Default Value

By default, Users can add gallery apps to My Apps is set to No.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Enterprise applications 1. Select User settings 1. Ensure that Users can add gallery apps to My Apps is set to No

Impact Statement

Can cause additional requests to administrators that need to be fulfilled quite often.

Assessment Status

Manual

Rationale Statement

Unless Microsoft Entra ID is running as an identity provider for third-party applications, do not allow users to use their identity outside of your cloud environment. User profiles contain private information such as phone numbers and email addresses which could then be sold off to other third parties without requiring any further consent from the user.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Enterprise applications 1. Select User settings 1. Set Users can add gallery apps to My Apps to No

1.13Ensure That ‘Users Can Register Applications’ Is Set to ‘No’1
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Require administrators or appropriately delegated users to register third-party applications.

Default Value

By default, Users can register applications is set to Yes.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Select User settings 1. Ensure that Users can register applications is set to No From PowerShell Connect-MsolService Get-MsolCompanyInformation | Select-Object UsersPermissionToCreateLOBAppsEnabled Command should return UsersPermissionToCreateLOBAppsEnabled with the value of False

Impact Statement

Enforcing this setting will create additional requests for approval that will need to be addressed by an administrator. If permissions are delegated, a user may approve a malevolent third party application, potentially giving it access to your data.

Assessment Status

Manual

Rationale Statement

It is recommended to only allow an administrator to register custom-developed applications. This ensures that the application undergoes a formal security review and approval process prior to exposing Microsoft Entra ID data. Certain users like developers or other high-request users may also be delegated permissions to prevent them from waiting on an administrative user. Your organization should review your policies and decide your needs.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Users 1. Select User settings 1. Set Users can register applications to No From PowerShell Connect-MsolService Set-MsolCompanyInformation -UsersPermissionToCreateLOBAppsEnabled $False

1.14Ensure That 'Guest users access restrictions' is set to 'Guest user access is restricted to properties and memberships of their own directory objects'1
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Limit guest user permissions.

Default Value

By default, Guest user access restrictions is set to Guest users have limited access to properties and memberships of directory objects.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then External Identities 1. Select External collaboration settings 1. Under Guest user access, ensure that Guest user access restrictions is set to Guest user access is restricted to properties and memberships of their own directory objects From PowerShell 1. Enter the following Get-AzureADMSAuthorizationPolicy Which will give a result like: Id : authorizationPolicy OdataType : Description : Used to manage authorization related settings across the company. DisplayName : Authorization Policy EnabledPreviewFeatures : {} GuestUserRoleId : 10dae51f-b6af-4016-8d66-8c2a99b929b3 PermissionGrantPolicyIdsAssignedToDefaultUserRole : {user-default-legacy} If the GuestUserRoleID property does not equal 2af84b1e-32c8-42b7-82bc-daa82404023b then it is not set to most restrictive.

Impact Statement

This may create additional requests for permissions to access resources that administrators will need to approve. According to https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/users-restrict-guest-permissions#services-currently-not-supported Service without current support might have compatibility issues with the new guest restriction setting. - Forms - Project - Yammer - Planner in SharePoint

Assessment Status

Manual

Rationale Statement

Limiting guest access ensures that guest accounts do not have permission for certain directory tasks, such as enumerating users, groups or other directory resources, and cannot be assigned to administrative roles in your directory. Guest access has three levels of restriction. 1. Guest users have the same access as members (most inclusive), 2. Guest users have limited access to properties and memberships of directory objects (default value), 3. Guest user access is restricted to properties and memberships of their own directory objects (most restrictive). The recommended option is the 3rd, most restrictive: Guest user access is restricted to their own directory object.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then External Identities 1. Select External collaboration settings 1. Under Guest user access, change Guest user access restrictions to be Guest user access is restricted to properties and memberships of their own directory objects From PowerShell 1. From a PowerShell session enter Set-AzureADMSAuthorizationPolicy -GuestUserRoleId '2af84b1e-32c8-42b7-82bc-daa82404023b' 1. Check that the setting was applied by entering Get-AzureADMSAuthorizationPolicy 1. Make certain that the GuestUserRoleId is equal to the earlier entered value of 2af84b1e-32c8-42b7-82bc-daa82404023b.

1.15Ensure that 'Guest invite restrictions' is set to Only users assigned to specific admin roles can invite guest users1
Attributes
Profile

Level 2

Section

1 Identity and Access Management

Description

Restrict invitations to users with specific administrative roles only.

Default Value

By default, Guest invite restrictions is set to Anyone in the organization can invite guest users including guests and non-admins

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then External Identities 1. External collaboration settings 1. Under Guest invite settings, for Guest invite restrictions, ensure that that Only users assigned to specific admin roles can invite guest users is selected Note: This setting has 4 levels of restriction, which include: - Anyone in the organization can invite guest users including guests and non-admins (most inclusive), - Member users and users assigned to specific admin roles can invite guest users including guests with member permissions, - Only users assigned to specific admin roles can invite guest users, - No one in the organization can invite guest users including admins (most restrictive).

Impact Statement

With the option of Only users assigned to specific admin roles can invite guest users selected, users with specific admin roles will be in charge of sending invitations to the external users, requiring additional overhead by them to manage user accounts. This will mean coordinating with other departments as they are onboarding new users.

Assessment Status

Manual

Rationale Statement

Restricting invitations to users with specific administrator roles ensures that only authorized accounts have access to cloud resources. This helps to maintain Need to Know permissions and prevents inadvertent access to data. By default the setting Guest invite restrictions is set to Anyone in the organization can invite guest users including guests and non-admins. This would allow anyone within the organization to invite guests and non-admins to the tenant, posing a security risk.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then External Identities 1. Select External collaboration settings 1. Under Guest invite settings, for Guest invite restrictions, ensure that Only users assigned to specific admin roles can invite guest users is selected

1.16Ensure That 'Restrict access to Microsoft Entra admin center' is Set to 'Yes'0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Restrict access to the Microsoft Entra ID administration center to administrators only. NOTE: This only affects access to the Entra ID administrator's web portal. This setting does not prohibit privileged users from using other methods such as Rest API or Powershell to obtain sensitive information from Microsoft Entra ID.

Default Value

By default, Restrict access to Microsoft Entra admin center is set to No

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Users 1. Select User settings 1. Ensure that Restrict access to Microsoft Entra admin center is set to Yes

Impact Statement

All administrative tasks will need to be done by Administrators, causing additional overhead in management of users and resources.

Assessment Status

Manual

Rationale Statement

The Microsoft Entra ID administrative center has sensitive data and permission settings. All non-administrators should be prohibited from accessing any Microsoft Entra ID data in the administration center to avoid exposure.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Users 1. Select User settings 1. Set Restrict access to Microsoft Entra admin center to Yes

1.17Ensure that 'Restrict user ability to access groups features in the Access Pane' is Set to 'Yes'0
Attributes
Profile

Level 2

Section

1 Identity and Access Management

Description

Restrict access to group web interface in the Access Panel portal.

Default Value

By default, Restrict user ability to access groups features in the Access Pane is set to No

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Groups 1. Select General under Settings 1. Ensure that Restrict user ability to access groups features in My Groups is set to Yes

Impact Statement

Setting to Yes could create administrative overhead by customers seeking certain group memberships that will have to be manually managed by administrators with appropriate permissions.

Assessment Status

Manual

Rationale Statement

Self-service group management enables users to create and manage security groups or Office 365 groups in Microsoft Entra ID. Unless a business requires this day-to-day delegation for some users, self-service group management should be disabled. Any user can access the Access Panel, where they can reset their passwords, view their information, etc. By default, users are also allowed to access the Group feature, which shows groups, members, related resources (SharePoint URL, Group email address, Yammer URL, and Teams URL). By setting this feature to 'Yes', users will no longer have access to the web interface, but still have access to the data using the API. This is useful to prevent non-technical users from enumerating groups-related information, but technical users will still be able to access this information using APIs.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Groups 1. Select General under Settings 1. Ensure that Restrict user ability to access groups features in My Groups is set to Yes

1.18Ensure that 'Users can create security groups in Azure portals, API or PowerShell' is set to 'No'1
Attributes
Profile

Level 2

Section

1 Identity and Access Management

Description

Restrict security group creation to administrators only.

Default Value

By default, Users can create security groups in Azure portals, API or PowerShell is set to Yes

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Groups 1. Select General under Settings 1. Ensure that Users can create security groups in Azure portals, API or PowerShell is set to No

Impact Statement

Enabling this setting could create a number of requests that would need to be managed by an administrator.

Assessment Status

Manual

Rationale Statement

When creating security groups is enabled, all users in the directory are allowed to create new security groups and add members to those groups. Unless a business requires this day-to-day delegation, security group creation should be restricted to administrators only.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Groups 1. Select General under Settings 1. Set Users can create security groups in Azure portals, API or PowerShell to No

1.19Ensure that 'Owners can manage group membership requests in the Access Panel' is set to 'No'0
Attributes
Profile

Level 2

Section

1 Identity and Access Management

Description

Restrict security group management to administrators only.

Default Value

By default, Owners can manage group membership requests in the Access Panel is set to No.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Groups 1. Select General in settings 4. Ensure that Owners can manage group membership requests in the Access Panel is set to No

Impact Statement

Group Membership for user accounts will need to be handled by Admins and cause administrative overhead.

Assessment Status

Manual

Rationale Statement

Restricting security group management to administrators only prohibits users from making changes to security groups. This ensures that security groups are appropriately managed and their management is not delegated to non-administrators.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Groups 1. Select General in settings 1. Set Owners can manage group membership requests in the Access Panel to No

1.20Ensure that 'Users can create Microsoft 365 groups in Azure portals, API or PowerShell' is set to 'No'1
Attributes
Profile

Level 2

Section

1 Identity and Access Management

Description

Restrict Microsoft 365 group creation to administrators only.

Default Value

By default, Users can create Microsoft 365 groups in Azure portals, API or PowerShell is set to Yes.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Groups 1. Select General in setting 1. Ensure that Users can create Microsoft 365 groups in Azure portals, API or PowerShell is set to No

Impact Statement

Enabling this setting could create a number of requests that would need to be managed by an administrator.

Assessment Status

Manual

Rationale Statement

Restricting Microsoft 365 group creation to administrators only ensures that creation of Microsoft 365 groups is controlled by the administrator. Appropriate groups should be created and managed by the administrator and group creation rights should not be delegated to any other user.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Then Groups 1. Select General in settings 1. Set Users can create Microsoft 365 groups in Azure portals, API or PowerShell to No

1.21Ensure that 'Require Multi-Factor Authentication to register or join devices with Microsoft Entra ID' is set to 'Yes'0
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

Joining or registering devices to Microsoft Entra ID should require Multi-factor authentication.

Default Value

By default, Require Multi-Factor Authentication to register or join devices with Microsoft Entra is set to No.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Devices 1. Select Device settings 1. Ensure that Require Multi-Factor Authentication to register or join devices with Microsoft Entra is set to Yes

Impact Statement

A slight impact of additional overhead, as Administrators will now have to approve every access to the domain.

Assessment Status

Manual

Rationale Statement

Multi-factor authentication is recommended when adding devices to Microsoft Entra ID. When set to Yes, users who are adding devices from the internet must first use the second method of authentication before their device is successfully added to the directory. This ensures that rogue devices are not added to the domain using a compromised user account. Note: Some Microsoft documentation suggests to use conditional access policies for joining a domain from certain whitelisted networks or devices. Even with these in place, using Multi-Factor Authentication is still recommended, as it creates a process for review before joining the domain.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Entra ID 1. Select Devices 1. Select Device settings 1. Set Require Multi-Factor Authentication to register or join devices with Microsoft Entra to Yes

1.22Ensure That No Custom Subscription Administrator Roles Exist1
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

The principle of least privilege should be followed and only necessary privileges should be assigned instead of allowing full administrative access.

Default Value

By default, no custom owner roles are created.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu. 1. Select Subscriptions. 1. Select Access control (IAM). 1. Select Roles. 1. Click Type and select CustomRole from the drop down menu. 1. Select View next to a role. 1. Select JSON. 1. Check for assignableScopes set to the subscription, and actions set to *. 1. Repeat steps 6-8 for each custom role. From Azure CLI List custom roles: az role definition list --custom-role-only True Check for entries with assignableScope of the subscription, and an action of * From PowerShell Connect-AzAccount Get-AzRoleDefinition |Where-Object {($_.IsCustom -eq $true) -and ($_.Actions.contains('*'))} Check the output for AssignableScopes value set to the subscription. 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: a451c1ef-c6ca-483d-87ed-f49761e3ffb5 - Name: 'Audit usage of custom RBAC roles'

Impact Statement

Subscriptions will need to be handled by Administrators with permissions.

Assessment Status

Automated

Rationale Statement

Classic subscription admin roles offer basic access management and include Account Administrator, Service Administrator, and Co-Administrators. It is recommended the least necessary permissions be given initially. Permissions can be added as needed by the account holder. This ensures the account holder cannot perform actions which were not intended.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu. 1. Select Subscriptions. 1. Select Access control (IAM). 1. Select Roles. 1. Click Type and select CustomRole from the drop down menu. 1. Check the box next to each role which grants subscription administrator privileges. 1. Select Remove. 1. Select Yes. From Azure CLI List custom roles: az role definition list --custom-role-only True Check for entries with assignableScope of the subscription, and an action of *. To remove a violating role: az role definition delete --name <role name> Note that any role assignments must be removed before a custom role can be deleted. Ensure impact is assessed before deleting a custom role granting subscription administrator privileges.

1.23Ensure a Custom Role is Assigned Permissions for Administering Resource Locks1
Attributes
Profile

Level 2

Section

1 Identity and Access Management

Description

Resource locking is a powerful protection mechanism that can prevent inadvertent modification/deletion of resources within Azure subscriptions/Resource Groups and is a recommended NIST configuration.

Audit Procedure

From Azure Portal 1. In the Azure portal, open a subscription or resource group where you want to view assigned roles. 2. Select Access control (IAM) 3. Select Roles 4. Search for the custom role named <role_name> Ex. from remediation Resource Lock Administrator 5. Ensure that the role is assigned to the appropriate users.

Impact Statement

By adding this role, specific permissions may be granted for managing just resource locks rather than needing to provide the wide Owner or User Access Administrator role, reducing the risk of the user being able to do unintentional damage.

Assessment Status

Manual

Rationale Statement

Given the resource lock functionality is outside of standard Role Based Access Control(RBAC), it would be prudent to create a resource lock administrator role to prevent inadvertent unlocking of resources.

Remediation Procedure

From Azure Portal 1. In the Azure portal, open a subscription or resource group where you want the custom role to be assigned. 2. Select Access control (IAM). 3. Click Add. 4. Select Add custom role. 5. In the Custom Role Name field enter Resource Lock Administrator. 6. In the Description field enter Can Administer Resource Locks. 7. For Baseline permissions select Start from scratch 8. Select next. 9. In the Permissions tab select Add permissions. 10. In the Search for a permission box, type in Microsoft.Authorization/locks to search for permissions. 11. Select the check box next to the permission Microsoft.Authorization/locks. 12. Select Add. 13. Select Review + create. 14. Select Create. 15. Assign the newly created role to the appropriate user. From PowerShell: Below is a power shell definition for a resource lock administrator role created at an Azure Management group level Import-Module Az.Accounts Connect-AzAccount $role = Get-AzRoleDefinition User Access Administrator $role.Id = $null $role.Name = Resource Lock Administrator $role.Description = Can Administer Resource Locks $role.Actions.Clear() $role.Actions.Add(Microsoft.Authorization/locks/*) $role.AssignableScopes.Clear() * Scope at the Management group level Management group $role.AssignableScopes.Add(/providers/Microsoft.Management/managementGroups/MG-Name) New-AzRoleDefinition -Role $role Get-AzureRmRoleDefinition Resource Lock Administrator

1.24Ensure That `Subscription leaving Microsoft Entra ID directory` and `Subscription entering Microsoft Entra ID directory` Is Set To ‘Permit No One’0
Attributes
Profile

Level 2

Section

1 Identity and Access Management

Description

Users who are set as subscription owners are able to make administrative changes to the subscriptions and move them into and out of Microsoft Entra ID.

Default Value

By default Subscription leaving Microsoft Entra ID directory and Subscription entering Microsoft Entra ID directory are set to Allow everyone (default)

Audit Procedure

From Azure Portal 1. From the Azure Portal Home select the portal menu 1. Select Subscriptions 1. In the Advanced options drop-down menu, select Manage Policies 1. Ensure Subscription leaving Microsoft Entra ID directory and Subscription entering Microsoft Entra ID directory are set to Permit no one

Impact Statement

Subscriptions will need to have these settings turned off to be moved.

Assessment Status

Manual

Rationale Statement

Permissions to move subscriptions in and out of Microsoft Entra ID directory must only be given to appropriate administrative personnel. A subscription that is moved into an Microsoft Entra ID directory may be within a folder to which other users have elevated permissions. This prevents loss of data or unapproved changes of the objects within by potential bad actors.

Remediation Procedure

From Azure Portal 1. From the Azure Portal Home select the portal menu 1. Select Subscriptions 1. In the Advanced options drop-down menu, select Manage Policies 1. Under Subscription leaving Microsoft Entra ID directory and Subscription entering Microsoft Entra ID directory select Permit no one

1.25Ensure fewer than 5 users have global administrator assignment1
Attributes
Profile

Level 1

Section

1 Identity and Access Management

Description

This recommendation aims to maintain a balance between security and operational efficiency by ensuring that a minimum of 2 and a maximum of 4 users are assigned the Global Administrator role in Microsoft Entra ID. Having at least two Global Administrators ensures redundancy, while limiting the number to four reduces the risk of excessive privileged access.

Audit Procedure
  1. From Azure Home select the Portal Menu 2. Select Microsoft Entra ID 3. Select Roles and Administrators 4. Select Global Administrator 5. Ensure less than 5 users are actively assigned the role. 6. Ensure that at least 2 users are actively assigned the role.
Impact Statement

Implementing this recommendation may require changes in administrative workflows or the redistribution of roles and responsibilities. Adequate training and awareness should be provided to all Global Administrators.

Assessment Status

Manual

Rationale Statement

The Global Administrator role has extensive privileges across all services in Microsoft Entra ID. The Global Administrator role should never be used in regular daily activities; administrators should have a regular user account for daily activities, and a separate account for administrative responsibilities. Limiting the number of Global Administrators helps mitigate the risk of unauthorized access, reduces the potential impact of human error, and aligns with the principle of least privilege to reduce the attack surface of an Azure tenant. Conversely, having at least two Global Administrators ensures that administrative functions can be performed without interruption in case of unavailability of a single admin.

Remediation Procedure

If more 4 users are assigned: 1. Remove Global Administrator role for users which do not or no longer require the role. 2. Assign Global Administrator role via PIM which can be activated when required. 3. Assign more granular roles to users to conduct their duties. If only one user is assigned: 1. Provide the Global Administrator role to a trusted user or create a break glass admin account.

2 Microsoft Defender2321
2.1.1Ensure That Microsoft Defender for Servers Is Set to 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Turning on Microsoft Defender for Servers enables threat detection for Servers, providing threat intelligence, anomaly detection, and behavior analytics in the Microsoft Defender for Cloud.

Default Value

By default, Microsoft Defender plan is off.

Audit Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud 2. Select Environment Settings 3. Click on the subscription name 4. Select Defender plans 5. Ensure Servers Status is set to On. From Azure CLI Run the following command: az security pricing show -n VirtualMachines --query pricingTier If the tenant is licensed and enabled, the output should indicate Standard From PowerShell Run the following command: Get-AzSecurityPricing -Name 'VirtualMachines' |Select-Object Name,PricingTier If the tenant is licensed and enabled, the -PricingTier parameter will indicate Standard 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: 4da35fc9-c9e7-4960-aec9-797fe7d9051d - Name: 'Azure Defender for servers should be enabled'

Impact Statement

Turning on Microsoft Defender for Servers in Microsoft Defender for Cloud incurs an additional cost per resource.

Assessment Status

Automated

Rationale Statement

Enabling Microsoft Defender for Servers allows for greater defense-in-depth, with threat detection provided by the Microsoft Security Response Center (MSRC).

Remediation Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud 2. Select Environment Settings 3. Click on the subscription name 4. Select Defender plans 5. Set Server Status to On 6. Select Save From Azure CLI Run the following command: az security pricing create -n VirtualMachines --tier 'standard' From PowerShell Run the following command: Set-AzSecurityPricing -Name 'VirtualMachines' -PricingTier 'Standard'

2.1.2Ensure That Microsoft Defender for App Services Is Set To 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Turning on Microsoft Defender for App Service enables threat detection for App Service, providing threat intelligence, anomaly detection, and behavior analytics in the Microsoft Defender for Cloud.

Default Value

By default, Microsoft Defender plan is off.

Audit Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud 2. Select Environment Settings 3. Click on the subscription name 4. Select Defender plans 5. Ensure Status is On for App Service From Azure CLI Run the following command: az security pricing show -n AppServices Ensure -PricingTier is set to Standard From PowerShell Run the following command: Get-AzSecurityPricing -Name 'AppServices' |Select-Object Name,PricingTier Ensure the -PricingTier is set to Standard 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: 2913021d-f2fd-4f3d-b958-22354e2bdbcb - Name: 'Azure Defender for App Service should be enabled'

Impact Statement

Turning on Microsoft Defender for App Service incurs an additional cost per resource.

Assessment Status

Automated

Rationale Statement

Enabling Microsoft Defender for App Service allows for greater defense-in-depth, with threat detection provided by the Microsoft Security Response Center (MSRC).

Remediation Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud 2. Select Environment Settings 3. Click on the subscription name 4. Select Defender plans 5. Set App Service Status to On 6. Select Save From Azure CLI Run the following command: az security pricing create -n Appservices --tier 'standard' From PowerShell Run the following command: Set-AzSecurityPricing -Name AppServices -PricingTier Standard

2.1.3Ensure That Microsoft Defender for (Managed Instance) Azure SQL Databases Is Set To 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Turning on Microsoft Defender for Azure SQL Databases enables threat detection for Managed Instance Azure SQL databases, providing threat intelligence, anomaly detection, and behavior analytics in Microsoft Defender for Cloud.

Default Value

By default, Microsoft Defender plan is off.

Audit Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings blade. 3. Click on the subscription name. 4. Select the Defender plans blade. 5. Click Select types > in the row for Databases. 6. Ensure the radio button next to Azure SQL Databases is set to On. From Azure CLI Run the following command: az security pricing show -n SqlServers Ensure -PricingTier is set to Standard From PowerShell Run the following command: Get-AzSecurityPricing -Name 'SqlServers' | Select-Object Name,PricingTier Ensure the -PricingTier is set to Standard 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: 7fe3b40f-802b-4cdd-8bd4-fd799c948cc2 - Name: 'Azure Defender for Azure SQL Database servers should be enabled' - Policy ID: abfb7388-5bf4-4ad7-ba99-2cd2f41cebb9 - Name: 'Azure Defender for SQL should be enabled for unprotected SQL Managed Instances'

Impact Statement

Turning on Microsoft Defender for Azure SQL Databases incurs an additional cost per resource.

Assessment Status

Automated

Rationale Statement

Enabling Microsoft Defender for Azure SQL Databases allows for greater defense-in-depth, includes functionality for discovering and classifying sensitive data, surfacing and mitigating potential database vulnerabilities, and detecting anomalous activities that could indicate a threat to your database.

Remediation Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings blade. 3. Click on the subscription name. 4. Select the Defender plans blade. 5. Click Select types > in the row for Databases. 6. Set the radio button next to Azure SQL Databases to On. 7. Select Continue. 8. Select Save. From Azure CLI Run the following command: az security pricing create -n SqlServers --tier 'standard' From PowerShell Run the following command: Set-AzSecurityPricing -Name 'SqlServers' -PricingTier 'Standard'

2.1.4Ensure That Microsoft Defender for SQL Servers on Machines Is Set To 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Turning on Microsoft Defender for SQL servers on machines enables threat detection for SQL servers on machines, providing threat intelligence, anomaly detection, and behavior analytics in Microsoft Defender for Cloud.

Default Value

By default, Microsoft Defender plan is off.

Audit Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings blade. 3. Click on the subscription name. 4. Select the Defender plans blade. 5. Click Select types > in the row for Databases. 6. Ensure the radio button next to SQL servers on machines is set to On. From Azure CLI Ensure Defender for SQL is licensed with the following command: az security pricing show -n SqlServerVirtualMachines Ensure the 'PricingTier' is set to 'Standard' From PowerShell Run the following command: Get-AzSecurityPricing -Name 'SqlServerVirtualMachines' | Select-Object Name,PricingTier Ensure the 'PricingTier' is set to 'Standard' 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: 6581d072-105e-4418-827f-bd446d56421b - Name: 'Azure Defender for SQL servers on machines should be enabled' - Policy ID: abfb4388-5bf4-4ad7-ba82-2cd2f41ceae9 - Name: 'Azure Defender for SQL should be enabled for unprotected Azure SQL servers'

Impact Statement

Turning on Microsoft Defender for SQL servers on machines incurs an additional cost per resource.

Assessment Status

Automated

Rationale Statement

Enabling Microsoft Defender for SQL servers on machines allows for greater defense-in-depth, functionality for discovering and classifying sensitive data, surfacing and mitigating potential database vulnerabilities, and detecting anomalous activities that could indicate a threat to your database.

Remediation Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings blade. 3. Click on the subscription name. 4. Select the Defender plans blade. 5. Click Select types > in the row for Databases. 6. Set the radio button next to SQL servers on machines to On. 7. Select Continue. 8. Select Save. From Azure CLI Run the following command: az security pricing create -n SqlServerVirtualMachines --tier 'standard' From PowerShell Run the following command: Set-AzSecurityPricing -Name 'SqlServerVirtualMachines' -PricingTier 'Standard'

2.1.5Ensure That Microsoft Defender for Open-Source Relational Databases Is Set To 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Turning on Microsoft Defender for Open-source relational databases enables threat detection for Open-source relational databases, providing threat intelligence, anomaly detection, and behavior analytics in the Microsoft Defender for Cloud.

Default Value

By default, Microsoft Defender plan is off.

Audit Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 1. Select Environment Settings blade. 1. Click on the subscription name. 1. Select the Defender plans blade. 1. Click Select types > in the row for Databases. 1. Ensure the radio button next to Open-source relational databases is set to On. From Azure CLI Run the following command: az security pricing show -n OpenSourceRelationalDatabases --query pricingTier From PowerShell Get-AzSecurityPricing | Where-Object {$_.Name -eq 'OpenSourceRelationalDatabases'} | Select-Object Name, PricingTier Ensure output for Name PricingTier is OpenSourceRelationalDatabases Standard 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: 0a9fbe0d-c5c4-4da8-87d8-f4fd77338835 - Name: 'Azure Defender for open-source relational databases should be enabled'

Impact Statement

Turning on Microsoft Defender for Open-source relational databases incurs an additional cost per resource.

Assessment Status

Automated

Rationale Statement

Enabling Microsoft Defender for Open-source relational databases allows for greater defense-in-depth, with threat detection provided by the Microsoft Security Response Center (MSRC).

Remediation Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings blade. 3. Click on the subscription name. 4. Select the Defender plans blade. 5. Click Select types > in the row for Databases. 6. Set the radio button next to Open-source relational databases to On. 7. Select Continue. 8. Select Save. From Azure CLI Run the following command: az security pricing create -n 'OpenSourceRelationalDatabases' --tier 'standard' From PowerShell Use the below command to enable Standard pricing tier for Open-source relational databases set-azsecuritypricing -name OpenSourceRelationalDatabases -pricingtier Standard

2.1.6Ensure That Microsoft Defender for Azure Cosmos DB Is Set To 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Microsoft Defender for Azure Cosmos DB scans all incoming network requests for threats to your Azure Cosmos DB resources.

Default Value

By default, Microsoft Defender for Azure Cosmos DB is not enabled.

Audit Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud 2. Select Environment Settings blade 3. Click on the subscription name 4. Select the Defender plans blade 5. On the Database row click on Select types > 6. Ensure the radio button next to Azure Cosmos DB is set to On. From Azure CLI Ensure the output of the below command is Standard az security pricing show -n CosmosDbs --query pricingTier From PowerShell Get-AzSecurityPricing -Name 'CosmosDbs' | Select-Object Name,PricingTier Ensure output of -PricingTier is Standard 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: adbe85b5-83e6-4350-ab58-bf3a4f736e5e - Name: 'Microsoft Defender for Azure Cosmos DB should be enabled'

Impact Statement

Enabling Microsoft Defender for Azure Cosmos DB requires enabling Microsoft Defender for your subscription. Both will incur additional charges.

Assessment Status

Automated

Rationale Statement

In scanning Azure Cosmos DB requests within a subscription, requests are compared to a heuristic list of potential security threats. These threats could be a result of a security breach within your services, thus scanning for them could prevent a potential security threat from being introduced.

Remediation Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings blade. 3. Click on the subscription name. 4. Select the Defender plans blade. 5. On the Database row click on Select types >. 6. Set the radio button next to Azure Cosmos DB to On. 7. Click Continue. 8. Click Save. From Azure CLI Run the following command: az security pricing create -n 'CosmosDbs' --tier 'standard' From PowerShell Use the below command to enable Standard pricing tier for Azure Cosmos DB Set-AzSecurityPricing -Name 'CosmosDbs' -PricingTier 'Standard

2.1.7Ensure That Microsoft Defender for Storage Is Set To 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Turning on Microsoft Defender for Storage enables threat detection for Storage, providing threat intelligence, anomaly detection, and behavior analytics in the Microsoft Defender for Cloud.

Default Value

By default, Microsoft Defender plan is off.

Audit Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings blade. 3. Click on the subscription name. 4. Select the Defender plans blade. 5. Ensure Status is set to On for Storage. From Azure CLI Ensure the output of the below command is Standard az security pricing show -n StorageAccounts From PowerShell Get-AzSecurityPricing -Name 'StorageAccounts' | Select-Object Name,PricingTier Ensure output for Name PricingTier is StorageAccounts Standard 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: 308fbb08-4ab8-4e67-9b29-592e93fb94fa - Name: 'Microsoft Defender for Storage (Classic) should be enabled'

Impact Statement

Turning on Microsoft Defender for Storage incurs an additional cost per resource.

Assessment Status

Automated

Rationale Statement

Enabling Microsoft Defender for Storage allows for greater defense-in-depth, with threat detection provided by the Microsoft Security Response Center (MSRC).

Remediation Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings blade. 3. Click on the subscription name. 4. Select the Defender plans blade. 5. Set Status to On for Storage. 6. Select Save. From Azure CLI Ensure the output of the below command is Standard az security pricing create -n StorageAccounts --tier 'standard' From PowerShell Set-AzSecurityPricing -Name 'StorageAccounts' -PricingTier 'Standard'

2.1.8Ensure That Microsoft Defender for Containers Is Set To 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Turning on Microsoft Defender for Containers enables threat detection for Container Registries including Kubernetes, providing threat intelligence, anomaly detection, and behavior analytics in the Microsoft Defender for Cloud. The following services will be enabled for container instances: - Defender agent in Azure - Azure Policy for Kubernetes - Agentless discovery for Kubernetes - Agentless container vulnerability assessment

Default Value

By default, Microsoft Defender for Containers is off.

Audit Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings. 3. Click on the subscription name. 4. Select Defender plans. 5. Ensure On is set under Status for Containers. From Azure CLI Ensure the output of the commands below indicates Standard pricing. For legacy Defender for Container Registries instances: az security pricing show --name ContainerRegistry --query pricingTier For new Defender for Containers instances: az security pricing show --name Containers --query pricingTier From PowerShell Ensure the output of the commands below indicates Standard pricing. For legacy Defender for Container Registries instances: Get-AzSecurityPricing -Name 'ContainerRegistry' | Select-Object Name,PricingTier For new Defender for Containers instances: Get-AzSecurityPricing -Name 'Containers' | Select-Object Name,PricingTier 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: 1c988dd6-ade4-430f-a608-2a3e5b0a6d38 - Name: 'Microsoft Defender for Containers should be enabled'

Impact Statement

Turning on Microsoft Defender for Containers incurs an additional cost per resource.

Assessment Status

Automated

Rationale Statement

Enabling Microsoft Defender for Container Registries allows for greater defense-in-depth, with threat detection provided by the Microsoft Security Response Center (MSRC).

Remediation Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings. 3. Click on the subscription name. 4. Select Defender plans. 5. Set Status to On for Containers. 6. Click Save. From Azure CLI (Note: 'ContainerRegistry' has been deprecated and is replaced by 'Containers') Use the below command to enable Standard pricing tier for Containers. az security pricing create -n 'Containers' --tier 'standard' From PowerShell (Note: 'ContainerRegistry' has been deprecated and is replaced by 'Containers') Use the below command to enable Standard pricing tier for Containers. Set-AzSecurityPricing -Name 'Containers' -PricingTier 'Standard'

Additional Information

Deprecation of previous product plans 'Container registries' and 'Kubernetes' plans for Microsoft Defender are being deprecated and replaced with 'Containers' or Microsoft Defender for Containers.

2.1.9Ensure That Microsoft Defender for Key Vault Is Set To 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Turning on Microsoft Defender for Key Vault enables threat detection for Key Vault, providing threat intelligence, anomaly detection, and behavior analytics in the Microsoft Defender for Cloud.

Default Value

By default, Microsoft Defender plan is off.

Audit Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud 2. Select Environment Settings blade 3. Click on the subscription name 4. Select the Defender plans blade 5. Ensure Status is set to On for Key Vault. From Azure CLI Ensure the output of the below command is Standard az security pricing show -n 'KeyVaults' --query 'PricingTier' From PowerShell Get-AzSecurityPricing -Name 'KeyVaults' | Select-Object Name,PricingTier Ensure output for PricingTier is Standard 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: 0e6763cc-5078-4e64-889d-ff4d9a839047 - Name: 'Azure Defender for Key Vault should be enabled'

Impact Statement

Turning on Microsoft Defender for Key Vault incurs an additional cost per resource.

Assessment Status

Automated

Rationale Statement

Enabling Microsoft Defender for Key Vault allows for greater defense-in-depth, with threat detection provided by the Microsoft Security Response Center (MSRC).

Remediation Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud 2. Select Environment Settings blade 3. Click on the subscription name 4. Select the Defender plans blade 5. Select On under Status for Key Vault. 6. Select Save. From Azure CLI Enable Standard pricing tier for Key Vault: az security pricing create -n 'KeyVaults' --tier 'Standard' From PowerShell Enable Standard pricing tier for Key Vault: Set-AzSecurityPricing -Name 'KeyVaults' -PricingTier 'Standard'

2.1.10[LEGACY] Ensure That Microsoft Defender for DNS Is Set To 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

[NOTE: As of August 1, customers with an existing subscription to Defender for DNS can continue to use the service, but new subscribers will receive alerts about suspicious DNS activity as part of Defender for Servers P2.] Microsoft Defender for DNS scans all network traffic exiting from within a subscription.

Default Value

By default, Microsoft Defender for DNS is not enabled.

Audit Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud 2. Select Environment Settings blade 3. Click on the subscription name 4. Select the Defender plans blade 5. Ensure Status is set to On for DNS. From Azure CLI Ensure the output of the below command is Standard az security pricing show -n 'DNS' --query 'PricingTier' From PowerShell Get-AzSecurityPricing --Name 'DNS' | Select-Object Name,PricingTier Ensure output of PricingTier is Standard 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: bdc59948-5574-49b3-bb91-76b7c986428d - Name: 'Azure Defender for DNS should be enabled'

Impact Statement

Enabling Microsoft Defender for DNS requires enabling Microsoft Defender for your subscription. Both will incur additional charges, with Defender for DNS being a small amount per million queries.

Assessment Status

Automated

Rationale Statement

DNS lookups within a subscription are scanned and compared to a dynamic list of websites that might be potential security threats. These threats could be a result of a security breach within your services, thus scanning for them could prevent a potential security threat from being introduced.

Remediation Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings blade. 3. Click on the subscription name. 4. Select the Defender plans blade. 5. Select On under Status for DNS. 6. Select Save. From Powershell Enable Standard pricing tier for DNS: az security pricing create -n 'DNS' --tier 'Standard' From PowerShell Enable Standard pricing tier for DNS: Set-AzSecurityPricing -Name 'DNS' -PricingTier 'Standard'

2.1.11Ensure That Microsoft Defender for Resource Manager Is Set To 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Microsoft Defender for Resource Manager scans incoming administrative requests to change your infrastructure from both CLI and the Azure portal.

Default Value

By default, Microsoft Defender for Resource Manager is not enabled.

Audit Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud 2. Select Environment Settings blade 3. Click on the subscription name 4. Select the Defender plans blade 5. Ensure Status is set to On for Resource Manager. From Azure CLI Ensure the output of the below command is Standard az security pricing show -n 'Arm' --query 'PricingTier' From Azure PowerShell Get-AzSecurityPricing -Name 'Arm' | Select-Object Name,PricingTier Ensure the output of PricingTier is Standard 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: c3d20c29-b36d-48fe-808b-99a87530ad99 - Name: 'Azure Defender for Resource Manager should be enabled'

Impact Statement

Enabling Microsoft Defender for Resource Manager requires enabling Microsoft Defender for your subscription. Both will incur additional charges.

Assessment Status

Automated

Rationale Statement

Scanning resource requests lets you be alerted every time there is suspicious activity in order to prevent a security threat from being introduced.

Remediation Procedure

From Azure Portal 1. Go to Microsoft Defender for Cloud. 2. Select Environment Settings blade. 3. Click on the subscription name. 4. Select the Defender plans blade. 5. Select On under Status for Resource Manager. 6. Select `Save. From Azure CLI Use the below command to enable Standard pricing tier for Defender for Resource Manager az security pricing create -n 'Arm' --tier 'Standard' From PowerShell Use the below command to enable Standard pricing tier for Defender for Resource Manager Set-AzSecurityPricing -Name 'Arm' -PricingTier 'Standard'

2.1.12Ensure that Microsoft Defender Recommendation for 'Apply system updates' status is 'Completed'1
Attributes
Profile

Level 1

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Ensure that the latest OS patches for all virtual machines are applied.

Default Value

By default, patches are not automatically deployed.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Then the Recommendations blade 1. Ensure that there are no recommendations for Apply system updates Alternatively, you can employ your own patch assessment and management tool to periodically assess, report and install the required security patches for your OS. 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: bd876905-5b84-4f73-ab2d-2e7a7c4568d9 - Name: '[Preview]: Machines should be configured to periodically check for missing system updates'

Impact Statement

Running Microsoft Defender for Cloud incurs additional charges for each resource monitored. Please see attached reference for exact charges per hour.

Assessment Status

Automated

Rationale Statement

Windows and Linux virtual machines should be kept updated to: - Address a specific bug or flaw - Improve an OS or application’s general stability - Fix a security vulnerability Microsoft Defender for Cloud retrieves a list of available security and critical updates from Windows Update or Windows Server Update Services (WSUS), depending on which service is configured on a Windows VM. The security center also checks for the latest updates in Linux systems. If a VM is missing a system update, the security center will recommend system updates be applied.

Remediation Procedure

Follow Microsoft Azure documentation to apply security patches from the security center. Alternatively, you can employ your own patch assessment and management tool to periodically assess, report, and install the required security patches for your OS.

2.1.13Ensure that Microsoft Cloud Security Benchmark policies are not set to 'Disabled'1
Attributes
Profile

Level 1

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

The Microsoft Cloud Security Benchmark (or MCSB) is an Azure Policy Initiative containing many security policies to evaluate resource configuration against best practice recommendations. If a policy in the MCSB is set with effect type Disabled, it is not evaluated and may prevent administrators from being informed of valuable security recommendations.

Default Value

By default, the MCSB policy initiative is associated to all subscriptions and most policies will have an effect of Audit. Some policies will have a default effect of Disabled.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Then Environment Settings 1. Select the appropriate Subscription 1. Click on Security Policy in the left column. 1. Click on Microsoft Cloud Security Benchmark 1. Click Add Filter and select Effect 1. Check the Disabled box to search for all disabled policies 1. Click Apply If no Policies are shown, no Policies are in Disabled status and no remediation is necessary. If any Policies remain in the list, the policy Effect should be changed to Audit.

Impact Statement

Policies within the MCSB default to an effect of Audit and will evaluate - but not enforce - policy recommendations. Ensuring these policies are set to Audit simply ensures that the evaluation occurs to allow administrators to understand where an improvement may be possible. Administrators will need to determine if the recommendations are relevant and desirable for their environment, then manually take action to resolve the status if desired.

Assessment Status

Manual

Rationale Statement

A security policy defines the desired configuration of resources in your environment and helps ensure compliance with company or regulatory security requirements. The MCSB Policy Initiative a set of security recommendations based on best practices and is associated with every subscription by default. When a policy Effect is set to Audit, policies in the MCSB ensure that Defender for Cloud evaluates relevant resources for supported recommendations. To ensure that policies within the MCSB are not being missed when the Policy Initiative is evaluated, none of the policies should have an Effect of Disabled.

Remediation Procedure

From Azure Portal Part A - List all disabled policies 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Then Environment Settings 1. Select the appropriate Subscription 1. Click on Security Policy in the left column. 1. Click on Microsoft Cloud Security Benchmark 1. Click Add Filter and select Effect 1. Check the Disabled box to search for all disabled policies 1. Click Apply Part B - Remediate Policy Effect For each policy that remains in the list: 1. Click the blue ellipses ... to the right of the policy name 1. Click Manage effect and parameters 1. Under Policy Effect, select the Audit radio button 1. Click Save 1. Click Refresh Repeat Part B - Remediate Policy Effect until no more policies are listed.

2.1.14Ensure that Auto provisioning of 'Log Analytics agent for Azure VMs' is Set to 'On'1
Attributes
Profile

Level 1

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Enable automatic provisioning of the monitoring agent to collect security data.

Default Value

By default, Automatic provisioning of monitoring agent is set to On.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Then Environment Settings 1. Select a subscription 1. Click on Settings & Monitoring 1. Ensure that Log Analytics agent/Azure Monitor agent is set to On Repeat the above for any additional subscriptions. From Azure CLI Ensure the output of the below command is On az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X GET -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/<subscriptionID>/providers/Microsoft.Security/autoProvisioningSettings?api-version=2017-08-01-preview' | jq '.|.value[] | select(.name==default)'|jq '.properties.autoProvision' Using PowerShell Connect-AzAccount Get-AzSecurityAutoProvisioningSetting | Select-Object Name, AutoProvision Ensure output for Id Name AutoProvision is /subscriptions//providers/Microsoft.Security/autoProvisioningSettings/default default On 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: 475aae12-b88a-4572-8b36-9b712b2b3a17 - Name: 'Auto provisioning of the Log Analytics agent should be enabled on your subscription'

Assessment Status

Automated

Rationale Statement

When Log Analytics agent for Azure VMs is turned on, Microsoft Defender for Cloud provisions the Microsoft Monitoring Agent on all existing supported Azure virtual machines and any new ones that are created. The Microsoft Monitoring Agent scans for various security-related configurations and events such as system updates, OS vulnerabilities, endpoint protection, and provides alerts.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Select Environment Settings 1. Select a subscription 1. Click on Settings & Monitoring 1. Ensure that Log Analytics agent for Azure VMs is set to On Repeat the above for any additional subscriptions. From Azure CLI Use the below command to set Automatic provisioning of monitoring agent to On. az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X PUT -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/subscriptionID/providers/Microsoft.Security/autoProvisioningSettings/default?api-version=2017-08-01-preview -d@input.json' Where input.json contains the Request body json data as mentioned below. { id: /subscriptions/<Your_Subscription_Id>/providers/Microsoft.Security/autoProvisioningSettings/default, name: default, type: Microsoft.Security/autoProvisioningSettings, properties: { autoProvision: On } }

Additional Information
  • Excluding any of the entries in input.json may disable the specific setting by default - Microsoft has recently changed APIs to get and Update Automatic Provisioning Setting. This recommendation is updated accordingly.
2.1.15Ensure that Auto provisioning of 'Vulnerability assessment for machines' is Set to 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Enable automatic provisioning of vulnerability assessment for machines on both Azure and hybrid (Arc enabled) machines.

Default Value

By default, Automatic provisioning of monitoring agent is set to Off.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Then Environment Settings 1. Select a subscription 1. Click on Settings & Monitoring 1. Ensure that Vulnerability assessment for machines is set to On Repeat the above for any additional subscriptions.

Impact Statement

Additional licensing is required and configuration of Azure Arc introduces complexity beyond this recommendation.

Assessment Status

Manual

Rationale Statement

Vulnerability assessment for machines scans for various security-related configurations and events such as system updates, OS vulnerabilities, and endpoint protection, then produces alerts on threat and vulnerability findings.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Then Environment Settings 1. Select a subscription 1. Click on Settings & Monitoring 1. Ensure that Vulnerability assessment for machines is set to On Repeat the above for any additional subscriptions.

Additional Information

While this feature is generally available as of publication, it is not yet available for Azure Government tenants.

2.1.16Ensure that Auto provisioning of 'Microsoft Defender for Containers components' is Set to 'On'0
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Enable automatic provisioning of the Microsoft Defender for Containers components.

Default Value

By default, Microsoft Defender for Containers is disabled. If Defender for Containers is enabled from the Microsoft Defender for Cloud portal, auto provisioning will be enabled.

Audit Procedure

From Azure Portal 1. From the Azure Portal Home page, select Microsoft Defender for Cloud 1. Under Management select Environment Settings 1. Select a subscription 1. Ensure that Containers is set to On Repeat the above for any additional subscriptions. 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: 1c988dd6-ade4-430f-a608-2a3e5b0a6d38 - Name: 'Microsoft Defender for Containers should be enabled'

Impact Statement

Microsoft Defender for Containers will require additional licensing.

Assessment Status

Automated

Rationale Statement

As with any compute resource, Container environments require hardening and run-time protection to ensure safe operations and detection of threats and vulnerabilities.

Remediation Procedure

From Azure Portal 1. From the Azure Portal Home page, select Microsoft Defender for Cloud 1. Under Management, select Environment Settings 1. Select a subscription 1. Set Containers to On

2.1.17Ensure That 'All users with the following roles' is set to 'Owner'1
Attributes
Profile

Level 1

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Enable security alert emails to subscription owners.

Default Value

By default, Owner is selected

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Then Environment Settings 1. Click on the appropriate Management Group, Subscription, or Workspace 1. Click on Email notifications 1. Ensure that All users with the following roles is set to Owner From Azure CLI Ensure the command below returns state of On and that Owner appears in roles. az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X GET -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/$0/providers/Microsoft.Security/securityContacts?api-version=2020-01-01-preview'| jq '.[] | select(.name==default).properties.notificationsByRole'

Assessment Status

Automated

Rationale Statement

Enabling security alert emails to subscription owners ensures that they receive security alert emails from Microsoft. This ensures that they are aware of any potential security issues and can mitigate the risk in a timely fashion.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Click on Environment Settings 1. Click on the appropriate Management Group, Subscription, or Workspace 1. Click on Email notifications 1. In the drop down of the All users with the following roles field select Owner 1. Click Save From Azure CLI Use the below command to set Send email also to subscription owners to On. az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X PUT -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/$0/providers/Microsoft.Security/securityContacts/default1?api-version=2017-08-01-preview -d@input.json' Where input.json contains the data below, replacing validEmailAddress with a single email address or multiple comma-separated email addresses: { id: /subscriptions/<Your_Subscription_Id>/providers/Microsoft.Security/securityContacts/default1, name: default1, type: Microsoft.Security/securityContacts, properties: { email: <validEmailAddress>, alertNotifications: On, alertsToAdmins: On, notificationsByRole: Owner } }

Additional Information

Excluding any entries in the input.json properties block disables the specific setting by default.

2.1.18Ensure 'Additional email addresses' is Configured with a Security Contact Email1
Attributes
Profile

Level 1

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Microsoft Defender for Cloud emails the subscription owners whenever a high-severity alert is triggered for their subscription. You should provide a security contact email address as an additional email address.

Default Value

By default, there are no additional email addresses entered.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu. 1. Select Microsoft Defender for Cloud 1. Click on Environment Settings 1. Click on the appropriate Management Group, Subscription, or Workspace 1. Click on Email notifications 1. Ensure that a valid security contact email address is listed in the Additional email addresses field From Azure CLI Ensure the output of the below command is set not empty and is set with appropriate email ids. az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X GET -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/$0/providers/Microsoft.Security/securityContacts?api-version=2020-01-01-preview' | jq '.|.[] | select(.name==default)'|jq '.properties.emails' 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: 4f4f78b8-e367-4b10-a341-d9a4ad5cf1c7 - Name: 'Subscriptions should have a contact email address for security issues'

Assessment Status

Automated

Rationale Statement

Microsoft Defender for Cloud emails the Subscription Owner to notify them about security alerts. Adding your Security Contact's email address to the 'Additional email addresses' field ensures that your organization's Security Team is included in these alerts. This ensures that the proper people are aware of any potential compromise in order to mitigate the risk in a timely fashion.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Click on Environment Settings 1. Click on the appropriate Management Group, Subscription, or Workspace 1. Click on Email notifications 1. Enter a valid security contact email address (or multiple addresses separated by commas) in the Additional email addresses field 1. Click Save From Azure CLI Use the below command to set Security contact emails to On. az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X PUT -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/$0/providers/Microsoft.Security/securityContacts/default?api-version=2020-01-01-preview -d@input.json' Where input.json contains the data below, replacing validEmailAddress with a single email address or multiple comma-separated email addresses: { id: /subscriptions/<Your_Subscription_Id>/providers/Microsoft.Security/securityContacts/default, name: default, type: Microsoft.Security/securityContacts, properties: { email: <validEmailAddress>, alertNotifications: On, alertsToAdmins: On } }

Additional Information

Excluding any entries in the input.json properties block disables the specific setting by default.

2.1.19Ensure That 'Notify about alerts with the following severity' is Set to 'High'1
Attributes
Profile

Level 1

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

Enables emailing security alerts to the subscription owner or other designated security contact.

Default Value

By default, Notify about alerts with the following severity (or higher): is set to High.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Click on Environment Settings 1. Click on the appropriate Management Group, Subscription, or Workspace 1. Click on Email notifications 1. Ensure that the Notify about alerts with the following severity (or higher): setting is checked and set to High From Azure CLI Ensure the output of below command is set to true, enter your Subscription ID at the $0 between /subscriptions/<$0>/providers. az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X GET -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/$0/providers/Microsoft.Security/securityContacts?api-version=2020-01-01-preview' | jq '.|.[] | select(.name==default)'|jq '.properties.alertNotifications' 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: 6e2593d9-add6-4083-9c9b-4b7d2188c899 - Name: 'Email notification for high severity alerts should be enabled'

Assessment Status

Automated

Rationale Statement

Enabling security alert emails ensures that security alert emails are received from Microsoft. This ensures that the right people are aware of any potential security issues and are able to mitigate the risk.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Click on Environment Settings 1. Click on the appropriate Management Group, Subscription, or Workspace 1. Click on Email notifications 1. Under Notification types, check the check box next to Notify about alerts with the following severity (or higher): and select High from the drop down menu 1. Click Save From Azure CLI Use the below command to set Send email notification for high severity alerts to On. az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X PUT -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/<$0>/providers/Microsoft.Security/securityContacts/default1?api-version=2017-08-01-preview -d@input.json' Where input.json contains the data below, replacing validEmailAddress with a single email address or multiple comma-separated email addresses: { id: /subscriptions/<Your_Subscription_Id>/providers/Microsoft.Security/securityContacts/default1, name: default1, type: Microsoft.Security/securityContacts, properties: { email: <validEmailAddress>, alertNotifications: On, alertsToAdmins: On } }

Additional Information

Excluding any entries in the input.json properties block disables the specific setting by default. This recommendation has been updated to reflect recent changes to Microsoft REST APIs for getting and updating security contact information.

2.1.20Ensure that Microsoft Defender for Cloud Apps integration with Microsoft Defender for Cloud is Selected1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

This integration setting enables Microsoft Defender for Cloud Apps (formerly 'Microsoft Cloud App Security' or 'MCAS' - see additional info) to communicate with Microsoft Defender for Cloud.

Default Value

With Cloud App Security license, these alerts are enabled by default.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Select Environment Settings blade 1. Click on the subscription name 1. Select the Integrations blade 1. Ensure setting Allow Microsoft Defender for Cloud Apps to access my data is selected. From Azure CLI Ensure the output of the below command is True az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X GET -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/<subscription_ID>/providers/Microsoft.Security/settings?api-version=2021-06-01' | jq '.|.value[] | select(.name==MCAS)'|jq '.properties.enabled' From PowerShell Run the following series of commands to audit this configuration Get-AzAccount Set-AzContext -Subscription <subscription ID> Get-AzSecuritySetting | Select-Object name,enabled |where-object {$_.name -eq MCAS} PowerShell Output - Non-Compliant Name Enabled ---- ------- MCAS False PowerShell Output - Compliant Name Enabled ---- ------- MCAS True

Impact Statement

Microsoft Defender for Cloud Apps works with Standard pricing tier Subscription. Choosing the Standard pricing tier of Microsoft Defender for Cloud incurs an additional cost per resource.

Assessment Status

Manual

Rationale Statement

Microsoft Defender for Cloud offers an additional layer of protection by using Azure Resource Manager events, which is considered to be the control plane for Azure. By analyzing the Azure Resource Manager records, Microsoft Defender for Cloud detects unusual or potentially harmful operations in the Azure subscription environment. Several of the preceding analytics are powered by Microsoft Defender for Cloud Apps. To benefit from these analytics, subscription must have a Cloud App Security license. Microsoft Defender for Cloud Apps works only with Standard Tier subscriptions.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu. 1. Select Microsoft Defender for Cloud. 1. Select Environment Settings blade. 1. Select the subscription. 1. Select Integrations. 1. Check Allow Microsoft Defender for Cloud Apps to access my data. 1. Select Save. From Azure CLI Use the below command to enable Standard pricing tier for Storage Accounts az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X PUT -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/<subscription_ID>/providers/Microsoft.Security/settings/MCAS?api-version=2021-06-01 -d@input.json' Where input.json contains the Request body json data as mentioned below. { id: /subscriptions/<Your_Subscription_Id>/providers/Microsoft.Security/settings/MCAS, kind: DataExportSetting, type: Microsoft.Security/settings, properties: { enabled: true } }

Additional Information

NOTE: Microsoft Defender for Cloud Apps (MDCA) is formerly known as Microsoft Cloud App Security (MCAS). There are a number of places (e.g. Azure CLI) where the MCAS acronym is still used within Azure.

2.1.21Ensure that Microsoft Defender for Endpoint integration with Microsoft Defender for Cloud is selected1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

This integration setting enables Microsoft Defender for Endpoint (formerly 'Advanced Threat Protection' or 'ATP' or 'WDATP' - see additional info) to communicate with Microsoft Defender for Cloud. IMPORTANT: When enabling integration between DfE & DfC it needs to be taken into account that this will have some side effects that may be undesirable. 1. For server 2019 & above if defender is installed (default for these server SKU's) this will trigger a deployment of the new unified agent and link to any of the extended configuration in the Defender portal. 1. If the new unified agent is required for server SKU's of Win 2016 or Linux and lower there is additional integration that needs to be switched on and agents need to be aligned.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Select Microsoft Defender for Cloud 1. Select Environment Settings blade 1. Click on the subscription name 1. Select the Integrations blade 1. Ensure setting Allow Microsoft Defender for Endpoint to access my data is selected. From Azure CLI Ensure the output of the below command is True az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X GET -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/<subscriptionID>/providers/Microsoft.Security/settings?api-version=2021-06-01' | jq '.|.value[] | select(.name==WDATP)'|jq '.properties.enabled' From PowerShell Run the following commands to login and audit this check Connect-AzAccount Set-AzContext -Subscription <subscriptionID> Get-AzSecuritySetting | Select-Object name,enabled |where-object {$_.name -eq WDATP} PowerShell Output - Non-Compliant Name Enabled ---- ------- WDATP False PowerShell Output - Compliant Name Enabled ---- ------- WDATP True

Impact Statement

Microsoft Defender for Endpoint works with Standard pricing tier Subscription. Choosing the Standard pricing tier of Microsoft Defender for Cloud incurs an additional cost per resource.

Assessment Status

Manual

Rationale Statement

Microsoft Defender for Endpoint integration brings comprehensive Endpoint Detection and Response (EDR) capabilities within Microsoft Defender for Cloud. This integration helps to spot abnormalities, as well as detect and respond to advanced attacks on endpoints monitored by Microsoft Defender for Cloud. MDE works only with Standard Tier subscriptions.

Remediation Procedure

From Azure Console 1. From Azure Home select the Portal Menu. 1. Go to Microsoft Defender for Cloud. 1. Select Environment Settings blade. 1. Select the subscription. 1. Select Integrations. 1. Check Allow Microsoft Defender for Endpoint to access my data. 1. Select Save. From Azure CLI Use the below command to enable Standard pricing tier for Storage Accounts az account get-access-token --query {subscription:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X PUT -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/<subscriptionID>/providers/Microsoft.Security/settings/WDATP?api-version=2021-06-01 -d@input.json' Where input.json contains the Request body json data as mentioned below. { id: /subscriptions/<Your_Subscription_Id>/providers/Microsoft.Security/settings/WDATP, kind: DataExportSettings, type: Microsoft.Security/settings, properties: { enabled: true } }

Additional Information

IMPORTANT: When enabling integration between DfE & DfC it needs to be taken into account that this will have some side effects that may be undesirable. 1. For server 2019 & above if defender is installed (default for these server SKU's) this will trigger a deployment of the new unified agent and link to any of the extended configuration in the Defender portal. 1. If the new unified agent is required for server SKU's of Win 2016 or Linux and lower there is additional integration that needs to be switched on and agents need to be aligned. NOTE: Microsoft Defender for Endpoint (MDE) was formerly known as Windows Defender Advanced Threat Protection (WDATP). There are a number of places (e.g. Azure CLI) where the WDATP acronym is still used within Azure.

2.1.22Ensure that Microsoft Defender External Attack Surface Monitoring (EASM) is enabled0
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.1 Microsoft Defender for Cloud

Description

An organization's attack surface is the collection of assets with a public network identifier or URI that an external threat actor can see or access from outside your cloud. It is the set of points on the boundary of a system, a system element, system component, or an environment where an attacker can try to enter, cause an effect on, or extract data from, that system, system element, system component, or environment. The larger the attack surface, the harder it is to protect. This tool can be configured to scan your organization's online infrastructure such as specified domains, hosts, CIDR blocks, and SSL certificates, and store them in an Inventory. Inventory items can be added, reviewed, approved, and removed, and may contain enrichments (insights) and additional information collected from the tool's different scan engines and open-source intelligence sources. A Defender EASM workspace will generate an Inventory of publicly exposed assets by crawling and scanning the internet using Seeds you provide when setting up the tool. Seeds can be FQDNs, IP CIDR blocks, and WHOIS records. Defender EASM will generate Insights within 24-48 hours after Seeds are provided, and these insights include vulnerability data (CVEs), ports and protocols, and weak or expired SSL certificates that could be used by an attacker for reconnaisance or exploitation. Results are classified High/Medium/Low and some of them include proposed mitigations.

Default Value

Microsoft Defender EASM is an optional, paid Azure Resource that must be created and configured inside a Subscription and Resource Group.

Audit Procedure

To view Defender EASM workspaces created for your Subscriptions, search for EASM in the Azure Portal using the search box.

Impact Statement

Microsoft Defender EASM workspaces are currently available as Azure Resources with a 30-day free trial period but can quickly accrue significant charges. The costs are calculated daily as (Number of billable inventory items) x (item cost per day; approximately: $0.017). Estimated cost is not provided within the tool, and users are strongly advised to contact their Microsoft sales representative for pricing and set a calendar reminder for the end of the trial period. For an EASM workspace having an Inventory of 5k-10k billable items (IP addresses, hostnames, SSL certificates, etc) a typical cost might be approximiately $85-170 per day or $2500-5000 USD/month at the time of publication. If the workspace is deleted by the last day of a free trial period, no charges are billed.

Assessment Status

Manual

Rationale Statement

This tool can monitor the externally exposed resources of an organization, provide valuable insights, and export these findings in a variety of formats (including CSV) for use in vulnerability management operations and red/purple team exercises.

Remediation Procedure

To begin remediation, a Microsoft Defender EASM workspace must be created. The resources and inventory items added to this workspace will depend on your environment.

Additional Information

Microsoft added its Defender for External Attack Surface management (EASM) offering to Azure following its 2022 acquisition of EASM SaaS tool company RiskIQ.

2.2.1Ensure That Microsoft Defender for IoT Hub Is Set To 'On'1
Attributes
Profile

Level 2

Section

2 Microsoft Defender

Sub Section

2.2 Microsoft Defender for IoT

Description

Microsoft Defender for IoT acts as a central security hub for IoT devices within your organization.

Default Value

By default, Microsoft Defender for IoT is not enabled.

Audit Procedure

From Azure Portal 1. Go to IoT Hub. 2. Select a IoT Hub to validate. 3. Select Overview in Defender for IoT. 4. The Threat prevention and Threat detection screen will appear, if Defender for IoT is Enabled.

Impact Statement

Enabling Microsoft Defender for IoT will incur additional charges dependent on the level of usage.

Assessment Status

Manual

Rationale Statement

IoT devices are very rarely patched and can be potential attack vectors for enterprise networks. Updating their network configuration to use a central security hub allows for detection of these breaches.

Remediation Procedure

From Azure Portal 1. Go to IoT Hub. 2. Select a IoT Hub to validate. 3. Select Overview in Defender for IoT. 4. Click on Secure your IoT solution, and complete the onboarding.

Additional Information

There are additional configurations for Microsoft Defender for IoT that allow for types of deployments called hybrid or local. Both run on your physical infrastructure. These are complicated setups and are primarily outside of the scope of a purely Azure benchmark. Please see the references to consider these options for your organization.

3 Storage Accounts1710
3.1Ensure that 'Secure transfer required' is set to 'Enabled'1
Attributes
Profile

Level 1

Section

3 Storage Accounts

Description

Enable data encryption in transit.

Default Value

By default, Secure transfer required is set to Disabled.

Audit Procedure

From Azure Portal 1. Go to Storage Accounts 2. For each storage account, go to Configuration 3. Ensure that Secure transfer required is set to Enabled From Azure CLI Use the below command to ensure the Secure transfer required is enabled for all the Storage Accounts by ensuring the output contains true for each of the Storage Accounts. az storage account list --query [*].[name,enableHttpsTrafficOnly] 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: 404c3081-a854-4457-ae30-26a93ef643f9 - Name: 'Secure transfer to storage accounts should be enabled'

Assessment Status

Automated

Rationale Statement

The secure transfer option enhances the security of a storage account by only allowing requests to the storage account by a secure connection. For example, when calling REST APIs to access storage accounts, the connection must use HTTPS. Any requests using HTTP will be rejected when 'secure transfer required' is enabled. When using the Azure files service, connection without encryption will fail, including scenarios using SMB 2.1, SMB 3.0 without encryption, and some flavors of the Linux SMB client. Because Azure storage doesn’t support HTTPS for custom domain names, this option is not applied when using a custom domain name.

Remediation Procedure

From Azure Portal 1. Go to Storage Accounts 2. For each storage account, go to Configuration 3. Set Secure transfer required to Enabled From Azure CLI Use the below command to enable Secure transfer required for a Storage Account az storage account update --name <storageAccountName> --resource-group <resourceGroupName> --https-only true

3.2Ensure that ‘Enable Infrastructure Encryption’ for Each Storage Account in Azure Storage is Set to ‘enabled’1
Attributes
Profile

Level 2

Section

3 Storage Accounts

Description

Enabling encryption at the hardware level on top of the default software encryption for Storage Accounts accessing Azure storage solutions.

Default Value

By default, Infrastructure Encryption is disabled in blob creation.

Audit Procedure

From Azure Portal 1. From Azure Portal select the portal menu in the top left. 2. Select Storage Accounts. 3. Click on each storage account within each resource group you wish to audit. 4. In the overview, under Security, ensure Infrastructure encryption is set to Enabled. From Azure CLI az storage blob show \ --account-name <storage-account> \ --container-name <container> \ --name <blob> \ --query properties.serverEncrypted From PowerShell $account = Get-AzStorageAccount -ResourceGroupName <resource-group> ` -Name <storage-account> $blob = Get-AzStorageBlob -Context $account.Context ` -Container <container> ` -Blob <blob> $blob.ICloudBlob.Properties.IsServerEncrypted 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: 4733ea7b-a883-42fe-8cac-97454c2a9e4a - Name: 'Storage accounts should have infrastructure encryption'

Impact Statement

The read and write speeds to the storage will be impacted if both default encryption and Infrastructure Encryption are checked, as a secondary form of encryption requires more resource overhead for the cryptography of information. This performance impact should be considered in an analysis for justifying use of the feature in your environment. Customer-managed keys are recommended for the most secure implementation, leading to overhead of key management. The key will also need to be backed up in a secure location, as loss of the key will mean loss of the information in the storage.

Assessment Status

Automated

Rationale Statement

Azure Storage automatically encrypts all data in a storage account at the network level using 256-bit AES encryption, which is one of the strongest, FIPS 140-2-compliant block ciphers available. Customers who require higher levels of assurance that their data is secure can also enable 256-bit AES encryption at the Azure Storage infrastructure level for double encryption. Double encryption of Azure Storage data protects against a scenario where one of the encryption algorithms or keys may be compromised. Similarly, data is encrypted even before network transmission and in all backups. In this scenario, the additional layer of encryption continues to protect your data. For the most secure implementation of key based encryption, it is recommended to use a Customer Managed asymmetric RSA 2048 Key in Azure Key Vault.

Remediation Procedure

From Azure Portal 1. During Storage Account creation, in the Encryption tab, check the box next to Enable infrastructure encryption. From Azure CLI Replace the information within <> with appropriate values: az storage account create \ --name <storage-account> \ --resource-group <resource-group> \ --location <location> \ --sku Standard_RAGRS \ --kind StorageV2 \ --require-infrastructure-encryption From PowerShell Replace the information within <> with appropriate values: New-AzStorageAccount -ResourceGroupName <resource_group> ` -AccountName <storage-account> ` -Location <location> ` -SkuName Standard_RAGRS ` -Kind StorageV2 ` -RequireInfrastructureEncryption Enabling Infrastructure Encryption after Storage Account Creation If infrastructure encryption was not enabled on blob storage creation, there is no official way to enable it. Please see the additional information section.

Additional Information

The default service side encryption for Azure Storage is enabled on every block blob, append blob, or page blob that was written to Azure Storage after October 20, 2017. Hardware encryption, however, cannot be enabled on a blob storage after its creation. There are ways to copy all data from a blob storage into another or download and reupload into another blob storage. This could result in data loss and is not recommended.

3.3Ensure that 'Enable key rotation reminders' is enabled for each Storage Account0
Attributes
Profile

Level 1

Section

3 Storage Accounts

Description

Access Keys authenticate application access requests to data contained in Storage Accounts. A periodic rotation of these keys is recommended to ensure that potentially compromised keys cannot result in a long-term exploitable credential. The Rotation Reminder is an automatic reminder feature for a manual procedure.

Default Value

By default, Key rotation reminders is not configured.

Audit Procedure

From Azure Portal 1. Go to Storage Accounts 2. For each Storage Account, go to Access keys 3. Click Set rotation reminder If the checkbox for Enable key rotation reminders is already checked, that Storage Account is compliant. Review the Remind me every field for a desirable periodic setting that fits your security program's needs. From Powershell $rgName = <resource group name for the storage> $accountName = <storage account name> $account = Get-AzStorageAccount -ResourceGroupName $rgName -Name $accountName Write-Output $accountName -> Write-Output Expiration Reminder set to: $($account.KeyPolicy.KeyExpirationPeriodInDays) Days Write-Output Key1 Last Rotated: $($account.KeyCreationTime.Key1.ToShortDateString()) Write-Output Key2 Last Rotated: $($account.KeyCreationTime.Key2.ToShortDateString()) If any of the creation dates is empty, then remediation is required, due to the need of at least one rotation of the keys. If the reminder is set, the period in days will be returned. 90 days is the recommendation.

Impact Statement

This recommendation only creates a periodic reminder to regenerate access keys. Regenerating access keys can affect services in Azure as well as the organization's applications that are dependent on the storage account. All clients that use the access key to access the storage account must be updated to use the new key.

Assessment Status

Manual

Rationale Statement

Reminders such as those generated by this recommendation will help maintain a regular and healthy cadence for activities which improve the overall efficacy of a security program. Cryptographic key rotation periods will vary depending on your organization's security requirements and the type of data which is being stored in the Storage Account. For example, PCI DSS mandates that cryptographic keys be replaced or rotated 'regularly,' and advises that keys for static data stores be rotated every 'few months.' For the purposes of this recommendation, 90 days will prescribed for the reminder. Review and adjustment of the 90 day period is recommended, and may even be necessary. Your organization's security requirements should dictate the appropriate setting.

Remediation Procedure

From Azure Portal 1. Go to Storage Accounts 1. For each Storage Account that is not compliant, go to Access keys 1. Click Set rotation reminder 1. Check Enable key rotation reminders 1. In the Send reminders field select Custom, then set the Remind me every field to 90 and the period drop down to Days. 1. Click Save From Powershell $rgName = <resource group name for the storage> $accountName = <storage account name> $account = Get-AzStorageAccount -ResourceGroupName $rgName -Name $accountName if ($account.KeyCreationTime.Key1 -eq $null -or $account.KeyCreationTime.Key2 -eq $null){ Write-output (You must regenerate both keys at least once before setting expiration policy) } else { $account = Set-AzStorageAccount -ResourceGroupName $rgName -Name $accountName -KeyExpirationPeriodInDay 90 } $account.KeyPolicy.KeyExpirationPeriodInDays

3.4Ensure that Storage Account Access Keys are Periodically Regenerated1
Attributes
Profile

Level 1

Section

3 Storage Accounts

Description

For increased security, regenerate storage account access keys periodically.

Default Value

By default, access keys are not regenerated periodically.

Audit Procedure

From Azure Portal 1. Go to Storage Accounts 2. For each Storage Account, go to Access keys 3. Review the date in the Last rotated field for each key. If the Last rotated field indicates value greater than 90 day [or greater than your organization's period of validity], the key should be rotated. From Azure CLI 1. Get a list of storage accounts az storage account list --subscription <subscription-id> Make a note of id, name and resourceGroup. 2. For every storage account make sure that key is regenerated in past 90 days. az monitor activity-log list --namespace Microsoft.Storage --offset 90d --query [?contains(authorization.action, 'regenerateKey')] --resource-id <resource id> The output should contain authorization/scope: <your_storage_account> AND authorization/action: Microsoft.Storage/storageAccounts/regeneratekey/action AND status/localizedValue: Succeeded status/Value: Succeeded

Impact Statement

Regenerating access keys can affect services in Azure as well as the organization's applications that are dependent on the storage account. All clients who use the access key to access the storage account must be updated to use the new key.

Assessment Status

Manual

Rationale Statement

When a storage account is created, Azure generates two 512-bit storage access keys which are used for authentication when the storage account is accessed. Rotating these keys periodically ensures that any inadvertent access or exposure does not result from the compromise of these keys. Cryptographic key rotation periods will vary depending on your organization's security requirements and the type of data which is being stored in the Storage Account. For example, PCI DSS mandates that cryptographic keys be replaced or rotated 'regularly,' and advises that keys for static data stores be rotated every 'few months.' For the purposes of this recommendation, 90 days will prescribed for the reminder. Review and adjustment of the 90 day period is recommended, and may even be necessary. Your organization's security requirements should dictate the appropriate setting.

Remediation Procedure

From Azure Portal 1. Go to Storage Accounts 2. For each Storage Account with outdated keys, go to Access keys 3. Click Rotate key next to the outdated key, then click Yes to the prompt confirming that you want to regenerate the access key. After Azure regenerates the Access Key, you can confirm that Access keys reflects a Last rotated date of (0 days ago).

3.5Ensure Storage Logging is Enabled for Queue Service for 'Read', 'Write', and 'Delete' requests0
Attributes
Profile

Level 2

Section

3 Storage Accounts

Description

The Storage Queue service stores messages that may be read by any client who has access to the storage account. A queue can contain an unlimited number of messages, each of which can be up to 64KB in size using version 2011-08-18 or newer. Storage Logging happens server-side and allows details for both successful and failed requests to be recorded in the storage account. These logs allow users to see the details of read, write, and delete operations against the queues. Storage Logging log entries contain the following information about individual requests: Timing information such as start time, end-to-end latency, and server latency, authentication details, concurrency information, and the sizes of the request and response messages.

Default Value

By default storage account queue services are not logged.

Audit Procedure

From Azure Portal: 1. Go to Storage Accounts. 1. Select the specific Storage Account. 1. Click the Diagnostics settings under the Monitoring section in the left column. 1. Select the queue tab indented below the storage account. Then select the diagnostic setting listed. 1. Ensure StorageRead, StorageWrite, and StorageDelete options are selected under the Logs section and that they are sent to the correct destination. From Azure CLI Ensure the below command's output contains properties delete, read and write set to true. az storage logging show --services q --account-name <storageAccountName> 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: 7bd000e3-37c7-4928-9f31-86c4b77c5c45 - Name: 'Configure diagnostic settings for Queue Services to Log Analytics workspace'

Impact Statement

Enabling this setting can have a high impact on the cost of the log analytics service and data storage used by logging more data per each request. Do not enable this without determining your need for this level of logging, and do not forget to check in on data usage and projected cost. Some users have seen their logging costs increase from $10 per month to $10,000 per month.

Assessment Status

Automated

Rationale Statement

Storage Analytics logs contain detailed information about successful and failed requests to a storage service. This information can be used to monitor individual requests and to diagnose issues with a storage service. Requests are logged on a best-effort basis. Storage Analytics logging is not enabled by default for your storage account.

Remediation Procedure

From Azure Portal 1. Go to Storage Accounts. 1. Select the specific Storage Account. 1. Click the Diagnostics settings under the Monitoring section in the left column. 1. Select the queue tab indented below the storage account. 1. Click + Add diagnostic setting. 1. Select StorageRead, StorageWrite and StorageDelete options under the Logs section to enable Storage Logging for Queue service. 1. Select a destination for your logs to be sent to. From Azure CLI Use the below command to enable the Storage Logging for Queue service. az storage logging update --account-name <storageAccountName> --account-key <storageAccountKey> --services q --log rwd --retention 90

Additional Information

We cannot practically generalize detailed audit log requirements for every queue due to their nature and intent. This recommendation may be applicable to storage account queue services where the security is paramount.

3.6Ensure that Shared Access Signature Tokens Expire Within an Hour0
Attributes
Profile

Level 1

Section

3 Storage Accounts

Description

Expire shared access signature tokens within an hour.

Default Value

By default, expiration for shared access signature is set to 8 hours.

Audit Procedure

Currently, SAS token expiration times cannot be audited. Until Microsoft makes token expiration time a setting rather than a token creation parameter, this recommendation would require a manual verification.

Assessment Status

Manual

Rationale Statement

A shared access signature (SAS) is a URI that grants restricted access rights to Azure Storage resources. A shared access signature can be provided to clients who should not be trusted with the storage account key but for whom it may be necessary to delegate access to certain storage account resources. Providing a shared access signature URI to these clients allows them access to a resource for a specified period of time. This time should be set as low as possible and preferably no longer than an hour.

Remediation Procedure

When generating shared access signature tokens, use start and end time such that it falls within an hour. From Azure Portal 1. Go to Storage Accounts 2. For each storage account, go to Shared access signature 3. Set Start and expiry date/time within an hour

3.7Ensure that 'Public Network Access' is `Disabled' for storage accounts1
Attributes
Profile

Level 1

Section

3 Storage Accounts

Description

Disallowing public network access for a storage account overrides the public access settings for individual containers in that storage account for Azure Resource Manager Deployment Model storage accounts. Azure Storage accounts that use the classic deployment model will be retired on August 31, 2024.

Default Value

By default, Public Network Access is set to Enabled from all networks for the Storage Account.

Audit Procedure

From Azure Portal 1. Go to Storage Accounts 2. For each storage account, under the Security + networking section, click Networking 3. Ensure the Public Network Access setting is set to Disabled. From Azure CLI Ensure publicNetworkAccess is Disabled az storage account show --name <storage-account> --resource-group <resource-group> --query {publicNetworkAccess:publicNetworkAccess} From PowerShell For each Storage Account, ensure PublicNetworkAccess is Disabled Get-AzStorageAccount -Name <storage account name> -ResourceGroupName <resource group name> |select PublicNetworkAccess 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: b2982f36-99f2-4db5-8eff-283140c09693 - Name: 'Storage accounts should disable public network access'

Impact Statement

Access will have to be managed using shared access signatures or via Azure AD RBAC.

Assessment Status

Automated

Rationale Statement

The default network configuration for a storage account permits a user with appropriate permissions to configure public network access to containers and blobs in a storage account. Keep in mind that public access to a container is always turned off by default and must be explicitly configured to permit anonymous requests. It grants read-only access to these resources without sharing the account key, and without requiring a shared access signature. It is recommended not to provide public network access to storage accounts until, and unless, it is strongly desired. A shared access signature token or Azure AD RBAC should be used for providing controlled and timed access to blob containers.

Remediation Procedure

From Azure Portal First, follow Microsoft documentation and create shared access signature tokens for your blob containers. Then, 1. Go to Storage Accounts 2. For each storage account, under the Security + networking section, click Networking 3. Set Public Network Access to Disabled. From Azure CLI Set 'Public Network Access' to Disabled on the storage account az storage account update --name <storage-account> --resource-group <resource-group> --public-network-access Disabled From PowerShell For each Storage Account, run the following to set the PublicNetworkAccess setting to Disabled Set-AzStorageAccount -ResourceGroupName <resource group name> -Name <storage account name> -PublicNetworkAccess Disabled

Additional Information

For classic storage accounts (to be retired on August 31, 2024), each container in the account must be configured to block anonymous access. Either configure all containers or to configure at the storage account level, migrate to the Azure Resource Manager deployment model.

3.8Ensure Default Network Access Rule for Storage Accounts is Set to Deny1
Attributes
Profile

Level 1

Section

3 Storage Accounts

Description

Restricting default network access helps to provide a new layer of security, since storage accounts accept connections from clients on any network. To limit access to selected networks, the default action must be changed.

Default Value

By default, Storage Accounts will accept connections from clients on any network.

Audit Procedure

From Azure Console 1. Go to Storage Accounts 2. For each storage account, Click on the Networking blade. 4. Click the Firewalls and virtual networks heading. 3. Ensure that Allow access from All networks is not selected. From Azure CLI Ensure defaultAction is not set to Allow. az storage account list --query '[*].networkRuleSet' From PowerShell Connect-AzAccount Set-AzContext -Subscription <subscription ID> Get-AzStorageAccountNetworkRuleset -ResourceGroupName <resource group> -Name <storage account name> |Select-Object DefaultAction PowerShell Result - Non-Compliant DefaultAction : Allow PowerShell Result - Compliant DefaultAction : Deny 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: 34c877ad-507e-4c82-993e-3452a6e0ad3c - Name: 'Storage accounts should restrict network access' - Policy ID: 2a1a9cdf-e04d-429a-8416-3bfb72a1b26f - Name: 'Storage accounts should restrict network access using virtual network rules'

Impact Statement

All allowed networks will need to be whitelisted on each specific network, creating administrative overhead. This may result in loss of network connectivity, so do not turn on for critical resources during business hours.

Assessment Status

Automated

Rationale Statement

Storage accounts should be configured to deny access to traffic from all networks (including internet traffic). Access can be granted to traffic from specific Azure Virtual networks, allowing a secure network boundary for specific applications to be built. Access can also be granted to public internet IP address ranges to enable connections from specific internet or on-premises clients. When network rules are configured, only applications from allowed networks can access a storage account. When calling from an allowed network, applications continue to require proper authorization (a valid access key or SAS token) to access the storage account.

Remediation Procedure

From Azure Console 1. Go to Storage Accounts 2. For each storage account, Click on the Networking blade 4. Click the Firewalls and virtual networks heading. 5. Ensure that you have elected to allow access from Selected networks 6. Add rules to allow traffic from specific network. 7. Click Save to apply your changes. From Azure CLI Use the below command to update default-action to Deny. az storage account update --name <StorageAccountName> --resource-group <resourceGroupName> --default-action Deny

3.9Ensure 'Allow Azure services on the trusted services list to access this storage account' is Enabled for Storage Account Access1
Attributes
Profile

Level 2

Section

3 Storage Accounts

Description

Some Azure services that interact with storage accounts operate from networks that can't be granted access through network rules. To help this type of service work as intended, allow the set of trusted Azure services to bypass the network rules. These services will then use strong authentication to access the storage account. If the Allow trusted Azure services exception is enabled, the following services are granted access to the storage account: Azure Backup, Azure Site Recovery, Azure DevTest Labs, Azure Event Grid, Azure Event Hubs, Azure Networking, Azure Monitor, and Azure SQL Data Warehouse (when registered in the subscription).

Default Value

By default, Storage Accounts will accept connections from clients on any network.

Audit Procedure

From Azure Portal 1. Go to Storage Accounts 2. For each storage account, Click on the Networking blade 3. Click on the Firewalls and virtual networks heading. 4. Ensure that Enabled from selected virtual networks and IP addresses is selected. 5. Ensure that Allow Azure services on the trusted services list to access this storage account is checked in Exceptions. From Azure CLI Ensure bypass contains AzureServices az storage account list --query '[*].networkRuleSet' From PowerShell Connect-AzAccount Set-AzContext -Subscription <subscription ID> Get-AzStorageAccountNetworkRuleset -ResourceGroupName <resource group> -Name <storage account name> |Select-Object Bypass If the resultant output from the above command shows 'NULL', that storage account configuration is out of compliance with this check. If the result of the above command shows 'AzureServices', that storage account configuration is in compliance with this check. 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: c9d007d0-c057-4772-b18c-01e546713bcd - Name: 'Storage accounts should allow access from trusted Microsoft services'

Impact Statement

This creates authentication credentials for services that need access to storage resources so that services will no longer need to communicate via network request. There may be a temporary loss of communication as you set each Storage Account. It is recommended to not do this on mission-critical resources during business hours.

Assessment Status

Automated

Rationale Statement

Turning on firewall rules for storage account will block access to incoming requests for data, including from other Azure services. We can re-enable this functionality by enabling Trusted Azure Services through networking exceptions.

Remediation Procedure

From Azure Portal 1. Go to Storage Accounts 2. For each storage account, Click on the Networking blade 3. Click on the Firewalls and virtual networks heading. 4. Ensure that Enabled from selected virtual networks and IP addresses is selected. 5. Under the 'Exceptions' label, enable check box for Allow Azure services on the trusted services list to access this storage account. 6. Click Save to apply your changes. From Azure CLI Use the below command to update Azure services. az storage account update --name <StorageAccountName> --resource-group <resourceGroupName> --bypass AzureServices

3.10Ensure Private Endpoints are used to access Storage Accounts1
Attributes
Profile

Level 1

Section

3 Storage Accounts

Description

Use private endpoints for your Azure Storage accounts to allow clients and services to securely access data located over a network via an encrypted Private Link. To do this, the private endpoint uses an IP address from the VNet for each service. Network traffic between disparate services securely traverses encrypted over the VNet. This VNet can also link addressing space, extending your network and accessing resources on it. Similarly, it can be a tunnel through public networks to connect remote infrastructures together. This creates further security through segmenting network traffic and preventing outside sources from accessing it.

Default Value

By default, Private Endpoints are not created for Storage Accounts.

Audit Procedure

From Azure Portal 1. Open the Storage Accounts blade. 1. For each listed Storage Account, perform the following check: 1. Under the Security + networking heading, click on Networking. 1. Click on the Private Endpoint Connections tab at the top of the networking window. 1. Ensure that for each VNet that the Storage Account must be accessed from, a unique Private Endpoint is deployed and the Connection State for each Private Endpoint is Approved Repeat the procedure for each Storage Account. From PowerShell $storageAccount = Get-AzStorageAccount -ResourceGroup '<ResourceGroupName>' -Name '<storageaccountname>' Get-AzPrivateEndpoint -ResourceGroup '<ResourceGroupName>'|Where-Object {$_.PrivateLinkServiceConnectionsText -match $storageAccount.id} If the results of the second command returns information, the Storage Account is using a Private Endpoint and complies with this Benchmark, otherwise if the results of the second command are empty, the Storage Account generates a finding. From Azure CLI az storage account show --name '<storage account name>' --query privateEndpointConnections[0].id If the above command returns data, the Storage Account complies with this Benchmark, otherwise if the results are empty, the Storage Account generates a finding. 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: 6edd7eda-6dd8-40f7-810d-67160c639cd9 - Name: 'Storage accounts should use private link'

Impact Statement

There is no cost in deploying VNets between Azure resources. If improperly implemented, it may result in loss of critical network traffic.

Assessment Status

Automated

Rationale Statement

Securing traffic between services through encryption protects the data from easy interception and reading.

Remediation Procedure

From Azure Portal 1. Open the Storage Accounts blade 1. For each listed Storage Account, perform the following: 1. Under the Security + networking heading, click on Networking 1. Click on the Private Endpoint Connections tab at the top of the networking window 1. Click the +Private endpoint button 1. In the 1 - Basics tab/step: - Enter a name that will be easily recognizable as associated with the Storage Account (Note: The Network Interface Name will be automatically completed, but you can customize it if needed.) - Ensure that the Region matches the region of the Storage Account - Click Next 1. In the 2 - Resource tab/step: - Select the target sub-resource based on what type of storage resource is being made available - Click Next 1. In the 3 - Virtual Network tab/step: - Select the Virtual network that your Storage Account will be connecting to - Select the Subnet that your Storage Account will be connecting to - (Optional) Select other network settings as appropriate for your environment - Click Next 1. In the 4 - DNS tab/step: - (Optional) Select other DNS settings as appropriate for your environment - Click Next 1. In the 5 - Tags tab/step: - (Optional) Set any tags that are relevant to your organization - Click Next 1. In the 6 - Review + create tab/step: - A validation attempt will be made and after a few moments it should indicate Validation Passed - if it does not pass, double-check your settings before beginning more in depth troubleshooting. - If validation has passed, click Create then wait for a few minutes for the scripted deployment to complete. Repeat the above procedure for each Private Endpoint required within every Storage Account. From PowerShell $storageAccount = Get-AzStorageAccount -ResourceGroupName '<ResourceGroupName>' -Name '<storageaccountname>' $privateEndpointConnection = @{ Name = 'connectionName' PrivateLinkServiceId = $storageAccount.Id GroupID = blob|blob_secondary|file|file_secondary|table|table_secondary|queue|queue_secondary|web|web_secondary|dfs|dfs_secondary } $privateLinkServiceConnection = New-AzPrivateLinkServiceConnection @privateEndpointConnection $virtualNetDetails = Get-AzVirtualNetwork -ResourceGroupName '<ResourceGroupName>' -Name '<name>' $privateEndpoint = @{ ResourceGroupName = '<ResourceGroupName>' Name = '<PrivateEndpointName>' Location = '<location>' Subnet = $virtualNetDetails.Subnets[0] PrivateLinkServiceConnection = $privateLinkServiceConnection } New-AzPrivateEndpoint @privateEndpoint From Azure CLI az network private-endpoint create --resource-group <ResourceGroupName --location <location> --name <private endpoint name> --vnet-name <VNET Name> --subnet <subnet name> --private-connection-resource-id <storage account ID> --connection-name <private link service connection name> --group-id <blob|blob_secondary|file|file_secondary|table|table_secondary|queue|queue_secondary|web|web_secondary|dfs|dfs_secondary>

Additional Information

A NAT gateway is the recommended solution for outbound internet access.

3.11Ensure Soft Delete is Enabled for Azure Containers and Blob Storage1
Attributes
Profile

Level 1

Section

3 Storage Accounts

Description

The Azure Storage blobs contain data like ePHI or Financial, which can be secret or personal. Data that is erroneously modified or deleted by an application or other storage account user will cause data loss or unavailability. It is recommended that both Azure Containers with attached Blob Storage and standalone containers with Blob Storage be made recoverable by enabling the soft delete configuration. This is to save and recover data when blobs or blob snapshots are deleted.

Default Value

When a new storage account is created, soft delete for containers and blob storage is by default disabled.

Audit Procedure

From Azure Portal: 1. From the Azure home page, open the hamburger menu in the top left or click on the arrow pointing right with 'More services' underneath. 2. Select Storage. 3. Select Storage Accounts. 4. For each Storage Account, navigate to Data protection in the left scroll column. 5. Ensure that soft delete is checked for both blobs and containers. Also check if the retention period is a sufficient length for your organization. From Azure CLI Blob Storage: Ensure that the output of the below command contains enabled status as true and days is not empty or null az storage blob service-properties delete-policy show --account-name <StorageAccountName> --account-key <accountkey> Azure Containers: Make certain that the --enable-container-delete-retention is 'true'. az storage account blob-service-properties show --account-name <StorageAccountName> --account-key <accountkey> --resource-group <resource_group> 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: ea39f60f-9f00-473c-8604-be5eac4bb088 - Name: 'Configure blob soft delete on a storage account'

Impact Statement

Additional storage costs may be incurred as snapshots are retained.

Assessment Status

Automated

Rationale Statement

Containers and Blob Storage data can be incorrectly deleted. An attacker/malicious user may do this deliberately in order to cause disruption. Deleting an Azure Storage blob causes immediate data loss. Enabling this configuration for Azure storage ensures that even if blobs/data were deleted from the storage account, Blobs/data objects are recoverable for a particular time which is set in the Retention policies, ranging from 7 days to 365 days.

Remediation Procedure

From Azure Portal 1. From the Azure home page, open the hamburger menu in the top left or click on the arrow pointing right with 'More services' underneath. 2. Select Storage. 3. Select Storage Accounts. 4. For each Storage Account, navigate to Data protection in the left scroll column. 5. Check soft delete for both blobs and containers. Set the retention period to a sufficient length for your organization. From Azure CLI Update blob storage retention days in below command az storage blob service-properties delete-policy update --days-retained <RetentionDaysValue> --account-name <StorageAccountName> --account-key <AccountKey> --enable true Update container retention with the below command az storage account blob-service-properties update --enable-container-delete-retention true --container-delete-retention-days <days> --account-name <storage-account> --resource-group <resource_group> --account-key <AccountKey>

3.12Ensure Storage for Critical Data are Encrypted with Customer Managed Keys (CMK)1
Attributes
Profile

Level 2

Section

3 Storage Accounts

Description

Enable sensitive data encryption at rest using Customer Managed Keys (CMK) rather than Microsoft Managed keys.

Default Value

By default, Encryption type is set to Microsoft Managed Keys.

Audit Procedure

From Azure Console: 1. Go to Storage Accounts 2. For each storage account, go to Encryption 3. Ensure that Encryption type is set to Customer Managed Keys From PowerShell Connect-AzAccount Set-AzContext -Subscription <subscription id> Get-AzStorageAccount |Select-Object -ExpandProperty Encryption PowerShell Results - Non-Compliant ... KeySource : Microsoft.Storage ... PowerShell Results - Compliant ... KeySource : Microsoft.Keyvault ... 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: 6fac406b-40ca-413b-bf8e-0bf964659c25 - Name: 'Storage accounts should use customer-managed key for encryption'

Impact Statement

If the key expires by setting the 'activation date' and 'expiration date', the user must rotate the key manually. Using Customer Managed Keys may also incur additional man-hour requirements to create, store, manage, and protect the keys as needed.

Assessment Status

Manual

Rationale Statement

By default, data in the storage account is encrypted using Microsoft Managed Keys at rest. All Azure Storage resources are encrypted, including blobs, disks, files, queues, and tables. All object metadata is also encrypted. If you want to control and manage this encryption key yourself, however, you can specify a customer-managed key. That key is used to protect and control access to the key that encrypts your data. You can also choose to automatically update the key version used for Azure Storage encryption whenever a new version is available in the associated Key Vault.

Remediation Procedure

From Azure Portal 1. Go to Storage Accounts 2. For each storage account, go to Encryption 3. Set Customer Managed Keys 4. Select the Encryption key and enter the appropriate setting value 5. Click Save

3.13Ensure Storage logging is Enabled for Blob Service for 'Read', 'Write', and 'Delete' requests0
Attributes
Profile

Level 2

Section

3 Storage Accounts

Description

The Storage Blob service provides scalable, cost-efficient object storage in the cloud. Storage Logging happens server-side and allows details for both successful and failed requests to be recorded in the storage account. These logs allow users to see the details of read, write, and delete operations against the blobs. Storage Logging log entries contain the following information about individual requests: timing information such as start time, end-to-end latency, and server latency; authentication details; concurrency information; and the sizes of the request and response messages.

Default Value

By default, storage account blob service logging is disabled for read, write, and delete operations.

Audit Procedure

From Azure Portal 1. From the default portal page select Storage Accounts. 2. Select the specific Storage Account. 3. Click the Diagnostics settings under the Monitoring section in the left column. 4. Select the 'blob' tab indented below the storage account. Then select the diagnostic setting listed. 5. Ensure StorageRead, StorageWrite, and StorageDelete options are selected under the Logging section and that they are sent to the correct destination. From Azure CLI Ensure the below command's output contains properties delete, read and write set to true. az storage logging show --services b --account-name <storageAccountName> 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: b4fe1a3b-0715-4c6c-a5ea-ffc33cf823cb - Name: 'Configure diagnostic settings for Blob Services to Log Analytics workspace'

Impact Statement

Being a level 2, enabling this setting can have a high impact on the cost of data storage used for logging more data per each request. Do not enable this without determining your need for this level of logging or forget to check in on data usage and projected cost.

Assessment Status

Automated

Rationale Statement

Storage Analytics logs contain detailed information about successful and failed requests to a storage service. This information can be used to monitor each individual request to a storage service for increased security or diagnostics. Requests are logged on a best-effort basis. Storage Analytics logging is not enabled by default for your storage account.

Remediation Procedure

From Azure Portal 1. From the default portal page select Storage Accounts. 2. Select the specific Storage Account. 3. Click the Diagnostics settings under the Monitoring section in the left column. 4. Select the 'blob' tab indented below the storage account. 5. Click '+ Add diagnostic setting'. 6. Select StorageRead, StorageWrite and StorageDelete options under the Logging section to enable Storage Logging for Blob service. 7. Select a destination for your logs to be sent to. From Azure CLI Use the below command to enable the Storage Logging for Blob service. az storage logging update --account-name <storageAccountName> --account-key <storageAccountKey> --services b --log rwd --retention 90

Additional Information

We cannot practically generalize detailed audit log requirements for every blob due to their nature and intent. This recommendation may be applicable to storage account blob service where the security is paramount.

3.14Ensure Storage Logging is Enabled for Table Service for 'Read', 'Write', and 'Delete' Requests0
Attributes
Profile

Level 2

Section

3 Storage Accounts

Description

Azure Table storage is a service that stores structured NoSQL data in the cloud, providing a key/attribute store with a schema-less design. Storage Logging happens server-side and allows details for both successful and failed requests to be recorded in the storage account. These logs allow users to see the details of read, write, and delete operations against the tables. Storage Logging log entries contain the following information about individual requests: timing information such as start time, end-to-end latency, and server latency; authentication details; concurrency information; and the sizes of the request and response messages.

Default Value

By default, storage account table service logging is disabled for read, write, an delete operations

Audit Procedure

From Azure Portal 1. From the default portal page select Storage Accounts. 2. Select the specific Storage Account. 3. Click the Diagnostics settings under the Monitoring section in the left column. 4. Select the 'table' tab indented below the storage account. Then select the diagnostic setting listed. 5. Ensure StorageRead, StorageWrite, and StorageDelete options are selected under the Logging section and that they are sent to the correct destination. From Azure CLI Ensure the below command's output contains properties delete, read and write set to true. az storage logging show --services t --account-name <storageAccountName> 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: 2fb86bf3-d221-43d1-96d1-2434af34eaa0 - Name: 'Configure diagnostic settings for Table Services to Log Analytics workspace'

Impact Statement

Being a level 2, enabling this setting can have a high impact on the cost of data storage used for logging more data per each request. Do not enable this without determining your need for this level of logging or forget to check in on data usage and projected cost.

Assessment Status

Automated

Rationale Statement

Storage Analytics logs contain detailed information about successful and failed requests to a storage service. This information can be used to monitor each individual request to a storage service for increased security or diagnostics. Requests are logged on a best-effort basis. Storage Analytics logging is not enabled by default for your storage account.

Remediation Procedure

From Azure Portal 1. From the default portal page select Storage Accounts. 2. Select the specific Storage Account. 3. Click the Diagnostics settings under the Monitoring section in the left column. 4. Select the 'table' tab indented below the storage account. 5. Click '+ Add diagnostic setting'. 6. Select StorageRead, StorageWrite and StorageDelete options under the Logging section to enable Storage Logging for Table service. 7. Select a destination for your logs to be sent to. From Azure CLI Use the below command to enable the Storage Logging for Table service. az storage logging update --account-name <storageAccountName> --account-key <storageAccountKey> --services t --log rwd --retention 90

Additional Information

We cannot practically generalize detailed audit log requirements for every table due to their nature and intent. This recommendation may be applicable to storage account table service where the security is paramount.

3.15Ensure the Minimum TLS version for storage accounts is set to Version 1.21
Attributes
Profile

Level 1

Section

3 Storage Accounts

Description

In some cases, Azure Storage sets the minimum TLS version to be version 1.0 by default. TLS 1.0 is a legacy version and has known vulnerabilities. This minimum TLS version can be configured to be later protocols such as TLS 1.2.

Default Value

If a storage account is created through the portal, the MinimumTlsVersion property for that storage account will be set to TLS 1.2. If a storage account is created through PowerShell or CLI, the MinimumTlsVersion property for that storage account will not be set, and defaults to TLS 1.0.

Audit Procedure

From Azure Console 1. Login to Azure Portal using https://portal.azure.com 2. Go to Storage Accounts 3. Click on each Storage Account 4. Under Setting section, Click on Configuration 5. Ensure that the minimum TLS version is set to be Version 1.2 From Azure CLI Get a list of all storage accounts and their resource groups az storage account list | jq '.[] | {name, resourceGroup}' Then query the minimumTLSVersion field az storage account show \ --name <storage-account> \ --resource-group <resource-group> \ --query minimumTlsVersion \ --output tsv From Azure PowerShell To get the minimum TLS version, run the following command: (Get-AzStorageAccount -Name <STORAGEACCOUNTNAME> -ResourceGroupName <RESOURCEGROUPNAME>).MinimumTlsVersion 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: fe83a0eb-a853-422d-aac2-1bffd182c5d0 - Name: 'Storage accounts should have the specified minimum TLS version'

Impact Statement

When set to TLS 1.2 all requests must leverage this version of the protocol. Applications leveraging legacy versions of the protocol will fail.

Assessment Status

Automated

Rationale Statement

TLS 1.0 has known vulnerabilities and has been replaced by later versions of the TLS protocol. Continued use of this legacy protocol affects the security of data in transit.

Remediation Procedure

From Azure Console 1. Login to Azure Portal using https://portal.azure.com 2. Go to Storage Accounts 3. Click on each Storage Account 4. Under Setting section, Click on Configuration 5. Set the minimum TLS version to be Version 1.2 From Azure CLI az storage account update \ --name <storage-account> \ --resource-group <resource-group> \ --min-tls-version TLS1_2 From Azure PowerShell To set the minimum TLS version, run the following command: Set-AzStorageAccount -AccountName <STORAGEACCOUNTNAME> ` -ResourceGroupName <RESOURCEGROUPNAME> ` -MinimumTlsVersion TLS1_2

3.16Ensure 'Cross Tenant Replication' is not enabled0
Attributes
Profile

Level 1

Section

3 Storage Accounts

Description

Cross Tenant Replication in Azure allows data to be replicated across multiple Azure tenants. While this feature can be beneficial for data sharing and availability, it also poses a significant security risk if not properly managed. Unauthorized data access, data leakage, and compliance violations are potential risks. Disabling Cross Tenant Replication ensures that data is not inadvertently replicated across different tenant boundaries without explicit authorization.

Default Value

For new storage accounts created after Dec 15, 2023 cross tenant replication is not enabled.

Audit Procedure

From Azure Portal Login to the Azure Portal using https://portal.azure.com 1. Navigate to Storage Accounts 2. For each storage account, on the left blade under Data Management, click on Object replication 3. Select Advanced settings 3. Make sure Allow cross-tenant replication is not checked From Azure CLI az storage account list --query [*].[name,allowCrossTenantReplication] The value of false should be returned for each storage account listed. 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: 92a89a79-6c52-4a7e-a03f-61306fc49312 - Name: 'Storage accounts should prevent cross tenant object replication'

Impact Statement

Disabling Cross Tenant Replication may affect data availability and sharing across different Azure tenants. Ensure that this change aligns with your organizational data sharing and availability requirements.

Assessment Status

Automated

Rationale Statement

Disabling Cross Tenant Replication minimizes the risk of unauthorized data access and ensures that data governance policies are strictly adhered to. This control is especially critical for organizations with stringent data security and privacy requirements, as it prevents the accidental sharing of sensitive information.

Remediation Procedure

From Azure Portal 1. Navigate to Storage Accounts 1. For each storage account, on the left blade under Data Management, click on Object replication 1. Click on Advanced settings and untick Allow cross-tenant replication 1. Click on OK From Azure CLI Replace the information within <> with appropriate values: az storage account update --name <storageAccountName> --resource-group <resourceGroupName> --allow-cross-tenant-replication false

3.17Ensure that `Allow Blob Anonymous Access` is set to `Disabled`0
Attributes
Profile

Level 1

Section

3 Storage Accounts

Description

The Azure Storage setting ‘Allow Blob Anonymous Access’ (aka allowBlobPublicAccess) controls whether anonymous access is allowed for blob data in a storage account. When this property is set to True, it enables public read access to blob data, which can be convenient for sharing data but may carry security risks. When set to False, it disallows public access to blob data, providing a more secure storage environment.

Default Value

Disabled

Audit Procedure

From Azure Portal: 1. Open the Storage Accounts blade 1. Click on a Storage Account 1. In the storage account menu pane, under the Settings section, click Configuration. 1. Under Allow Blob Anonymous Access ensure that the selected setting is Disabled. Repeat these steps for each Storage Account. From Azure CLI: For every storage account in scope: az storage account show --Name <yourStorageAccountName> --query allowBlobPublicAccess Ensure that every storage account in scope returns false for the allowBlobPublicAccess setting. 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: 13502221-8df0-4414-9937-de9c5c4e396b - Name: 'Configure your Storage account public access to be disallowed'

Impact Statement

Additional consideration may be required for exceptional circumstances where elements of a storage account require public accessibility. In these circumstances, it is highly recommended that all data stored in the public facing storage account be reviewed for sensitive or potentially compromising data, and that sensitive or compromising data is never stored in these storage accounts.

Assessment Status

Automated

Rationale Statement

If Allow Blob Anonymous Access is enabled, blobs can be accessed by adding the blob name to the URL to see the contents. An attacker can enumerate a blob using methods, such as brute force, and access them. Exfiltration of data by brute force enumeration of items from a storage account may occur if this setting is set to 'Enabled'.

Remediation Procedure

From Azure Portal: 1. Open the Storage Accounts blade 1. Click on a Storage Account 1. In the storage account menu pane, under the Settings section, click Configuration. 1. Under Allow Blob Anonymous Access, select Disabled. Repeat these steps for each Storage Account. From Powershell: For every storage account in scope, run the following: $storageAccount = Get-AzStorageAccount -ResourceGroupName <yourResourceGroup> -Name <yourStorageAccountName> $storageAccount.AllowBlobPublicAccess = $false Set-AzStorageAccount -InputObject $storageAccount

Additional Information

Azure Storage accounts that use the classic deployment model will be retired on August 31, 2024.

4 Database Services2120
4.1.1Ensure that 'Auditing' is set to 'On'1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.1 SQL Server - Auditing

Description

Enable auditing on SQL Servers.

Default Value

By default, Enable Azure SQL Auditing is set to Off.

Audit Procedure

From Azure Portal 1. Go to SQL servers 2. For each server instance 3. Click on Auditing 4. Ensure that Enable Azure SQL Auditing is set to On From PowerShell Get the list of all SQL Servers Get-AzSqlServer For each Server Get-AzSqlServerAudit -ResourceGroupName <ResourceGroupName> -ServerName <SQLServerName> Ensure that BlobStorageTargetState, EventHubTargetState, or LogAnalyticsTargetState is set to Enabled. 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: a6fb4358-5bf4-4ad7-ba82-2cd2f41ce5e9 - Name: 'Auditing on SQL server should be enabled'

Assessment Status

Automated

Rationale Statement

The Azure platform allows a SQL server to be created as a service. Enabling auditing at the server level ensures that all existing and newly created databases on the SQL server instance are audited. Auditing policy applied on the SQL database does not override auditing policy and settings applied on the particular SQL server where the database is hosted. Auditing tracks database events and writes them to an audit log in the Azure storage account. It also helps to maintain regulatory compliance, understand database activity, and gain insight into discrepancies and anomalies that could indicate business concerns or suspected security violations.

Remediation Procedure

From Azure Portal 1. Go to SQL servers 2. Select the SQL server instance 3. Under Security, click Auditing 4. Click the toggle next to Enable Azure SQL Auditing 5. Select an Audit log destination 6. Click Save From PowerShell Get the list of all SQL Servers Get-AzSqlServer For each Server, enable auditing and set the retention for at least 90 days. Log Analytics Example Set-AzSqlServerAudit -ResourceGroupName <resource group name> -ServerName <SQL Server name> -RetentionInDays <Number of Days to retain the audit logs, should be 90days minimum> -LogAnalyticsTargetState Enabled -WorkspaceResourceId /subscriptions/<subscription ID>/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/<workspace name> Event Hub Example Set-AzSqlServerAudit -ResourceGroupName <resource group name> -ServerName <SQL Server name> -EventHubTargetState Enabled -EventHubName <Event Hub name> -EventHubAuthorizationRuleResourceId <Event Hub Authorization Rule Resource ID> Blob Storage Example* Set-AzSqlServerAudit -ResourceGroupName <resource group name> -ServerName <SQL Server name> -BlobStorageTargetState Enabled -StorageAccountResourceId /subscriptions/<subscription_ID>/resourceGroups/<Resource_Group>/providers/Microsoft.Stora ge/storageAccounts/<Storage Account name>

Additional Information
  • A server policy applies to all existing and newly created databases on the server. - If server blob auditing is enabled, it always applies to the database. The database will be audited, regardless of the database auditing settings. Auditing type table is already deprecated leaving only type blob available. - Enabling blob auditing on the database, in addition to enabling it on the server, does not override or change any of the settings of the server blob auditing. Both audits will exist side by side. In other words, the database is audited twice in parallel; once by the server policy and once by the database policy.
4.1.2Ensure no Azure SQL Databases allow ingress from 0.0.0.0/0 (ANY IP)1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.1 SQL Server - Auditing

Description

Ensure that no SQL Databases allow ingress from 0.0.0.0/0 (ANY IP).

Default Value

By default, Allow access to Azure Services is set to NO.

Audit Procedure

From Azure Portal 1. Go to SQL servers 2. For each SQL server 3. Click on Networking 4. Ensure that Allow Azure services and resources to access this server is Unchecked 5. Ensure that no firewall rule exists with - Start IP of 0.0.0.0 - or other combinations which allows access to wider public IP ranges From Azure CLI List all SQL servers az sql server list For each SQL server run the following command az sql server firewall-rule list --resource-group <resource group name> --server <sql server name> Ensure the output does not contain any firewall allow rules with a source of 0.0.0.0, or any rules named AllowAllWindowsAzureIps From PowerShell Get the list of all SQL Servers Get-AzSqlServer For each Server Get-AzSqlServerFirewallRule -ResourceGroupName <resource group name> -ServerName <server name> Ensure that StartIpAddress is not set to 0.0.0.0, /0 or other combinations which allows access to wider public IP ranges including Windows Azure IP ranges. Also ensure that FirewallRuleName doesn't contain AllowAllWindowsAzureIps which is the rule created when the Allow Azure services and resources to access this server setting is enabled for that SQL Server. 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: 1b8ca024-1d5c-4dec-8995-b1a932b41780 - Name: 'Public network access on Azure SQL Database should be disabled'

Impact Statement

Disabling Allow Azure services and resources to access this server will break all connections to SQL server and Hosted Databases unless custom IP specific rules are added in Firewall Policy.

Assessment Status

Automated

Rationale Statement

Azure SQL Server includes a firewall to block access to unauthorized connections. More granular IP addresses can be defined by referencing the range of addresses available from specific datacenters. By default, for a SQL server, a Firewall exists with StartIp of 0.0.0.0 and EndIP of 0.0.0.0 allowing access to all the Azure services. Additionally, a custom rule can be set up with StartIp of 0.0.0.0 and EndIP of 255.255.255.255 allowing access from ANY IP over the Internet. In order to reduce the potential attack surface for a SQL server, firewall rules should be defined with more granular IP addresses by referencing the range of addresses available from specific datacenters.

Remediation Procedure

From Azure Portal 1. Go to SQL servers 2. For each SQL server 3. Click on Networking 4. Uncheck the checkbox for Allow Azure services and resources to access this server 5. Set firewall rules to limit access to only authorized connections From Azure CLI Disable default firewall rule Allow access to Azure services: az sql server firewall-rule delete --resource-group <resource group> --server <sql server name> --name AllowAllWindowsAzureIps Remove a custom firewall rule: az sql server firewall-rule delete --resource-group <resource group> --server <sql server name> --name <firewall rule name> Create a firewall rule: az sql server firewall-rule create --resource-group <resource group> --server <sql server name> --name <firewall rule name> --start-ip-address <IP Address other than 0.0.0.0> --end-ip-address <IP Address other than 0.0.0.0 or 255.255.255.255> Update a firewall rule: az sql server firewall-rule update --resource-group <resource group> --server <sql server name> --name <firewall rule name> --start-ip-address <IP Address other than 0.0.0.0> --end-ip-address <IP Address other than 0.0.0.0 or 255.255.255.255> From PowerShell Disable Default Firewall Rule Allow access to Azure services : Remove-AzSqlServerFirewallRule -FirewallRuleName AllowAllWindowsAzureIps -ResourceGroupName <resource group name> -ServerName <server name> Remove a custom Firewall rule: Remove-AzSqlServerFirewallRule -FirewallRuleName <firewall rule name> -ResourceGroupName <resource group name> -ServerName <server name> Set the appropriate firewall rules: Set-AzSqlServerFirewallRule -ResourceGroupName <resource group name> -ServerName <server name> -FirewallRuleName <firewall rule name> -StartIpAddress <IP Address other than 0.0.0.0> -EndIpAddress <IP Address other than 0.0.0.0 or 255.255.255.255>

Additional Information

Firewall rules configured on individual SQL Database using Transact-sql overrides the rules set on SQL server. Azure does not provide any Powershell, API, CLI, Portal option to check database level firewall rules, and so far Transact-SQL is the only way to check for the same. For comprehensive control over egress traffic on SQL Databases, Firewall rules should be checked using SQL client.

4.1.3Ensure SQL server's Transparent Data Encryption (TDE) protector is encrypted with Customer-managed key1
Attributes
Profile

Level 2

Section

4 Database Services

Sub Section

4.1 SQL Server - Auditing

Description

Transparent Data Encryption (TDE) with Customer-managed key support provides increased transparency and control over the TDE Protector, increased security with an HSM-backed external service, and promotion of separation of duties. With TDE, data is encrypted at rest with a symmetric key (called the database encryption key) stored in the database or data warehouse distribution. To protect this data encryption key (DEK) in the past, only a certificate that the Azure SQL Service managed could be used. Now, with Customer-managed key support for TDE, the DEK can be protected with an asymmetric key that is stored in the Azure Key Vault. The Azure Key Vault is a highly available and scalable cloud-based key store which offers central key management, leverages FIPS 140-2 Level 2 validated hardware security modules (HSMs), and allows separation of management of keys and data for additional security. Based on business needs or criticality of data/databases hosted on a SQL server, it is recommended that the TDE protector is encrypted by a key that is managed by the data owner (Customer-managed key).

Default Value

By Default, Microsoft managed TDE protector is enabled for a SQL server.

Audit Procedure

From Azure Portal 1. Go to SQL servers For the desired server instance 2. Click On Transparent data encryption 3. Ensure that Customer-managed key is selected 4. Ensure Make selected key the default TDE protector is checked From Azure CLI az account get-access-token --query {subscripton:subscription,accessToken:accessToken} --out tsv | xargs -L1 bash -c 'curl -X GET -H Authorization: Bearer $1 -H Content-Type: application/json https://management.azure.com/subscriptions/$0/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector?api-version=2015-05-01-preview' Ensure the output of the command contains properties kind set to azurekeyvault serverKeyType set to AzureKeyVault uri is not null From PowerShell Get-AzSqlServerTransparentDataEncryptionProtector -ServerName <ServerName> -ResourceGroupName <ResourceGroupName> Ensure the output of the command contains properties Type set to AzureKeyVault ServerKeyVaultKeyName set to KeyVaultName_KeyName_KeyIdentifierVersion KeyId set to KeyIdentifier 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: 0a370ff3-6cab-4e85-8995-295fd854c5b8 - Name: 'SQL servers should use customer-managed keys to encrypt data at rest' - Policy ID: ac01ad65-10e5-46df-bdd9-6b0cad13e1d2 - Name: 'SQL managed instances should use customer-managed keys to encrypt data at rest'

Impact Statement

Once TDE protector is encrypted with a Customer-managed key, it transfers entire responsibility of respective key management on to you, and hence you should be more careful about doing any operations on the particular key in order to keep data from corresponding SQL server and Databases hosted accessible. When deploying Customer Managed Keys, it is prudent to ensure that you also deploy an automated toolset for managing these keys (this should include discovery and key rotation), and Keys should be stored in an HSM or hardware backed keystore, such as Azure Key Vault. As far as toolsets go, check with your cryptographic key provider, as they may well provide one as an add-on to their service.

Assessment Status

Automated

Rationale Statement

Customer-managed key support for Transparent Data Encryption (TDE) allows user control of TDE encryption keys and restricts who can access them and when. Azure Key Vault, Azure’s cloud-based external key management system, is the first key management service where TDE has integrated support for Customer-managed keys. With Customer-managed key support, the database encryption key is protected by an asymmetric key stored in the Key Vault. The asymmetric key is set at the server level and inherited by all databases under that server.

Remediation Procedure

From Azure Console 1. Go to SQL servers For the desired server instance 2. Click On Transparent data encryption 3. Set Transparent data encryption to Customer-managed key 4. Browse through your key vaults to Select an existing key or create a new key in the Azure Key Vault. 5. Check Make selected key the default TDE protector From Azure CLI Use the below command to encrypt SQL server's TDE protector with a Customer-managed key az sql server tde-key set --resource-group <resourceName> --server <dbServerName> --server-key-type {AzureKeyVault} --kid <keyIdentifier> From PowerShell Use the below command to encrypt SQL server's TDE protector with a Customer-managed Key Vault key Set-AzSqlServerTransparentDataEncryptionProtector -Type AzureKeyVault -KeyId <KeyIdentifier> -ServerName <ServerName> -ResourceGroupName <ResourceGroupName> Select Y when prompted

Additional Information
  • This configuration is audited or can be done only on SQL server. The same configuration will be in effect on SQL Databases hosted on SQL Server. - Ensuring TDE is protected by a Customer-managed key on SQL Server does not ensure the encryption of SQL Databases. Transparent Data Encryption : Data Encryption (ON/OFF) setting on individual SQL Database decides whether database is encrypted or not.
4.1.4Ensure that Microsoft Entra authentication is Configured for SQL Servers1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.1 SQL Server - Auditing

Description

Use Microsoft Entra authentication for authentication with SQL Database to manage credentials in a single place.

Default Value

Entra ID Authentication for SQL Database/Server is not enabled by default

Audit Procedure

From Azure Portal 1. Go to SQL servers 2. For each SQL server, click on Microsoft Entra admin under the Settings section 3. Ensure that a value has been set for Admin Name under the Microsoft Entra admin section From Azure CLI To list SQL Server Admins on a specific server: az sql server ad-admin list --resource-group <resource-group> --server <server> From PowerShell Print a list of all SQL Servers to find which one you want to audit Get-AzSqlServer Audit a list of Administrators on a Specific Server Get-AzSqlServerActiveDirectoryAdministrator -ResourceGroupName <resource group name> -ServerName <server name> Ensure Output shows DisplayName set to AD account. 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: 1f314764-cb73-4fc9-b863-8eca98ac36e9 - Name: 'An Azure Active Directory administrator should be provisioned for SQL servers'

Impact Statement

This will create administrative overhead with user account and permission management. For further security on these administrative accounts, you may want to consider licensing which supports features like Multi Factor Authentication.

Assessment Status

Automated

Rationale Statement

Microsoft Entra authentication is a mechanism to connect to Microsoft Azure SQL Database and SQL Data Warehouse by using identities in the Microsoft Entra ID directory. With Entra ID authentication, identities of database users and other Microsoft services can be managed in one central location. Central ID management provides a single place to manage database users and simplifies permission management. - It provides an alternative to SQL Server authentication. - Helps stop the proliferation of user identities across database servers. - Allows password rotation in a single place. - Customers can manage database permissions using external (Entra ID) groups. - It can eliminate storing passwords by enabling integrated Windows authentication and other forms of authentication supported by Microsoft Entra. - Entra ID authentication uses contained database users to authenticate identities at the database level. - Entra ID supports token-based authentication for applications connecting to SQL Database. - Entra ID authentication supports ADFS (domain federation) or native user/password authentication for a local Active Directory without domain synchronization. - Entra ID supports connections from SQL Server Management Studio that use Active Directory Universal Authentication, which includes Multi-Factor Authentication (MFA). MFA includes strong authentication with a range of easy verification options — phone call, text message, smart cards with pin, or mobile app notification.

Remediation Procedure

From Azure Portal 1. Go to SQL servers 2. For each SQL server, click on Microsoft Entra admin 3. Click on Set admin 4. Select an admin 5. Click Save From Azure CLI az ad user show --id For each Server, set AD Admin az sql server ad-admin create --resource-group <resource group name> --server <server name> --display-name <display name> --object-id <object id of user> From PowerShell For each Server, set Entra ID Admin Set-AzSqlServerActiveDirectoryAdministrator -ResourceGroupName <resource group name> -ServerName <server name> -DisplayName <Display name of AD account to set as DB administrator>

Additional Information

NOTE - Assigning an Administrator in Entra ID is just the first step. When using Entra ID for central authentication there are many other groups and roles that need to be configured base on the needs of your organization. The How-to Guides should be used to determine what roles should be assigned and what groups should be created to manage permissions and access to resources.

4.1.5Ensure that 'Data encryption' is set to 'On' on a SQL Database1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.1 SQL Server - Auditing

Description

Enable Transparent Data Encryption on every SQL server.

Default Value

By default, Data encryption is set to On.

Audit Procedure

From Azure Portal 1. Go to SQL databases 2. For each DB instance 3. Click on Transparent data encryption 4. Ensure that Data encryption is set to On From Azure CLI Ensure the output of the below command is Enabled az sql db tde show --resource-group <resourceGroup> --server <dbServerName> --database <dbName> --query status From PowerShell Get a list of SQL Servers. Get-AzSqlServer For each server, list the databases. Get-AzSqlDatabase -ServerName <SQL Server Name> -ResourceGroupName <Resource Group Name> For each database not listed as a Master database, check for Transparent Data Encryption. Get-AzSqlDatabaseTransparentDataEncryption -ResourceGroupName <Resource Group Name> -ServerName <SQL Server Name> -DatabaseName <Database Name> Make sure DataEncryption is Enabled for each database except the Master database. 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: 17k78e20-9358-41c9-923c-fb736d382a12 - Name: 'Transparent Data Encryption on SQL databases should be enabled'

Assessment Status

Automated

Rationale Statement

Azure SQL Database transparent data encryption helps protect against the threat of malicious activity by performing real-time encryption and decryption of the database, associated backups, and transaction log files at rest without requiring changes to the application.

Remediation Procedure

From Azure Portal 1. Go to SQL databases 2. For each DB instance 3. Click on Transparent data encryption 4. Set Data encryption to On From Azure CLI Use the below command to enable Transparent data encryption for SQL DB instance. az sql db tde set --resource-group <resourceGroup> --server <dbServerName> --database <dbName> --status Enabled From PowerShell Use the below command to enable Transparent data encryption for SQL DB instance. Set-AzSqlDatabaseTransparentDataEncryption -ResourceGroupName <Resource Group Name> -ServerName <SQL Server Name> -DatabaseName <Database Name> -State 'Enabled' Note: - TDE cannot be used to encrypt the logical master database in SQL Database. The master database contains objects that are needed to perform the TDE operations on the user databases. - Azure Portal does not show master databases per SQL server. However, CLI/API responses will show master databases.

Additional Information
  • Transparent Data Encryption (TDE) can be enabled or disabled on individual SQL Database level and not on the SQL Server level. - TDE cannot be used to encrypt the logical master database in SQL Database. The master database contains objects that are needed to perform the TDE operations on the user databases.
4.1.6Ensure that 'Auditing' Retention is 'greater than 90 days'1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.1 SQL Server - Auditing

Description

SQL Server Audit Retention should be configured to be greater than 90 days.

Default Value

By default, SQL Server audit storage is disabled.

Audit Procedure

From Azure Portal 1. Go to SQL servers 2. For each server instance 3. Click on Auditing 4. If storage is selected, expand Advanced properties 5. Ensure Retention (days) setting is greater than 90 days or 0 for unlimited retention. From PowerShell Get the list of all SQL Servers Get-AzSqlServer For each Server Get-AzSqlServerAudit -ResourceGroupName <resource group name> -ServerName <server name> Ensure that RetentionInDays is set to more than 90 Note: If the SQL server is set with LogAnalyticsTargetState setting set to Enabled, run the following additional command. Get-AzOperationalInsightsWorkspace | Where-Object {$_.ResourceId -eq <SQL Server WorkSpaceResourceId>} Ensure that RetentionInDays is set to more than 90 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: 89099bee-89e0-4b26-a5f4-165451757743 - Name: 'SQL servers with auditing to storage account destination should be configured with 90 days retention or higher'

Assessment Status

Automated

Rationale Statement

Audit Logs can be used to check for anomalies and give insight into suspected breaches or misuse of information and access.

Remediation Procedure

From Azure Portal 1. Go to SQL servers 2. For each server instance 3. Click on Auditing 4. If storage is selected, expand Advanced properties 5. Set the Retention (days) setting greater than 90 days or 0 for unlimited retention. 6. Select Save From PowerShell For each Server, set retention policy to more than 90 days Log Analytics Example Set-AzSqlServerAudit -ResourceGroupName <resource group name> -ServerName <SQL Server name> -RetentionInDays <Number of Days to retain the audit logs, should be more than 90 days> -LogAnalyticsTargetState Enabled -WorkspaceResourceId /subscriptions/<subscription ID>/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/<workspace name> Event Hub Example Set-AzSqlServerAudit -ResourceGroupName <resource group name> -ServerName <SQL Server name> -EventHubTargetState Enabled -EventHubName <Event Hub name> -EventHubAuthorizationRuleResourceId <Event Hub Authorization Rule Resource ID> Blob Storage Example Set-AzSqlServerAudit -ResourceGroupName <resource group name> -ServerName <SQL Server name> -BlobStorageTargetState Enabled -StorageAccountResourceId /subscriptions/<subscription_ID>/resourceGroups/<Resource_Group>/providers/Microsoft.Stora ge/storageAccounts/<Storage Account name>

4.3.1Ensure 'Enforce SSL connection' is set to 'ENABLED' for PostgreSQL Database Server1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.3 PostgreSQL Database Server. Storage Accounts

Description

Enable SSL connection on PostgreSQL Servers.

Default Value

By default, secure connectivity is enforced, but some application frameworks may not enable it during deployment.

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to Azure Database for PostgreSQL server 3. For each database, click on Connection security 4. In SSL settings, ensure Enforce SSL connection is set to ENABLED. From Azure CLI Ensure the output of the below command returns Enabled. az postgres server show --resource-group myresourcegroup --name <resourceGroupName> --query sslEnforcement From PowerShell Ensure the output of the below command returns Enabled. Get-AzPostgreSqlServer -ResourceGroupName <ResourceGroupName > -ServerName <ServerName> | Select-Object SslEnforcement 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: d158790f-bfb0-486c-8631-2dc6b4e8e6af - Name: 'Enforce SSL connection should be enabled for PostgreSQL database servers'

Assessment Status

Automated

Rationale Statement

SSL connectivity helps to provide a new layer of security by connecting database server to client applications using Secure Sockets Layer (SSL). Enforcing SSL connections between database server and client applications helps protect against man in the middle attacks by encrypting the data stream between the server and application.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to Azure Database for PostgreSQL server 3. For each database, click on Connection security 4. In SSL settings, click on ENABLED to enforce SSL connections 5. Click Save From Azure CLI Use the below command to enforce ssl connection for PostgreSQL Database. az postgres server update --resource-group <resourceGroupName> --name <serverName> --ssl-enforcement Enabled From PowerShell Update-AzPostgreSqlServer -ResourceGroupName <ResourceGroupName > -ServerName <ServerName> -SslEnforcement Enabled

4.3.2Ensure Server Parameter 'log_checkpoints' is set to 'ON' for PostgreSQL Database Server1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.3 PostgreSQL Database Server. Storage Accounts

Description

Enable log_checkpoints on PostgreSQL Servers.

Default Value

By default log_checkpoints is enabled (set to on).

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu. 1. Go to Azure Database for PostgreSQL servers. 1. For each database, click on Server parameters. 1. Search for log_checkpoints. 1. Ensure that value is set to ON. From Azure CLI Ensure value is set to ON az postgres server configuration show --resource-group <resourceGroupName> --server-name <serverName> --name log_checkpoints From PowerShell Ensure value is set to ON Get-AzPostgreSqlConfiguration -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -Name log_checkpoints 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: eb6f77b9-bd53-4e35-a23d-7f65d5f0e43d - Name: 'Log checkpoints should be enabled for PostgreSQL database servers'

Assessment Status

Automated

Rationale Statement

Enabling log_checkpoints helps the PostgreSQL Database to Log each checkpoint in turn generates query and error logs. However, access to transaction logs is not supported. Query and error logs can be used to identify, troubleshoot, and repair configuration errors and sub-optimal performance.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu. 1. Go to Azure Database for PostgreSQL servers. 1. For each database, click on Server parameters. 1. Search for log_checkpoints. 1. Click ON and save. From Azure CLI Use the below command to update log_checkpoints configuration. az postgres server configuration set --resource-group <resourceGroupName> --server-name <serverName> --name log_checkpoints --value on From PowerShell Update-AzPostgreSqlConfiguration -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -Name log_checkpoints -Value on

4.3.3Ensure server parameter 'log_connections' is set to 'ON' for PostgreSQL Database Server1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.3 PostgreSQL Database Server. Storage Accounts

Description

Enable log_connections on PostgreSQL Servers.

Default Value

By default log_connections is enabled (set to on).

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com. 2. Go to Azure Database for PostgreSQL servers. 3. For each database, click on Server parameters. 4. Search for log_connections. 5. Ensure that value is set to ON. From Azure CLI Ensure log_connections value is set to ON az postgres server configuration show --resource-group <resourceGroupName> --server-name <serverName> --name log_connections From PowerShell Ensure log_connections value is set to ON Get-AzPostgreSqlConfiguration -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -Name log_connections 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: eb6f77b9-bd53-4e35-a23d-7f65d5f0e442 - Name: 'Log connections should be enabled for PostgreSQL database servers'

Assessment Status

Automated

Rationale Statement

Enabling log_connections helps PostgreSQL Database to log attempted connection to the server, as well as successful completion of client authentication. Log data can be used to identify, troubleshoot, and repair configuration errors and suboptimal performance.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com. 2. Go to Azure Database for PostgreSQL servers. 3. For each database, click on Server parameters. 4. Search for log_connections. 5. Click ON and save. From Azure CLI Use the below command to update log_connections configuration. az postgres server configuration set --resource-group <resourceGroupName> --server-name <serverName> --name log_connections --value on From PowerShell Use the below command to update log_connections configuration. Update-AzPostgreSqlConfiguration -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -Name log_connections -Value on

4.3.4Ensure server parameter 'log_disconnections' is set to 'ON' for PostgreSQL Database Server1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.3 PostgreSQL Database Server. Storage Accounts

Description

Enable log_disconnections on PostgreSQL Servers.

Default Value

By default log_disconnections is disabled (set to off).

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 1. Go to Azure Database for PostgreSQL servers 1. For each database, click on Server parameters 1. Search for log_disconnections. 1. Ensure that value is set to ON. From Azure CLI Ensure log_disconnections value is set to ON az postgres server configuration show --resource-group <resourceGroupName> --server-name <serverName> --name log_disconnections From PowerShell Ensure log_disconnections value is set to ON Get-AzPostgreSqlConfiguration -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -Name log_disconnections 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: eb6f77b9-bd53-4e35-a23d-7f65d5f0e446 - Name: 'Disconnections should be logged for PostgreSQL database servers.'

Impact Statement

Enabling this setting will enable a log of all disconnections. If this is enabled for a high traffic server, the log may grow exponentially.

Assessment Status

Automated

Rationale Statement

Enabling log_disconnections helps PostgreSQL Database to Logs end of a session, including duration, which in turn generates query and error logs. Query and error logs can be used to identify, troubleshoot, and repair configuration errors and sub-optimal performance.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu 2. Go to Azure Database for PostgreSQL servers 3. For each database, click on Server parameters 4. Search for log_disconnections. 5. Click ON and save. From Azure CLI Use the below command to update log_disconnections configuration. az postgres server configuration set --resource-group <resourceGroupName> --server-name <serverName> --name log_disconnections --value on From PowerShell Use the below command to update log_disconnections configuration. Update-AzPostgreSqlConfiguration -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -Name log_disconnections -Value on

4.3.5Ensure server parameter 'connection_throttling' is set to 'ON' for PostgreSQL Database Server1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.3 PostgreSQL Database Server. Storage Accounts

Description

Enable connection_throttling on PostgreSQL Servers.

Default Value

By default, connection_throttling is enabled (set to on).

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com. 2. Go to Azure Database for PostgreSQL servers. 3. For each database, click on Server parameters. 4. Search for connection_throttling. 5. Ensure that value is set to ON. From Azure CLI Ensure connection_throttling value is set to ON az postgres server configuration show --resource-group <resourceGroupName> --server-name <serverName> --name connection_throttling From PowerShell Ensure connection_throttling value is set to ON Get-AzPostgreSqlConfiguration -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -Name connection_throttling 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: 5345bb39-67dc-4960-a1bf-427e16b9a0bd - Name: 'Connection throttling should be enabled for PostgreSQL database servers'

Assessment Status

Automated

Rationale Statement

Enabling connection_throttling helps the PostgreSQL Database to Set the verbosity of logged messages. This in turn generates query and error logs with respect to concurrent connections that could lead to a successful Denial of Service (DoS) attack by exhausting connection resources. A system can also fail or be degraded by an overload of legitimate users. Query and error logs can be used to identify, troubleshoot, and repair configuration errors and sub-optimal performance.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com. 2. Go to Azure Database for PostgreSQL servers. 3. For each database, click on Server parameters. 4. Search for connection_throttling. 5. Click ON and save. From Azure CLI Use the below command to update connection_throttling configuration. az postgres server configuration set --resource-group <resourceGroupName> --server-name <serverName> --name connection_throttling --value on From PowerShell Use the below command to update connection_throttling configuration. Update-AzPostgreSqlConfiguration -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -Name connection_throttling -Value on

4.3.6Ensure Server Parameter 'log_retention_days' is greater than 3 days for PostgreSQL Database Server1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.3 PostgreSQL Database Server. Storage Accounts

Description

Ensure log_retention_days on PostgreSQL Servers is set to an appropriate value.

Default Value

By default log_retention_days is set to 3.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu. 1. Go to Azure Database for PostgreSQL servers. 1. For each database, click on Server parameters. 1. Search for log_retention_days. 1. Ensure that the value is between 4 and 7 (inclusive). From Azure CLI Ensure log_retention_days value is greater than 3. az postgres server configuration show --resource-group <resourceGroupName> --server-name <serverName> --name log_retention_days From Powershell Ensure log_retention_days value is greater than 3. Get-AzPostgreSqlConfiguration -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -Name log_retention_days 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: eb6f77b9-bd53-4e35-a23d-7f65d5f0e8f3 - Name: 'Log duration should be enabled for PostgreSQL database servers' - Policy ID: 5e1de0e3-42cb-4ebc-a86d-61d0c619ca48 - Name: 'Public network access should be disabled for PostgreSQL flexible servers'

Impact Statement

Configuring this setting will result in logs being retained for the specified number of days. If this is configured on a high traffic server, the log may grow quickly to occupy a large amount of disk space. In this case you may want to set this to a lower number.

Assessment Status

Automated

Rationale Statement

Configuring log_retention_days determines the duration in days that Azure Database for PostgreSQL retains log files. Query and error logs can be used to identify, troubleshoot, and repair configuration errors and sub-optimal performance.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu. 1. Go to Azure Database for PostgreSQL servers. 1. For each database, click on Server parameters. 1. Search for log_retention_days. 1. Input a value between 4 and 7 (inclusive) and click Save. From Azure CLI Use the below command to update log_retention_days configuration. az postgres server configuration set --resource-group <resourceGroupName> --server-name <serverName> --name log_retention_days --value <4-7> From Powershell Use the below command to update log_retention_days configuration. Update-AzPostgreSqlConfiguration -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -Name log_retention_days -Value <4-7>

4.3.7Ensure 'Allow access to Azure services' for PostgreSQL Database Server is disabled1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.3 PostgreSQL Database Server. Storage Accounts

Description

Disable access from Azure services to PostgreSQL Database Server.

Default Value

The Azure Postgres firewall is set to block all access by default.

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com. 1. Go to Azure Database for PostgreSQL servers. 1. For each database, click on Connection security. 1. Under Firewall rules, ensure Allow access to Azure services is set to No. From Azure CLI Ensure the output of the below command does not include a rule with the name AllowAllWindowsAzureIps or startIpAddress: 0.0.0.0 or endIpAddress: 0.0.0.0, az postgres server firewall-rule list --resource-group <resourceGroupName> --server <serverName> 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: b52376f7-9612-48a1-81cd-1ffe4b61032c - Name: 'Public network access should be disabled for PostgreSQL servers' - Policy ID: 5e1de0e3-42cb-4ebc-a86d-61d0c619ca48 - Name: 'Public network access should be disabled for PostgreSQL flexible servers'

Assessment Status

Automated

Rationale Statement

If access from Azure services is enabled, the server's firewall will accept connections from all Azure resources, including resources not in your subscription. This is usually not a desired configuration. Instead, set up firewall rules to allow access from specific network ranges or VNET rules to allow access from specific virtual networks.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com. 1. Go to Azure Database for PostgreSQL servers. 1. For each database, click on Connection security. 1. Under Firewall rules, set Allow access to Azure services to No. 1. Click Save. From Azure CLI Use the below command to delete the AllowAllWindowsAzureIps rule for PostgreSQL Database. az postgres server firewall-rule delete --name AllowAllWindowsAzureIps --resource-group <resourceGroupName> --server-name <serverName>

4.3.8Ensure 'Infrastructure double encryption' for PostgreSQL Database Server is 'Enabled'0
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.3 PostgreSQL Database Server. Storage Accounts

Description

Azure Database for PostgreSQL servers should be created with 'infrastructure double encryption' enabled.

Default Value

By Default, Double Encryption is disabled.

Audit Procedure

From Azure Portal 1. From Azure Home, click on more services. 2. Click on Databases. 3. Click on Azure Database for PostgreSQL servers. 4. Select the database by clicking on its name. 5. Under Security, click Data encryption. 6. Ensure that 'Infrastructure encryption enabled' is displayed and is 'checked'. From Azure CLI 1. Enter the command az postgres server configuration show --name <servername> --resource-group <resourcegroup> --query 'properties.infrastructureEncryption' -o tsv 2. Verify that Infrastructure encryption is enabled. 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: 24fba194-95d6-48c0-aea7-f65bf859c598 - Name: 'Infrastructure encryption should be enabled for Azure Database for PostgreSQL servers'

Impact Statement

The read and write speeds to the database will be impacted if both default encryption and Infrastructure Encryption are checked, as a secondary form of encryption requires more resource overhead for the cryptography of information. This cost is justified for information security. Customer managed keys are recommended for the most secure implementation, leading to overhead of key management. The key will also need to be backed up in a secure location, as loss of the key will mean loss of the information in the database.

Assessment Status

Automated

Rationale Statement

If Double Encryption is enabled, another layer of encryption is implemented at the hardware level before the storage or network level. Information will be encrypted before it is even accessed, preventing both interception of data in motion if the network layer encryption is broken and data at rest in system resources such as memory or processor cache. Encryption will also be in place for any backups taken of the database, so the key will secure access the data in all forms. For the most secure implementation of key based encryption, it is recommended to use a Customer Managed asymmetric RSA 2048 Key in Azure Key Vault.

Remediation Procedure

It is not possible to enable 'infrastructure double encryption' on an existing Azure Database for PostgreSQL server. The remediation steps detail the creation of a new Azure Database for PostgreSQL server with 'infrastructure double encryption' enabled. From Azure Portal 1. Go through the normal process of database creation. 2. On step 2 titled 'Additional settings' ensure that 'Infrastructure double encryption enabled' is 'checked'. 3. Acknowledge that you understand this will impact database performance. 4. Finish database creation as normal. From Azure CLI az postgres server create --resource-group <resourcegroup> --name <servername> --location <location> --admin-user <adminusername> --admin-password <server_admin_password> --sku-name GP_Gen4_2 --version 11 --infrastructure-encryption Enabled

Additional Information

Flexible PostgreSQL Database Servers are still in preview. A recommendation will be created for Flexible Servers once the service is out of preview.

4.4.1Ensure 'Enforce SSL connection' is set to 'Enabled' for Standard MySQL Database Server1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.4 MySQL Database

Description

Enable SSL connection on MYSQL Servers.

Default Value

Azure Database for MySQL when provisioned through the Azure portal or CLI will require SSL connections by default.

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to Azure Database for MySQL servers 3. For each database, click on Connection security 4. In SSL settings, ensure Enforce SSL connection is set to ENABLED. From Azure CLI Ensure the output of the below command returns ENABLED. az mysql server show --resource-group <resourceGroupName> --name <serverName> --query sslEnforcement 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: e802a67a-daf5-4436-9ea6-f6d821dd0c5d - Name: 'Enforce SSL connection should be enabled for MySQL database servers'

Assessment Status

Automated

Rationale Statement

SSL connectivity helps to provide a new layer of security by connecting database server to client applications using Secure Sockets Layer (SSL). Enforcing SSL connections between database server and client applications helps protect against man in the middle attacks by encrypting the data stream between the server and application.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to Azure Database for MySQL servers 3. For each database, click on Connection security 4. In SSL settings, click on ENABLED to Enforce SSL connections From Azure CLI Use the below command to set MYSQL Databases to Enforce SSL connection. az mysql server update --resource-group <resourceGroupName> --name <serverName> --ssl-enforcement Enabled

4.4.2Ensure 'TLS Version' is set to 'TLSV1.2' (or higher) for MySQL flexible Database Server1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.4 MySQL Database

Description

Ensure TLS version on MySQL flexible servers is set to use TLS version 1.2 or higher.

Default Value

By default, TLS is set to v1.2 for MySQL Flexible servers.

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to Azure Database for MySQL flexible servers 3. For each database, click on Server parameters under Settings 4. In the search box, type in tls_version 5. Ensure tls_version is set to TLSV1.2 (or higher) From Azure CLI Ensure the output of the below command contains the key value pair values: TLSV1.2 (or higher). az mysql flexible-server parameter show --name tls_version --resource-group <resourceGroupName> --server-name <serverName> Example output: { allowedValues: TLSv1,TLSv1.1,TLSv1.2, dataType: Set, defaultValue: TLSv1.2, description: Which protocols the server permits for encrypted connections. By default, TLS 1.2 is enforced, id: /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.DBforMySQL/flexibleServers/<serverName>/configurations/tls_version, isConfigPendingRestart: False, isDynamicConfig: False, isReadOnly: False, name: tls_version, resourceGroup: <resourceGroupName>, source: system-default, systemData: null, type: Microsoft.DBforMySQL/flexibleServers/configurations, value: TLSv1.2 } 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: 49e6f04d-fbc3-4ac3-9e84-6ae0eb5db024 - Name: 'Require Secure Transport should be enabled for MySQL flexible servers'

Assessment Status

Automated

Rationale Statement

TLS connectivity helps to provide a new layer of security by connecting database server to client applications using Transport Layer Security (TLS). Enforcing TLS connections between database server and client applications helps protect against man in the middle attacks by encrypting the data stream between the server and application.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to Azure Database for MySQL flexible servers 3. For each database, click on Server parameters under Settings 4. In the search box, type in tls_version 5. Click on the VALUE dropdown, and ensure only TLSV1.2 (or higher) is selected for tls_version From Azure CLI Use the below command to set MYSQL flexible databases to used version 1.2 for the tls_version parameter. az mysql flexible-server parameter set --name tls_version --resource-group <resourceGroupName> --server-name <serverName> --value TLSV1.2

4.4.3Ensure server parameter 'audit_log_enabled' is set to 'ON' for MySQL Database Server1
Attributes
Profile

Level 2

Section

4 Database Services

Sub Section

4.4 MySQL Database

Description

Enable audit_log_enabled on MySQL Servers.

Default Value

audit_log_enabled is set to OFF by default

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Select Azure Database for MySQL Servers 3. For each database, under the Settings section in the sidebar, select Server parameters 4. Ensure the audit_log_enabled parameter is set to ON

Impact Statement

There are further costs incurred for storage of logs. For high traffic databases these logs will be significant. Determine your organization's needs before enabling.

Assessment Status

Manual

Rationale Statement

Enabling audit_log_enabled helps MySQL Database to log items such as connection attempts to the server, DDL/DML access, and more. Log data can be used to identify, troubleshoot, and repair configuration errors and suboptimal performance.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com. 2. Select Azure Database for MySQL Servers. 3. Select a database. 4. Under Settings, select Server parameters. 5. Update audit_log_enabled parameter to ON 6. Under Monitoring, select Diagnostic settings. 7. Select + Add diagnostic setting. 8. Provide a diagnostic setting name. 9. Under Categories, select MySQL Audit Logs. 10. Specify destination details. 11. Click Save. It may take up to 10 minutes for the logs to appear in the configured destination.

Additional Information

There is also a CLI version: https://docs.microsoft.com/en-us/azure/mysql/single-server/how-to-configure-audit-logs-cli There are numerous settings and event types and it might be helpful to discuss which of these may be appropriate to have a separate check item for.

4.4.4Ensure server parameter 'audit_log_events' has 'CONNECTION' set for MySQL Database Server1
Attributes
Profile

Level 2

Section

4 Database Services

Sub Section

4.4 MySQL Database

Description

Set audit_log_enabled to include CONNECTION on MySQL Servers.

Default Value

By default audit_log_events is disabled.

Audit Procedure

From Azure Portal 1. From Azure Home select the Portal Menu. 2. Select Azure Database for MySQL servers. 3. Select a database. 4. Under Settings, select Server parameters. 4. Ensure audit_log_enabled parameter is set to ON. 5. Ensure audit_log_events parameter has CONNECTION checked.

Impact Statement

There are further costs incurred for storage of logs. For high traffic databases these logs will be significant. Determine your organization's needs before enabling.

Assessment Status

Manual

Rationale Statement

Enabling CONNECTION helps MySQL Database to log items such as successful and failed connection attempts to the server. Log data can be used to identify, troubleshoot, and repair configuration errors and suboptimal performance.

Remediation Procedure

From Azure Portal 1. From Azure Home select the Portal Menu. 2. Select Azure Database for MySQL servers. 3. Select a database. 4. Under Settings, select Server parameters. 5. Update audit_log_enabled parameter to ON. 6. Update audit_log_events parameter to have at least CONNECTION checked. 7. Click Save. 8. Under Monitoring, select Diagnostic settings. 9. Select + Add diagnostic setting. 10. Provide a diagnostic setting name. 11. Under Categories, select MySQL Audit Logs. 12. Specify destination details. 13. Click Save. It may take up to 10 minutes for the logs to appear in the configured destination.

Additional Information

There is also a CLI version: https://docs.microsoft.com/en-us/azure/mysql/single-server/how-to-configure-audit-logs-cli

4.5.1Ensure That 'Firewalls & Networks' Is Limited to Use Selected Networks Instead of All Networks1
Attributes
Profile

Level 2

Section

4 Database Services

Sub Section

4.5 Cosmos DB

Description

Limiting your Cosmos DB to only communicate on whitelisted networks lowers its attack footprint.

Default Value

By default, Cosmos DBs are set to have access all networks.

Audit Procedure

From Azure Portal 1. Open the portal menu. 2. Select the Azure Cosmos DB blade 3. Select a Cosmos DB to audit. 4. Select Networking. 5. Under Public network access, ensure Selected networks is selected. 6. Under Virtual networks, ensure appropriate virtual networks are configured. From Azure CLI Retrieve a list of all CosmosDB database names: az cosmosdb list For each database listed, run the following command: az cosmosdb show <database id> For each database, ensure that isVirtualNetworkFilterEnabled is set to true 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: 862e97cf-49fc-4a5c-9de4-40d4e2e7c8eb - Name: 'Azure Cosmos DB accounts should have firewall rules'

Impact Statement

Failure to whitelist the correct networks will result in a connection loss.

Assessment Status

Automated

Rationale Statement

Selecting certain networks for your Cosmos DB to communicate restricts the number of networks including the internet that can interact with what is stored within the database.

Remediation Procedure

From Azure Portal 1. Open the portal menu. 2. Select the Azure Cosmos DB blade. 3. Select a Cosmos DB account to audit. 4. Select Networking. 5. Under Public network access, select Selected networks. 6. Under Virtual networks, select + Add existing virtual network or + Add a new virtual network. 7. For existing networks, select subscription, virtual network, subnet and click Add. For new networks, provide a name, update the default values if required, and click Create. 8. Click Save.

4.5.2Ensure That Private Endpoints Are Used Where Possible1
Attributes
Profile

Level 2

Section

4 Database Services

Sub Section

4.5 Cosmos DB

Description

Private endpoints limit network traffic to approved sources.

Default Value

By default Cosmos DB does not have private endpoints enabled and its traffic is public to the network.

Audit Procedure

From Azure Portal 1. Open the portal menu. 2. Select the Azure Cosmos DB blade. 3. Select the Azure Cosmos DB account. 4. Select Networking. 5. Ensure Public network access is set to Selected networks. 6. Ensure the listed networks are set appropriately. 7. Select Private access. 8. Ensure a private endpoint exists and Connection state is Approved. 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: 58440f8a-10c5-4151-bdce-dfbaad4a20b7 - Name: 'CosmosDB accounts should use private link'

Impact Statement

Only whitelisted services will have access to communicate with the Cosmos DB.

Assessment Status

Automated

Rationale Statement

For sensitive data, private endpoints allow granular control of which services can communicate with Cosmos DB and ensure that this network traffic is private. You set this up on a case by case basis for each service you wish to be connected.

Remediation Procedure

From Azure Portal 1. Open the portal menu. 2. Select the Azure Cosmos DB blade. 3. Select the Azure Cosmos DB account. 4. Select Networking. 5. Select Private access. 6. Click + Private Endpoint. 7. Provide a Name. 8. Click Next. 9. From the Resource type drop down, select Microsoft.AzureCosmosDB/databaseAccounts. 10. From the Resource drop down, select the Cosmos DB account. 11. Click Next. 12. Provide appropriate Virtual Network details. 13. Click Next. 14. Provide appropriate DNS details. 15. Click Next. 16. Optionally provide Tags. 17. Click Next : Review + create. 18. Click Create.

4.5.3Use Entra ID Client Authentication and Azure RBAC where possible.1
Attributes
Profile

Level 1

Section

4 Database Services

Sub Section

4.5 Cosmos DB

Description

Cosmos DB can use tokens or Entra ID for client authentication which in turn will use Azure RBAC for authorization. Using Entra ID is significantly more secure because Entra ID handles the credentials and allows for MFA and centralized management, and the Azure RBAC better integrated with the rest of Azure.

Default Value

The default is to use tokens/keys for client authentication.

Audit Procedure

From Powershell: $cosmosdbname = <your-cosmos-db-account-name> $resourcegroup = <your-resource-group-name> az cosmosdb show --name $cosmosdbname --resource-group $resourcegroup | ConvertFrom-Json In the resulting output, disableLocalAuth should be true

Assessment Status

Manual

Rationale Statement

Entra ID client authentication is considerably more secure than token-based authentication because the tokens must be persistent at the client. Entra ID does not require this.

Remediation Procedure

Map all the resources that currently access to the Azure Cosmos DB account with keys or access tokens. Create an Entra ID identity for each of these resources: - For Azure resources, you can create a managed identity. You may choose between system-assigned and user-assigned managed identities. - For non-Azure resources, create an Entra ID identity. Grant each Entra ID identity the minimum permission it requires. When possible, we recommend you use one of the 2 built-in role definitions: Cosmos DB Built-in Data Reader or Cosmos DB Built-in Data Contributor. Validate that the new resource is functioning correctly. After new permissions are granted to identities, it may take a few hours until they propagate. When all resources are working correctly with the new identities, continue to the next step. From Powershell: $cosmosdbname = <your-cosmos-db-account-name> $resourcegroup = <your-resource-group-name> az cosmosdb show --name $cosmosdbname --resource-group $resourcegroup | ConvertFrom-Json az resource update --ids $cosmosdb.id --set properties.disableLocalAuth=true --latest-include-preview

5 Logging and Monitoring1917
5.1.1Ensure that a 'Diagnostic Setting' exists for Subscription Activity Logs1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.1 Configuring Diagnostic Settings

Description

Enable Diagnostic settings for exporting activity logs. Diagnostic settings are available for each individual resource within a subscription. Settings should be configured for all appropriate resources for your environment.

Default Value

By default, diagnostic setting is not set.

Audit Procedure

From Azure Portal To identify Diagnostic Settings on a subscription: 1. Go to Monitor 2. Click Activity Log 3. Click Export Activity Logs 4. Select a Subscription 5. Ensure a Diagnostic settings exists for the selected Subscription To identify Diagnostic Settings on specific resources: 1. Go to Monitor 2. Click Diagnostic settings 3. Ensure that Diagnostics status is enabled on all appropriate resources. From Azure CLI To identify Diagnostic Settings on a subscription: az monitor diagnostic-settings subscription list --subscription <subscription ID> To identify Diagnostic Settings on a resource az monitor diagnostic-settings list --resource <resource Id> From PowerShell To identify Diagnostic Settings on a Subscription: Get-AzDiagnosticSetting -SubscriptionId <subscription ID> To identify Diagnostic Settings on a specific resource: Get-AzDiagnosticSetting -ResourceId <resource ID>

Assessment Status

Manual

Rationale Statement

A diagnostic setting controls how a diagnostic log is exported. By default, logs are retained only for 90 days. Diagnostic settings should be defined so that logs can be exported and stored for a longer duration in order to analyze security activities within an Azure subscription.

Remediation Procedure

From Azure Portal To enable Diagnostic Settings on a Subscription: 1. Go to Monitor 2. Click on Activity Log 3. Click on Export Activity Logs 4. Click + Add diagnostic setting 5. Enter a Diagnostic setting name 6. Select Categories for the diagnostic settings 7. Select the appropriate Destination details (this may be Log Analytics, Storage Account, Event Hub, or Partner solution) 8. Click Save To enable Diagnostic Settings on a specific resource: 1. Go to Monitor 2. Click Diagnostic settings 3. Click on the resource that has a diagnostics status of disabled 4. Select Add Diagnostic Setting 5. Enter a Diagnostic setting name 6. Select the appropriate log, metric, and destination. (this may be Log Analytics, Storage Account, Event Hub, or Partner solution) 7. Click save Repeat these step for all resources as needed. From Azure CLI To configure Diagnostic Settings on a Subscription: az monitor diagnostic-settings subscription create --subscription <subscription id> --name <diagnostic settings name> --location <location> <[--event-hub <event hub ID> --event-hub-auth-rule <event hub auth rule ID>] [--storage-account <storage account ID>] [--workspace <log analytics workspace ID>] --logs <JSON encoded categories> (e.g. [{category:Security,enabled:true},{category:Administrative,enabled:true},{category:Alert,enabled:true},{category:Policy,enabled:true}]) To configure Diagnostic Settings on a specific resource: az monitor diagnostic-settings create --subscription <subscription ID> --resource <resource ID> --name <diagnostic settings name> <[--event-hub <event hub ID> --event-hub-rule <event hub auth rule ID>] [--storage-account <storage account ID>] [--workspace <log analytics workspace ID>] --logs <resource specific JSON encoded log settings> --metrics <metric settings (shorthand|json-file|yaml-file)> From PowerShell To configure Diagnostic Settings on a subscription: $logCategories = @(); $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Administrative -Enabled $true $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Security -Enabled $true $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category ServiceHealth -Enabled $true $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Alert -Enabled $true $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommendation -Enabled $true $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Policy -Enabled $true $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Autoscale -Enabled $true $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category ResourceHealth -Enabled $true New-AzSubscriptionDiagnosticSetting -SubscriptionId <subscription ID> -Name <Diagnostic settings name> <[-EventHubAuthorizationRule <event hub auth rule ID> -EventHubName <event hub name>] [-StorageAccountId <storage account ID>] [-WorkSpaceId <log analytics workspace ID>] [-MarketplacePartner ID <full ARM Marketplace resource ID>]> -Log $logCategories To configure Diagnostic Settings on a specific resource: ``` $logCategories = @() $logCategories += New-AzDiagnosticSettingLogSettingsObject -Category <resource specific log category> -Enabled $true Repeat command and variable assignment for each Log category specific to the resource where this Diagnostic Setting will get configured. $metricCategories = @() $metricCategories += New-AzDiagnosticSettingMetricSettingsObject -Enabled $true [-Category <resource specific metric category | AllMetrics>] [-RetentionPolicyDay <Integer>] [-RetentionPolicyEnabled $true] Repeat command and variable assignment for each Metric category or use the 'AllMetrics' category. New-AzDiagnosticSetting -ResourceId <resource ID> -Name <Diagnostic settings name> -Log $logCategories -Metric $metricCategories [-EventHubAuthorizationRuleId <event hub auth rule ID> -EventHubName <event hub name>] [-StorageAccountId <storage account ID>] [-WorkspaceId <log analytics workspace ID>] [-MarketplacePartnerId <full ARM marketplace resource ID>]>

5.1.2Ensure Diagnostic Setting captures appropriate categories1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.1 Configuring Diagnostic Settings

Description

Prerequisite: A Diagnostic Setting must exist. If a Diagnostic Setting does not exist, the navigation and options within this recommendation will not be available. Please review the recommendation at the beginning of this subsection titled: Ensure that a 'Diagnostic Setting' exists. The diagnostic setting should be configured to log the appropriate activities from the control/management plane.

Default Value

When the diagnostic setting is created using Azure Portal, by default no categories are selected.

Audit Procedure

From Azure Portal 1. Go to Azure Monitor 2. Click Activity log 3. Click on Export Activity Logs 4. Select the appropriate Subscription 5. If there is no Diagnostic Settings listed, generate a finding. 6. Otherwise, click on Edit Settings 7. Ensure that the following categories are checked: Administrative, Alert, Policy, and Security From Azure CLI Ensure the categories 'Administrative', 'Alert', 'Policy', and 'Security' set to: 'enabled: true' az monitor diagnostic-settings subscription list --subscription <subscription ID> From Powershell Ensure the categories Administrative, Alert, Policy, and Security are set to Enabled:True Get-AzSubscriptionDiagnosticSetting -Subscription <subscriptionID> 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: 3b980d31-7904-4bb7-8575-5665739a8052 - Name: 'An activity log alert should exist for specific Security operations' - Policy ID: b954148f-4c11-4c38-8221-be76711e194a - Name: 'An activity log alert should exist for specific Administrative operations' - Policy ID: c5447c04-a4d7-4ba8-a263-c9ee321a6858 - Name: 'An activity log alert should exist for specific Policy operations'

Assessment Status

Automated

Rationale Statement

A diagnostic setting controls how the diagnostic log is exported. Capturing the diagnostic setting categories for appropriate control/management plane activities allows proper alerting.

Remediation Procedure

From Azure Portal 1. Go to Azure Monitor 2. Click Activity log 3. Click on Export Activity Logs 4. Select the Subscription from the drop down menu 5. Click on Add diagnostic setting 6. Enter a name for your new Diagnostic Setting 7. Check the following categories: Administrative, Alert, Policy, and Security 8. Choose the destination details according to your organization's needs. From Az CLI az monitor diagnostic-settings subscription create --subscription <subscription id> --name <diagnostic settings name> --location <location> <[--event-hub <event hub ID> --event-hub-auth-rule <event hub auth rule ID>] [--storage-account <storage account ID>] [--workspace <log analytics workspace ID>] --logs [{category:Security,enabled:true},{category:Administrative,enabled:true},{category:Alert,enabled:true},{category:Policy,enabled:true}] From PowerShell $logCategories = @(); $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Administrative -Enabled $true $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Security -Enabled $true $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Alert -Enabled $true $logCategories += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Policy -Enabled $true New-AzSubscriptionDiagnosticSetting -SubscriptionId <subscription ID> -Name <Diagnostic settings name> <[-EventHubAuthorizationRule <event hub auth rule ID> -EventHubName <event hub name>] [-StorageAccountId <storage account ID>] [-WorkSpaceId <log analytics workspace ID>] [-MarketplacePartner ID <full ARM Marketplace resource ID>]> -Log $logCategories

5.1.3Ensure the storage account containing the container with activity logs is encrypted with Customer Managed Key (CMK)1
Attributes
Profile

Level 2

Section

5 Logging and Monitoring

Sub Section

5.1 Configuring Diagnostic Settings

Description

Storage accounts with the activity log exports can be configured to use Customer Managed Keys (CMK).

Default Value

By default, for a storage account keySource is set to Microsoft.Storage allowing encryption with vendor Managed key and not a Customer Managed Key.

Audit Procedure

From Azure Portal 1. Go to Activity log 2. Select Export 3. Select Subscription 4. In section Storage Account, note the name of the Storage account 5. Close the Export Audit Logs blade. Close the Monitor - Activity Log blade. 6. In right column, Click service Storage Accounts to access Storage account blade 7. Click on the storage account name noted in step 4. This will open blade specific to that storage account 8. Under Security + networking, click Encryption. 9. Ensure Customer-managed keys is selected and Key URI is set. From Azure CLI 1. Get storage account id configured with log profile: az monitor diagnostic-settings subscription list --subscription <subscription id> --query 'value[*].storageAccountId' 2. Ensure the storage account is encrypted with CMK: az storage account list --query [?name=='<Storage Account Name>'] In command output ensure keySource is set to Microsoft.Keyvault and keyVaultProperties is not set to null From PowerShell Get-AzStorageAccount -ResourceGroupName <resource group name> -Name <storage account name>|select-object -ExpandProperty encryption|format-list Ensure the value of KeyVaultProperties is not null or empty, and ensure KeySource is not set to Microsoft.Storage. 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: fbb99e8e-e444-4da0-9ff1-75c92f5a85b2 - Name: 'Storage account containing the container with activity logs must be encrypted with BYOK'

Impact Statement

NOTE: You must have your key vault setup to utilize this. All Audit Logs will be encrypted with a key you provide. You will need to set up customer managed keys separately, and you will select which key to use via the instructions here. You will be responsible for the lifecycle of the keys, and will need to manually replace them at your own determined intervals to keep the data secure.

Assessment Status

Automated

Rationale Statement

Configuring the storage account with the activity log export container to use CMKs provides additional confidentiality controls on log data, as a given user must have read permission on the corresponding storage account and must be granted decrypt permission by the CMK.

Remediation Procedure

From Azure Portal 1. Navigate to the Storage accounts blade. 1. Click on the storage account. 1. Under Security + networking, click Encryption. 1. Next to Encryption type, select Customer-managed keys. 1. Complete the steps to configure a customer-managed key for encryption of the storage account. From Azure CLI az storage account update --name <name of the storage account> --resource-group <resource group for a storage account> --encryption-key-source=Microsoft.Keyvault --encryption-key-vault <Key Vault URI> --encryption-key-name <KeyName> --encryption-key-version <Key Version> From PowerShell Set-AzStorageAccount -ResourceGroupName <resource group name> -Name <storage account name> -KeyvaultEncryption -KeyVaultUri <key vault URI> -KeyName <key name>

5.1.4Ensure that logging for Azure Key Vault is 'Enabled'1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.1 Configuring Diagnostic Settings

Description

Enable AuditEvent logging for key vault instances to ensure interactions with key vaults are logged and available.

Default Value

By default, Diagnostic AuditEvent logging is not enabled for Key Vault instances.

Audit Procedure

From Azure Portal 1. Go to Key vaults. 2. For each Key vault. 3. Go to Diagnostic settings. 4. Click Edit setting. 5. Ensure that a destination is configured. 6. Under Category groups, ensure that audit and allLogs are checked. From Azure CLI List all key vaults az keyvault list For each keyvault id az monitor diagnostic-settings list --resource <id> Ensure that storageAccountId reflects your desired destination and that categoryGroup and enabled are set as follows in the sample outputs below. logs: [ { categoryGroup: audit, enabled: true, }, { categoryGroup: allLogs, enabled: true, } From PowerShell List the key vault(s) in the subscription Get-AzKeyVault For each key vault, run the following: Get-AzDiagnosticSetting -ResourceId <key_vault_id> Ensure that StorageAccountId, ServiceBusRuleId, MarketplacePartnerId, or WorkspaceId is set as appropriate. Also, ensure that enabled is set to true, and that categoryGroup reflects both audit and allLogs category groups. 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: cf820ca0-f99e-4f3e-84fb-66e913812d21 - Name: 'Resource logs in Key Vault should be enabled'

Assessment Status

Automated

Rationale Statement

Monitoring how and when key vaults are accessed, and by whom, enables an audit trail of interactions with confidential information, keys, and certificates managed by Azure Key Vault. Enabling logging for Key Vault saves information in a user provided destination of either an Azure storage account or Log Analytics workspace. The same destination can be used for collecting logs for multiple Key Vaults.

Remediation Procedure

From Azure Portal 1. Go to Key vaults. 2. Select a Key vault. 3. Select Diagnostic settings. 4. Click Edit setting to update an existing diagnostic setting, or Add diagnostic setting to create a new one. 5. If creating a new diagnostic setting, provide a name. 6. Configure an appropriate destination. 7. Under Category groups, check audit and allLogs. 8. Click Save. From Azure CLI To update an existing Diagnostic Settings az monitor diagnostic-settings update --name <diagnostic_setting_name> --resource <key_vault_id> To create a new Diagnostic Settings az monitor diagnostic-settings create --name <diagnostic_setting_name> --resource <key_vault_id> --logs [{category:audit,enabled:true},{category:allLogs,enabled:true}] --metrics [{category:AllMetrics,enabled:true}] <[--event-hub <event_hub_ID> --event-hub-rule <event_hub_auth_rule_ID> | --storage-account <storage_account_ID> |--workspace <log_analytics_workspace_ID> | --marketplace-partner-id <solution_resource_ID>]> From PowerShell Create the Log settings object $logSettings = @() $logSettings += New-AzDiagnosticSettingLogSettingsObject -Enabled $true -Category audit $logSettings += New-AzDiagnosticSettingLogSettingsObject -Enabled $true -Category allLogs Create the Metric settings object $metricSettings = @() $metricSettings += New-AzDiagnosticSettingMetricSettingsObject -Enabled $true -Category AllMetrics Create the Diagnostic Settings for each Key Vault New-AzDiagnosticSetting -Name <diagnostic_setting_name> -ResourceId <key_vault_id> -Log $logSettings -Metric $metricSettings [-StorageAccountId <storage_account_ID> | -EventHubName <event_hub_name> -EventHubAuthorizationRuleId <event_hub_auth_rule_ID> | -WorkSpaceId <log analytics workspace ID> | -MarketPlacePartnerId <full resource ID for third-party solution>]

Additional Information

DEPRECATION WARNING Retention rules for Key Vault logging is being migrated to Azure Storage Lifecycle Management. Retention rules should be set based on the needs of your organization and security or compliance frameworks. Please visit https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/migrate-to-azure-storage-lifecycle-policy?tabs=portal for detail on migrating your retention rules. Microsoft has provided the following deprecation timeline: March 31, 2023 – The Diagnostic Settings Storage Retention feature will no longer be available to configure new retention rules for log data. This includes using the portal, CLI PowerShell, and ARM and Bicep templates. If you have configured retention settings, you'll still be able to see and change them in the portal. March 31, 2024 – You will no longer be able to use the API (CLI, Powershell, or templates), or Azure portal to configure retention setting unless you're changing them to 0. Existing retention rules will still be respected. September 30, 2025 – All retention functionality for the Diagnostic Settings Storage Retention feature will be disabled across all environments.

5.1.5Ensure that Network Security Group Flow logs are captured and sent to Log Analytics1
Attributes
Profile

Level 2

Section

5 Logging and Monitoring

Sub Section

5.1 Configuring Diagnostic Settings

Description

Ensure that network flow logs are captured and fed into a central log analytics workspace.

Default Value

By default Network Security Group logs are not sent to Log Analytics.

Audit Procedure

From Azure Portal 1. Navigate to Network Watcher. 1. Select Flow logs. 1. Review existing Network security group flow logs, if any remain, to ensure they are enabled and configured to send logs to a Log Analytics Workspace. 1. Review Virtual network flow logs for new or migrated coverage. 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: 27960feb-a23c-4577-8d36-ef8b5f35e0be - Name: 'All flow log resources should be in enabled state' - Policy ID: c251913d-7d24-4958-af87-478ed3b9ba41 - Name: 'Flow logs should be configured for every network security group' - Policy ID: 4c3c6c5f-0d47-4402-99b8-aa543dd8bcee - Name: 'Flow logs should be configured for every virtual network'

Impact Statement

The impact of configuring NSG Flow logs is primarily one of cost and configuration. If deployed, it will create storage accounts that hold minimal amounts of data on a 5-day lifecycle before feeding to Log Analytics Workspace. This will increase the amount of data stored and used by Azure Monitor.

Assessment Status

Manual

Rationale Statement

Network Flow Logs provide valuable insight into the flow of traffic around your network and feed into both Azure Monitor and Azure Sentinel (if in use), permitting the generation of visual flow diagrams to aid with analyzing for lateral movement, etc.

Remediation Procedure

From Azure Portal Existing NSG flow logs can still be reviewed under Network Watcher > Flow logs. If you already have NSG flow logs configured, ensure they remain enabled and that Traffic Analytics sends data to a Log Analytics Workspace until migration is complete. Azure no longer allows creation of new NSG flow logs after June 30, 2025. For new or migrated deployments, create Virtual network flow logs instead: 1. Navigate to Network Watcher. 1. Select Flow logs. 1. Select + Create. 1. Select the desired Subscription. 1. For Flow log type, select Virtual network. 1. Select + Select target resource. 1. Select Virtual network. 1. Select a virtual network. 1. Click Confirm selection. 1. Select or create a new Storage Account. 1. Input the retention in days to retain the log. 1. Click Next. 1. Under Analytics, for Flow log version, select Version 2. 1. Check the box next to Enable traffic analytics. 1. Select a processing interval. 1. Select a Log Analytics Workspace. 1. Select Next. 1. Optionally add Tags. 1. Select Review + create. 1. Select Create.

Additional Information

On September 30, 2027, NSG flow logs will be retired, and creating new NSG flow logs has not been possible since June 30, 2025. Azure recommends migrating to virtual network flow logs, which address NSG flow log limitations. After retirement, traffic analytics using NSG flow logs will no longer be supported, and existing NSG flow log resources will be deleted. Previously collected NSG flow log records will remain available per their retention policies.

5.1.6Ensure that logging for Azure AppService 'HTTP logs' is enabled1
Attributes
Profile

Level 2

Section

5 Logging and Monitoring

Sub Section

5.1 Configuring Diagnostic Settings

Description

Enable AppServiceHTTPLogs diagnostic log category for Azure App Service instances to ensure all http requests are captured and centrally logged.

Default Value

Not configured.

Audit Procedure

From Azure Portal 1. Go to App Services For each App Service: 2. Go to Diagnostic Settings 3. Ensure that 'HTTP logs' is configured to log to a destination aligned to your environments approach to log consumption (event hub, storage account, etc. dependent on what is consuming the logs such as SIEM or other log aggregation utility).

Impact Statement

Log consumption and processing will incur additional cost.

Assessment Status

Manual

Rationale Statement

Capturing web requests can be important supporting information for security analysts performing monitoring and incident response activities. Once logging, these logs can be ingested into SIEM or other central aggregation point for the organization.

Remediation Procedure

From Azure Portal 1. Go to App Services For each App Service: 2. Go to Diagnostic Settings 3. Click Add Diagnostic Setting 4. Check the checkbox next to 'HTTP logs' 5. Configure a destination based on your specific logging consumption capability (for example Stream to an event hub and then consuming with SIEM integration for Event Hub logging).

5.2.1Ensure that Activity Log Alert exists for Create Policy Assignment1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.2 Monitoring using Activity Log Alerts

Description

Create an activity log alert for the Create Policy Assignment event.

Default Value

By default, no monitoring alerts are created.

Audit Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Click on Alerts. 1. In the Alerts window, click on Alert rules. 1. Ensure an alert rule exists where the Condition column contains Operation name=Microsoft.Authorization/policyAssignments/write. 1. Click on the Alert Name associated with the previous step. 1. Ensure the Condition panel displays the text Whenever the Activity Log has an event with Category='Administrative', Operation name='Create policy assignment' and does not filter on Level, Status or Caller. 1. Ensure the Actions panel displays an Action group is assigned to notify the appropriate personnel in your organization. From Azure CLI az monitor activity-log alert list --subscription <subscription ID> --query [].{Name:name,Enabled:enabled,Condition:condition.allOf,Actions:actions} Look for Microsoft.Authorization/policyAssignments/write in the output. If it's missing, generate a finding. From PowerShell Get-AzActivityLogAlert -SubscriptionId <subscription ID>|where-object {$_.ConditionAllOf.Equal -match Microsoft.Authorization/policyAssignments/write}|select-object Location,Name,Enabled,ResourceGroupName,ConditionAllOf If the output is empty, an alert rule for Create Policy Assignments is not configured. 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: c5447c04-a4d7-4ba8-a263-c9ee321a6858 - Name: 'An activity log alert should exist for specific Policy operations'

Assessment Status

Automated

Rationale Statement

Monitoring for create policy assignment events gives insight into changes done in Azure policy - assignments and can reduce the time it takes to detect unsolicited changes.

Remediation Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Select Alerts. 1. Select Create. 1. Select Alert rule. 1. Choose a subscription. 1. Select Apply. 1. Select the Condition tab. 1. Click See all signals. 1. Select Create policy assignment (Policy assignment). 1. Click Apply. 1. Select the Actions tab. 1. Click Select action groups to select an existing action group, or Create action group to create a new action group. 1. Follow the prompts to choose or create an action group. 1. Select the Details tab. 1. Select a Resource group, provide an Alert rule name and an optional Alert rule description. 1. Click Review + create. 1. Click Create. From Azure CLI az monitor activity-log alert create --resource-group <resource group name> --condition category=Administrative and operationName=Microsoft.Authorization/policyAssignments/write and level=<verbose | information | warning | error | critical> --scope /subscriptions/<subscription ID> --name <activity log rule name> --subscription <subscription ID> --action-group <action group ID> From PowerShell Create the conditions object. $conditions = @() $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Administrative -Field category $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Microsoft.Authorization/policyAssignments/write -Field operationName $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Verbose -Field level Get the Action Group information and store it in a variable, then create a new Action object. $actionGroup = Get-AzActionGroup -ResourceGroupName <resource group name> -Name <action group name> $actionObject = New-AzActivityLogAlertActionGroupObject -Id $actionGroup.Id Create the Scope variable. $scope = /subscriptions/<subscription ID> Create the Activity Log Alert Rule for Microsoft.Authorization/policyAssignments/write New-AzActivityLogAlert -Name <activity alert rule name> -ResourceGroupName <resource group name> -Condition $conditions -Scope $scope -Location global -Action $actionObject -Subscription <subscription ID> -Enabled $true

5.2.2Ensure that Activity Log Alert exists for Delete Policy Assignment1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.2 Monitoring using Activity Log Alerts

Description

Create an activity log alert for the Delete Policy Assignment event.

Default Value

By default, no monitoring alerts are created.

Audit Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Click on Alerts. 1. In the Alerts window, click on Alert rules. 1. Ensure an alert rule exists where the Condition column contains Operation name=Microsoft.Authorization/policyAssignments/delete. 1. Click on the Alert Name associated with the previous step. 1. Ensure the Condition panel displays the text Whenever the Activity Log has an event with Category='Administrative', Operation name='Delete policy assignment' and does not filter on Level, Status or Caller. 1. Ensure the Actions panel displays an Action group is assigned to notify the appropriate personnel in your organization. From Azure CLI az monitor activity-log alert list --subscription <subscription ID> --query [].{Name:name,Enabled:enabled,Condition:condition.allOf,Actions:actions} Look for Microsoft.Authorization/policyAssignments/delete in the output From PowerShell Get-AzActivityLogAlert -SubscriptionId <subscription ID>|where-object {$_.ConditionAllOf.Equal -match Microsoft.Authorization/policyAssignments/delete}|select-object Location,Name,Enabled,ResourceGroupName,ConditionAllOf 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: c5447c04-a4d7-4ba8-a263-c9ee321a6858 - Name: 'An activity log alert should exist for specific Policy operations'

Assessment Status

Automated

Rationale Statement

Monitoring for delete policy assignment events gives insight into changes done in azure policy - assignments and can reduce the time it takes to detect unsolicited changes.

Remediation Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Select Alerts. 1. Select Create. 1. Select Alert rule. 1. Choose a subscription. 1. Select Apply. 1. Select the Condition tab. 1. Click See all signals. 1. Select Delete policy assignment (Policy assignment). 1. Click Apply. 1. Select the Actions tab. 1. Click Select action groups to select an existing action group, or Create action group to create a new action group. 1. Follow the prompts to choose or create an action group. 1. Select the Details tab. 1. Select a Resource group, provide an Alert rule name and an optional Alert rule description. 1. Click Review + create. 1. Click Create. From Azure CLI az monitor activity-log alert create --resource-group <resource group name> --condition category=Administrative and operationName=Microsoft.Authorization/policyAssignments/delete and level=<verbose | information | warning | error | critical> --scope /subscriptions/<subscription ID> --name <activity log rule name> --subscription <subscription id> --action-group <action group ID> From PowerShell Create the conditions object $conditions = @() $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Administrative -Field category $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Microsoft.Authorization/policyAssignments/delete -Field operationName $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Verbose -Field level Retrieve the Action Group information and store in a variable, then create the Action object. $actionGroup = Get-AzActionGroup -ResourceGroupName <resource group name> -Name <action group name> $actionObject = New-AzActivityLogAlertActionGroupObject -Id $actionGroup.Id Create the Scope variable. $scope = /subscriptions/<subscription id> Create the Activity Log Alert Rule for Microsoft.Authorization/policyAssignments/delete. New-AzActivityLogAlert -Name <activity log alert rule name> -ResourceGroupName <resource group name> -Condition $conditions -Scope $scope -Location global -Action $actionObject -Subscription <subscription ID> -Enabled $true

Additional Information

This log alert also applies for Azure Blueprints.

5.2.3Ensure that Activity Log Alert exists for Create or Update Network Security Group1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.2 Monitoring using Activity Log Alerts

Description

Create an Activity Log Alert for the Create or Update Network Security Group event.

Default Value

By default, no monitoring alerts are created.

Audit Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Click on Alerts. 1. In the Alerts window, click on Alert rules. 1. Ensure an alert rule exists where the Condition column contains Operation name=Microsoft.Network/networkSecurityGroups/write. 1. Click on the Alert Name associated with the previous step. 1. Ensure the Condition panel displays the text Whenever the Activity Log has an event with Category='Administrative', Operation name='Create or Update Network Security Group' and does not filter on Level, Status or Caller. 1. Ensure the Actions panel displays an Action group is assigned to notify the appropriate personnel in your organization. From Azure CLI az monitor activity-log alert list --subscription <subscription ID> --query [].{Name:name,Enabled:enabled,Condition:condition.allOf,Actions:actions} Look for Microsoft.Network/networkSecurityGroups/write in the output From PowerShell Get-AzActivityLogAlert -SubscriptionId <subscription ID>|where-object {$_.ConditionAllOf.Equal -match Microsoft.Network/networkSecurityGroups/write}|select-object Location,Name,Enabled,ResourceGroupName,ConditionAllOf 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: b954148f-4c11-4c38-8221-be76711e194a - Name: 'An activity log alert should exist for specific Administrative operations'

Assessment Status

Automated

Rationale Statement

Monitoring for Create or Update Network Security Group events gives insight into network access changes and may reduce the time it takes to detect suspicious activity.

Remediation Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Select Alerts. 1. Select Create. 1. Select Alert rule. 1. Choose a subscription. 1. Select Apply. 1. Select the Condition tab. 1. Click See all signals. 1. Select Create or Update Network Security Group (Network Security Group). 1. Click Apply. 1. Select the Actions tab. 1. Click Select action groups to select an existing action group, or Create action group to create a new action group. 1. Follow the prompts to choose or create an action group. 1. Select the Details tab. 1. Select a Resource group, provide an Alert rule name and an optional Alert rule description. 1. Click Review + create. 1. Click Create. From Azure CLI az monitor activity-log alert create --resource-group <resource group name> --condition category=Administrative and operationName=Microsoft.Network/networkSecurityGroups/write and level=verbose --scope /subscriptions/<subscription ID> --name <activity log rule name> --subscription <subscription id> --action-group <action group ID> From PowerShell Create the Conditions object. $conditions = @() $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Administrative -Field category $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Microsoft.Network/networkSecurityGroups/write -Field operationName $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Verbose -Field level Retrieve the Action Group information and store in a variable, then create the Actions object. $actionGroup = Get-AzActionGroup -ResourceGroupName <resource group name> -Name <action group name> $actionObject = New-AzActivityLogAlertActionGroupObject -Id $actionGroup.Id Create the Scope object $scope = /subscriptions/<subscription id> Create the Activity Log Alert Rule for Microsoft.Network/networkSecurityGroups/write New-AzActivityLogAlert -Name <activity log alert rule name> -ResourceGroupName <resource group name> -Condition $conditions -Scope $scope -Location global -Action $actionObject -Subscription <subscription ID> -Enabled $true

5.2.4Ensure that Activity Log Alert exists for Delete Network Security Group1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.2 Monitoring using Activity Log Alerts

Description

Create an activity log alert for the Delete Network Security Group event.

Default Value

By default, no monitoring alerts are created.

Audit Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Click on Alerts. 1. In the Alerts window, click on Alert rules. 1. Ensure an alert rule exists where the Condition column contains Operation name=Microsoft.Network/networkSecurityGroups/delete. 1. Click on the Alert Name associated with the previous step. 1. Ensure the Condition panel displays the text Whenever the Activity Log has an event with Category='Administrative', Operation name='Delete Network Security Group' and does not filter on Level, Status or Caller. 1. Ensure the Actions panel displays an Action group is assigned to notify the appropriate personnel in your organization. From Azure CLI az monitor activity-log alert list --subscription <subscription ID> --query [].{Name:name,Enabled:enabled,Condition:condition.allOf,Actions:actions} Look for Microsoft.Network/networkSecurityGroups/delete in the output From PowerShell Get-AzActivityLogAlert -SubscriptionId <subscription ID>|where-object {$_.ConditionAllOf.Equal -match Microsoft.Network/networkSecurityGroups/delete}|select-object Location,Name,Enabled,ResourceGroupName,ConditionAllOf 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: b954148f-4c11-4c38-8221-be76711e194a - Name: 'An activity log alert should exist for specific Administrative operations'

Assessment Status

Automated

Rationale Statement

Monitoring for Delete Network Security Group events gives insight into network access changes and may reduce the time it takes to detect suspicious activity.

Remediation Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Select Alerts. 1. Select Create. 1. Select Alert rule. 1. Choose a subscription. 1. Select Apply. 1. Select the Condition tab. 1. Click See all signals. 1. Select Delete Network Security Group (Network Security Group). 1. Click Apply. 1. Select the Actions tab. 1. Click Select action groups to select an existing action group, or Create action group to create a new action group. 1. Follow the prompts to choose or create an action group. 1. Select the Details tab. 1. Select a Resource group, provide an Alert rule name and an optional Alert rule description. 1. Click Review + create. 1. Click Create. From Azure CLI az monitor activity-log alert create --resource-group <resource group name> --condition category=Administrative and operationName=Microsoft.Network/networkSecurityGroups/delete and level=<verbose | information | warning | error | critical> --scope /subscriptions/<subscription ID> --name <activity log rule name> --subscription <subscription id> --action-group <action group ID> From PowerShell Create the Conditions object. $conditions = @() $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Administrative -Field category $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Microsoft.Network/networkSecurityGroups/delete -Field operationName $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Verbose -Field level Retrieve the Action Group information and store in a variable, then create the Actions object. $actionGroup = Get-AzActionGroup -ResourceGroupName <resource group name> -Name <action group name> $actionObject = New-AzActivityLogAlertActionGroupObject -Id $actionGroup.Id Create the Scope object $scope = /subscriptions/<subscription id> Create the Activity Log Alert Rule for Microsoft.Network/networkSecurityGroups/delete New-AzActivityLogAlert -Name <activity log alert rule name> -ResourceGroupName <resource group name> -Condition $conditions -Scope $scope -Location global -Action $actionObject -Subscription <subscription ID> -Enabled $true

5.2.5Ensure that Activity Log Alert exists for Create or Update Security Solution1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.2 Monitoring using Activity Log Alerts

Description

Create an activity log alert for the Create or Update Security Solution event.

Default Value

By default, no monitoring alerts are created.

Audit Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Click on Alerts. 1. In the Alerts window, click on Alert rules. 1. Ensure an alert rule exists where the Condition column contains Operation name=Microsoft.Security/securitySolutions/write. 1. Click on the Alert Name associated with the previous step. 1. Ensure the Condition panel displays the text Whenever the Activity Log has an event with Category='Administrative', Operation name='Create or Update Security Solutions' and does not filter on Level, Status or Caller. 1. Ensure the Actions panel displays an Action group is assigned to notify the appropriate personnel in your organization. From Azure CLI az monitor activity-log alert list --subscription <subscription Id> --query [].{Name:name,Enabled:enabled,Condition:condition.allOf,Actions:actions} Look for Microsoft.Security/securitySolutions/write in the output From PowerShell Get-AzActivityLogAlert -SubscriptionId <subscription ID>|where-object {$_.ConditionAllOf.Equal -match Microsoft.Security/securitySolutions/write}|select-object Location,Name,Enabled,ResourceGroupName,ConditionAllOf 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: b954148f-4c11-4c38-8221-be76711e194a - Name: 'An activity log alert should exist for specific Administrative operations'

Assessment Status

Automated

Rationale Statement

Monitoring for Create or Update Security Solution events gives insight into changes to the active security solutions and may reduce the time it takes to detect suspicious activity.

Remediation Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Select Alerts. 1. Select Create. 1. Select Alert rule. 1. Choose a subscription. 1. Select Apply. 1. Select the Condition tab. 1. Click See all signals. 1. Select Create or Update Security Solutions (Security Solutions). 1. Click Apply. 1. Select the Actions tab. 1. Click Select action groups to select an existing action group, or Create action group to create a new action group. 1. Follow the prompts to choose or create an action group. 1. Select the Details tab. 1. Select a Resource group, provide an Alert rule name and an optional Alert rule description. 1. Click Review + create. 1. Click Create. From Azure CLI az monitor activity-log alert create --resource-group <resource group name> --condition category=Administrative and operationName=Microsoft.Security/securitySolutions/write and level=<verbose | information | warning | error | critical> --scope /subscriptions/<subscription ID> --name <activity log rule name> --subscription <subscription id> --action-group <action group ID> From PowerShell Create the Conditions object. $conditions = @() $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Administrative -Field category $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Microsoft.Security/securitySolutions/write -Field operationName $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Verbose -Field level Retrieve the Action Group information and store in a variable, then create the Actions object. $actionGroup = Get-AzActionGroup -ResourceGroupName <resource group name> -Name <action group name> $actionObject = New-AzActivityLogAlertActionGroupObject -Id $actionGroup.Id Create the Scope object $scope = /subscriptions/<subscription ID> Create the Activity Log Alert Rule for Microsoft.Security/securitySolutions/write New-AzActivityLogAlert -Name <activity log alert rule name> -ResourceGroupName <resource group name> -Condition $conditions -Scope $scope -Location global -Action $actionObject -Subscription <subscription ID> -Enabled $true

5.2.6Ensure that Activity Log Alert exists for Delete Security Solution1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.2 Monitoring using Activity Log Alerts

Description

Create an activity log alert for the Delete Security Solution event.

Default Value

By default, no monitoring alerts are created.

Audit Procedure

From Azure Console 1. Navigate to the Monitor blade. 1. Click on Alerts. 1. In the Alerts window, click on Alert rules. 1. Ensure an alert rule exists where the Condition column contains Operation name=Microsoft.Security/securitySolutions/delete. 1. Click on the Alert Name associated with the previous step. 1. Ensure the Condition panel displays the text Whenever the Activity Log has an event with Category='Administrative', Operation name='Delete Security Solutions' and does not filter on Level, Status or Caller. 1. Ensure the Actions panel displays an Action group is assigned to notify the appropriate personnel in your organization. From Azure CLI az monitor activity-log alert list --subscription <subscription Id> --query [].{Name:name,Enabled:enabled,Condition:condition.allOf,Actions:actions} Look for Microsoft.Security/securitySolutions/delete in the output From PowerShell Get-AzActivityLogAlert -SubscriptionId <subscription ID>|where-object {$_.ConditionAllOf.Equal -match Microsoft.Security/securitySolutions/delete}|select-object Location,Name,Enabled,ResourceGroupName,ConditionAllOf 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: b954148f-4c11-4c38-8221-be76711e194a - Name: 'An activity log alert should exist for specific Administrative operations'

Assessment Status

Automated

Rationale Statement

Monitoring for Delete Security Solution events gives insight into changes to the active security solutions and may reduce the time it takes to detect suspicious activity.

Remediation Procedure

From Azure Console 1. Navigate to the Monitor blade. 1. Select Alerts. 1. Select Create. 1. Select Alert rule. 1. Choose a subscription. 1. Select Apply. 1. Select the Condition tab. 1. Click See all signals. 1. Select Delete Security Solutions (Security Solutions). 1. Click Apply. 1. Select the Actions tab. 1. Click Select action groups to select an existing action group, or Create action group to create a new action group. 1. Follow the prompts to choose or create an action group. 1. Select the Details tab. 1. Select a Resource group, provide an Alert rule name and an optional Alert rule description. 1. Click Review + create. 1. Click Create. From Azure CLI az monitor activity-log alert create --resource-group <resource group name> --condition category=Administrative and operationName=Microsoft.Security/securitySolutions/delete and level=<verbose | information | warning | error | critical> --scope /subscriptions/<subscription ID> --name <activity log rule name> --subscription <subscription id> --action-group <action group ID> From PowerShell Create the Conditions object. $conditions = @() $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Administrative -Field category $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Microsoft.Security/securitySolutions/delete -Field operationName $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Verbose -Field level Retrieve the Action Group information and store in a variable, then create the Actions object. $actionGroup = Get-AzActionGroup -ResourceGroupName <resource group name> -Name <action group name> $actionObject = New-AzActivityLogAlertActionGroupObject -Id $actionGroup.Id Create the Scope object $scope = /subscriptions/<subscription ID> Create the Activity Log Alert Rule for Microsoft.Security/securitySolutions/delete New-AzActivityLogAlert -Name <activity log alert rule name> -ResourceGroupName <resource group name> -Condition $conditions -Scope $scope -Location global -Action $actionObject -Subscription <subscription ID> -Enabled $true

5.2.7Ensure that Activity Log Alert exists for Create or Update SQL Server Firewall Rule1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.2 Monitoring using Activity Log Alerts

Description

Create an activity log alert for the Create or Update SQL Server Firewall Rule event.

Default Value

By default, no monitoring alerts are created or active.

Audit Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Click on Alerts. 1. In the Alerts window, click on Alert rules. 1. Ensure an alert rule exists where the Condition column contains Operation name=Microsoft.Sql/servers/firewallRules/write. 1. Click on the Alert Name associated with the previous step. 1. Ensure the Condition panel displays the text Whenever the Activity Log has an event with Category='Administrative', Operation name='Create/Update server firewall rule' and does not filter on Level, Status or Caller. 1. Ensure the Actions panel displays an Action group is assigned to notify the appropriate personnel in your organization. From Azure CLI az monitor activity-log alert list --subscription <subscription Id> --query [].{Name:name,Enabled:enabled,Condition:condition.allOf,Actions:actions} Look for Microsoft.Sql/servers/firewallRules/write in the output From PowerShell Get-AzActivityLogAlert -SubscriptionId <subscription ID>|where-object {$_.ConditionAllOf.Equal -match Microsoft.Sql/servers/firewallRules/write}|select-object Location,Name,Enabled,ResourceGroupName,ConditionAllOf 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: b954148f-4c11-4c38-8221-be76711e194a - Name: 'An activity log alert should exist for specific Administrative operations'

Impact Statement

There will be a substantial increase in log size if there are a large number of administrative actions on a server.

Assessment Status

Automated

Rationale Statement

Monitoring for Create or Update SQL Server Firewall Rule events gives insight into network access changes and may reduce the time it takes to detect suspicious activity.

Remediation Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Select Alerts. 1. Select Create. 1. Select Alert rule. 1. Choose a subscription. 1. Select Apply. 1. Select the Condition tab. 1. Click See all signals. 1. Select Create/Update server firewall rule (Server Firewall Rule). 1. Click Apply. 1. Select the Actions tab. 1. Click Select action groups to select an existing action group, or Create action group to create a new action group. 1. Follow the prompts to choose or create an action group. 1. Select the Details tab. 1. Select a Resource group, provide an Alert rule name and an optional Alert rule description. 1. Click Review + create. 1. Click Create. From Azure CLI az monitor activity-log alert create --resource-group <resource group name> --condition category=Administrative and operationName=Microsoft.Sql/servers/firewallRules/write and level=<verbose | information | warning | error | critical> --scope /subscriptions/<subscription ID> --name <activity log rule name> --subscription <subscription id> --action-group <action group ID> From PowerShell Create the Conditions object. $conditions = @() $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Administrative -Field category $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Microsoft.Sql/servers/firewallRules/write -Field operationName $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Verbose -Field level Retrieve the Action Group information and store in a variable, then create the Actions object. $actionGroup = Get-AzActionGroup -ResourceGroupName <resource group name> -Name <action group name> $actionObject = New-AzActivityLogAlertActionGroupObject -Id $actionGroup.Id Create the Scope object $scope = /subscriptions/<subscription ID> Create the Activity Log Alert Rule for Microsoft.Sql/servers/firewallRules/write New-AzActivityLogAlert -Name <activity log alert rule name> -ResourceGroupName <resource group name> -Condition $conditions -Scope $scope -Location global -Action $actionObject -Subscription <subscription ID> -Enabled $true

5.2.8Ensure that Activity Log Alert exists for Delete SQL Server Firewall Rule1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.2 Monitoring using Activity Log Alerts

Description

Create an activity log alert for the Delete SQL Server Firewall Rule.

Default Value

By default, no monitoring alerts are created or active.

Audit Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Click on Alerts. 1. In the Alerts window, click on Alert rules. 1. Ensure an alert rule exists where the Condition column contains Operation name=Microsoft.Sql/servers/firewallRules/delete. 1. Click on the Alert Name associated with the previous step. 1. Ensure the Condition panel displays the text Whenever the Activity Log has an event with Category='Administrative', Operation name='Delete server firewall rule' and does not filter on Level, Status or Caller. 1. Ensure the Actions panel displays an Action group is assigned to notify the appropriate personnel in your organization. From Azure CLI az monitor activity-log alert list --subscription <subscription Id> --query [].{Name:name,Enabled:enabled,Condition:condition.allOf,Actions:actions} Look for Microsoft.Sql/servers/firewallRules/delete in the output From PowerShell Get-AzActivityLogAlert -SubscriptionId <subscription ID>|where-object {$_.ConditionAllOf.Equal -match Microsoft.Sql/servers/firewallRules/delete}|select-object Location,Name,Enabled,ResourceGroupName,ConditionAllOf 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: b954148f-4c11-4c38-8221-be76711e194a - Name: 'An activity log alert should exist for specific Administrative operations'

Impact Statement

There will be a substantial increase in log size if there are a large number of administrative actions on a server.

Assessment Status

Automated

Rationale Statement

Monitoring for Delete SQL Server Firewall Rule events gives insight into SQL network access changes and may reduce the time it takes to detect suspicious activity.

Remediation Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Select Alerts. 1. Select Create. 1. Select Alert rule. 1. Choose a subscription. 1. Select Apply. 1. Select the Condition tab. 1. Click See all signals. 1. Select Delete server firewall rule (Server Firewall Rule). 1. Click Apply. 1. Select the Actions tab. 1. Click Select action groups to select an existing action group, or Create action group to create a new action group. 1. Follow the prompts to choose or create an action group. 1. Select the Details tab. 1. Select a Resource group, provide an Alert rule name and an optional Alert rule description. 1. Click Review + create. 1. Click Create. From Azure CLI az monitor activity-log alert create --resource-group <resource group name> --condition category=Administrative and operationName=Microsoft.Sql/servers/firewallRules/delete and level=<verbose | information | warning | error | critical> --scope /subscriptions/<subscription ID> --name <activity log rule name> --subscription <subscription id> --action-group <action group ID> From PowerShell Create the Conditions object. $conditions = @() $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Administrative -Field category $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Microsoft.Sql/servers/firewallRules/delete -Field operationName $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Verbose -Field level Retrieve the Action Group information and store in a variable, then create the Actions object. $actionGroup = Get-AzActionGroup -ResourceGroupName <resource group name> -Name <action group name> $actionObject = New-AzActivityLogAlertActionGroupObject -Id $actionGroup.Id Create the Scope object $scope = /subscriptions/<subscription ID> Create the Activity Log Alert Rule for Microsoft.Sql/servers/firewallRules/delete New-AzActivityLogAlert -Name <activity log alert rule name> -ResourceGroupName <resource group name> -Condition $conditions -Scope $scope -Location global -Action $actionObject -Subscription <subscription ID> -Enabled $true

5.2.9Ensure that Activity Log Alert exists for Create or Update Public IP Address rule1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.2 Monitoring using Activity Log Alerts

Description

Create an activity log alert for the Create or Update Public IP Addresses rule.

Default Value

By default, no monitoring alerts are created or active.

Audit Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Click on Alerts. 1. In the Alerts window, click on Alert rules. 1. Ensure an alert rule exists where the Condition column contains Operation name=Microsoft.Network/publicIPAddresses/write. 1. Click on the Alert Name associated with the previous step. 1. Ensure the Condition panel displays the text Whenever the Activity Log has an event with Category='Administrative', Operation name='Create or Update Public Ip Address' and does not filter on Level, Status or Caller. 1. Ensure the Actions panel displays an Action group is assigned to notify the appropriate personnel in your organization. From Azure CLI az monitor activity-log alert list --subscription <subscription Id> --query [].{Name:name,Enabled:enabled,Condition:condition.allOf,Actions:actions} Look for Microsoft.Network/publicIPAddresses/write in the output From PowerShell Get-AzActivityLogAlert -SubscriptionId <subscription ID>|where-object {$_.ConditionAllOf.Equal -match Microsoft.Network/publicIPAddresses/write}|select-object Location,Name,Enabled,ResourceGroupName,ConditionAllOf 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: 1513498c-3091-461a-b321-e9b433218d28 - Name: 'Enable logging by category group for Public IP addresses (microsoft.network/publicipaddresses) to Log Analytics'

Impact Statement

There will be a substantial increase in log size if there are a large number of administrative actions on a server.

Assessment Status

Automated

Rationale Statement

Monitoring for Create or Update Public IP Address events gives insight into network access changes and may reduce the time it takes to detect suspicious activity.

Remediation Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Select Alerts. 1. Select Create. 1. Select Alert rule. 1. Choose a subscription. 1. Select Apply. 1. Select the Condition tab. 1. Click See all signals. 1. Select Create or Update Public Ip Address (Public Ip Address). 1. Click Apply. 1. Select the Actions tab. 1. Click Select action groups to select an existing action group, or Create action group to create a new action group. 1. Follow the prompts to choose or create an action group. 1. Select the Details tab. 1. Select a Resource group, provide an Alert rule name and an optional Alert rule description. 1. Click Review + create. 1. Click Create. From Azure CLI az monitor activity-log alert create --resource-group <resource group name> --condition category=Administrative and operationName=Microsoft.Network/publicIPAddresses/write and level=<verbose | information | warning | error | critical> --scope /subscriptions/<subscription ID> --name <activity log rule name> --subscription <subscription id> --action-group <action group ID> From PowerShell Create the Conditions object. $conditions = @() $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Administrative -Field category $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Microsoft.Network/publicIPAddresses/write -Field operationName $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Verbose -Field level Retrieve the Action Group information and store in a variable, then create the Actions object. $actionGroup = Get-AzActionGroup -ResourceGroupName <resource group name> -Name <action group name> $actionObject = New-AzActivityLogAlertActionGroupObject -Id $actionGroup.Id Create the Scope object $scope = /subscriptions/<subscription ID> Create the Activity Log Alert Rule for Microsoft.Network/publicIPAddresses/write New-AzActivityLogAlert -Name <activity log alert rule name> -ResourceGroupName <resource group name> -Condition $conditions -Scope $scope -Location global -Action $actionObject -Subscription <subscription ID> -Enabled $true

5.2.10Ensure that Activity Log Alert exists for Delete Public IP Address rule1
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Sub Section

5.2 Monitoring using Activity Log Alerts

Description

Create an activity log alert for the Delete Public IP Address rule.

Default Value

By default, no monitoring alerts are created or active.

Audit Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Click on Alerts. 1. In the Alerts window, click on Alert rules. 1. Ensure an alert rule exists where the Condition column contains Operation name=Microsoft.Network/publicIPAddresses/delete. 1. Click on the Alert Name associated with the previous step. 1. Ensure the Condition panel displays the text Whenever the Activity Log has an event with Category='Administrative', Operation name='Delete Public Ip Address' and does not filter on Level, Status or Caller. 1. Ensure the Actions panel displays an Action group is assigned to notify the appropriate personnel in your organization. From Azure CLI az monitor activity-log alert list --subscription <subscription Id> --query [].{Name:name,Enabled:enabled,Condition:condition.allOf,Actions:actions} Look for Microsoft.Network/publicIPAddresses/delete in the output From PowerShell Get-AzActivityLogAlert -SubscriptionId <subscription ID>|where-object {$_.ConditionAllOf.Equal -match Microsoft.Network/publicIPAddresses/delete}|select-object Location,Name,Enabled,ResourceGroupName,ConditionAllOf 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: 1513498c-3091-461a-b321-e9b433218d28 - Name: 'Enable logging by category group for Public IP addresses (microsoft.network/publicipaddresses) to Log Analytics'

Impact Statement

There will be a substantial increase in log size if there are a large number of administrative actions on a server.

Assessment Status

Automated

Rationale Statement

Monitoring for Delete Public IP Address events gives insight into network access changes and may reduce the time it takes to detect suspicious activity.

Remediation Procedure

From Azure Portal 1. Navigate to the Monitor blade. 1. Select Alerts. 1. Select Create. 1. Select Alert rule. 1. Choose a subscription. 1. Select Apply. 1. Select the Condition tab. 1. Click See all signals. 1. Select Delete Public Ip Address (Public Ip Address). 1. Click Apply. 1. Select the Actions tab. 1. Click Select action groups to select an existing action group, or Create action group to create a new action group. 1. Follow the prompts to choose or create an action group. 1. Select the Details tab. 1. Select a Resource group, provide an Alert rule name and an optional Alert rule description. 1. Click Review + create. 1. Click Create. From Azure CLI az monitor activity-log alert create --resource-group <resource group name> --condition category=Administrative and operationName=Microsoft.Network/publicIPAddresses/delete and level=<verbose | information | warning | error | critical> --scope /subscriptions/<subscription ID> --name <activity log rule name> --subscription <subscription id> --action-group <action group ID> From PowerShell Create the Conditions object. $conditions = @() $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Administrative -Field category $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Microsoft.Network/publicIPAddresses/delete -Field operationName $conditions += New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -Equal Verbose -Field level Retrieve the Action Group information and store in a variable, then create the Actions object. $actionGroup = Get-AzActionGroup -ResourceGroupName <resource group name> -Name <action group name> $actionObject = New-AzActivityLogAlertActionGroupObject -Id $actionGroup.Id Create the Scope object $scope = /subscriptions/<subscription ID> Create the Activity Log Alert Rule for Microsoft.Network/publicIPAddresses/delete New-AzActivityLogAlert -Name <activity log alert rule name> -ResourceGroupName <resource group name> -Condition $conditions -Scope $scope -Location global -Action $actionObject -Subscription <subscription ID> -Enabled $true

5.3.1Ensure Application Insights are Configured1
Attributes
Profile

Level 2

Section

5 Logging and Monitoring

Sub Section

5.3 Configuring Application Insights. Storage Accounts

Description

Application Insights within Azure act as an Application Performance Monitoring solution providing valuable data into how well an application performs and additional information when performing incident response. The types of log data collected include application metrics, telemetry data, and application trace logging data providing organizations with detailed information about application activity and application transactions. Both data sets help organizations adopt a proactive and retroactive means to handle security and performance related metrics within their modern applications.

Default Value

Application Insights are not enabled by default.

Audit Procedure

From Azure Portal 1. Navigate to Application Insights 2. Ensure an Application Insights service is configured and exists. From Azure CLI Note: The application-insights extension to Azure CLI is currently in Preview Add the application-insights extension. az extension add --name application-insights az monitor app-insights component show --query [].{ID:appId, Name:name, Tenant:tenantId, Location:location, Provisioning_State:provisioningState} Ensure the above command produces output, otherwise Application Insights has not been configured. From PowerShell Get-AzApplicationInsights|select location,name,appid,provisioningState,tenantid 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: fa9cd53d-cb8f-464e-84f1-7b1490fd21c6 - Name: 'Deploy Diagnostic Settings for Application Insights to Log Analytics workspace'

Impact Statement

Because Application Insights relies on a Log Analytics Workspace, an organization will incur additional expenses when using this service.

Assessment Status

Automated

Rationale Statement

Configuring Application Insights provides additional data not found elsewhere within Azure as part of a much larger logging and monitoring program within an organization's Information Security practice. The types and contents of these logs will act as both a potential cost saving measure (application performance) and a means to potentially confirm the source of a potential incident (trace logging). Metrics and Telemetry data provide organizations with a proactive approach to cost savings by monitoring an application's performance, while the trace logging data provides necessary details in a reactive incident response scenario by helping organizations identify the potential source of an incident within their application.

Remediation Procedure

Remediation Procedures From Azure Portal 1. Navigate to Application Insights 2. Under the Basics tab within the PROJECT DETAILS section, select the Subscription 3. Select the Resource group 4. Within the INSTANCE DETAILS, enter a Name 5. Select a Region 6. Next to Resource Mode, select Workspace-based 7. Within the WORKSPACE DETAILS, select the Subscription for the log analytics workspace 8. Select the appropriate Log Analytics Workspace 9. Click Next:Tags > 10. Enter the appropriate Tags as Name, Value pairs. 11. Click Next:Review+Create 12. Click Create From Azure CLI az monitor app-insights component create --app <app name> --resource-group <resource group name> --location <location> --kind web --retention-time <INT days to retain logs> --workspace <log analytics workspace ID> --subscription <subscription ID> From PowerShell New-AzApplicationInsights -Kind web -ResourceGroupName <resource group name> -Name <app insights name> -location <location> -RetentionInDays <INT days to retain logs> -SubscriptionID <subscription ID> -WorkspaceResourceId <log analytics workspace ID>

5.4Ensure that Azure Monitor Resource Logging is Enabled for All Services that Support it0
Attributes
Profile

Level 1

Section

5 Logging and Monitoring

Description

Resource Logs capture activity to the data access plane while the Activity log is a subscription-level log for the control plane. Resource-level diagnostic logs provide insight into operations that were performed within that resource itself; for example, reading or updating a secret from a Key Vault. Currently, 95 Azure resources support Azure Monitoring (See the more information section for a complete list), including Network Security Groups, Load Balancers, Key Vault, AD, Logic Apps, and CosmosDB. The content of these logs varies by resource type. A number of back-end services were not configured to log and store Resource Logs for certain activities or for a sufficient length. It is crucial that monitoring is correctly configured to log all relevant activities and retain those logs for a sufficient length of time. Given that the mean time to detection in an enterprise is 240 days, a minimum retention period of two years is recommended.

Default Value

By default, Azure Monitor Resource Logs are 'Disabled' for all resources.

Audit Procedure

From Azure Portal The specific steps for configuring resources within the Azure console vary depending on resource, but typically the steps are: 1. Go to the resource 2. Click on Diagnostic settings 3. In the blade that appears, click Add diagnostic setting 4. Configure the diagnostic settings 5. Click on Save From Azure CLI List all resources for a subscription az resource list --subscription <subscription id> For each resource run the following az monitor diagnostic-settings list --resource <resource ID> An empty result means a diagnostic settings is not configured for that resource. An error message means a diagnostic settings is not supported for that resource. From PowerShell Get a list of resources in a subscription context and store in a variable $resources = Get-AzResource Loop through each resource to determine if a diagnostic setting is configured or not. foreach ($resource in $resources) {$diagnosticSetting = Get-AzDiagnosticSetting -ResourceId $resource.id -ErrorAction SilentlyContinue; if ([string]::IsNullOrEmpty($diagnosticSetting)) {$message = Diagnostic Settings not configured for resource: + $resource.Name;Write-Output $message}else{$diagnosticSetting}} A result of Diagnostic Settings not configured for resource: <resource name> means a diagnostic settings is not configured for that resource. Otherwise, the output of the above command will show configured Diagnostic Settings for a resource. 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: cf820ca0-f99e-4f3e-84fb-66e913812d21 - Name: 'Resource logs in Key Vault should be enabled' - Policy ID: 91a78b24-f231-4a8a-8da9-02c35b2b6510 - Name: 'App Service apps should have resource logs enabled' - Policy ID: 428256e6-1fac-4f48-a757-df34c2b3336d - Name: 'Resource logs in Batch accounts should be enabled' - Policy ID: 057ef27e-665e-4328-8ea3-04b3122bd9fb - Name: 'Resource logs in Azure Data Lake Store should be enabled' - Policy ID: c95c74d9-38fe-4f0d-af86-0c7d626a315c - Name: 'Resource logs in Data Lake Analytics should be enabled' - Policy ID: 83a214f7-d01a-484b-91a9-ed54470c9a6a - Name: 'Resource logs in Event Hub should be enabled' - Policy ID: 383856f8-de7f-44a2-81fc-e5135b5c2aa4 - Name: 'Resource logs in IoT Hub should be enabled' - Policy ID: 34f95f76-5386-4de7-b824-0d8478470c9d - Name: 'Resource logs in Logic Apps should be enabled' - Policy ID: b4330a05-a843-4bc8-bf9a-cacce50c67f4 - Name: 'Resource logs in Search services should be enabled' - Policy ID: f8d36e2f-389b-4ee4-898d-21aeb69a0f45 - Name: 'Resource logs in Service Bus should be enabled' - Policy ID: f9be5368-9bf5-4b84-9e0a-7850da98bb46 - Name: 'Resource logs in Azure Stream Analytics should be enabled'

Impact Statement

Costs for monitoring varies with Log Volume. Not every resource needs to have logging enabled. It is important to determine the security classification of the data being processed by the given resource and adjust the logging based on which events need to be tracked. This is typically determined by governance and compliance requirements.

Assessment Status

Manual

Rationale Statement

A lack of monitoring reduces the visibility into the data plane, and therefore an organization's ability to detect reconnaissance, authorization attempts or other malicious activity. Unlike Activity Logs, Resource Logs are not enabled by default. Specifically, without monitoring it would be impossible to tell which entities had accessed a data store that was breached. In addition, alerts for failed attempts to access APIs for Web Services or Databases are only possible when logging is enabled.

Remediation Procedure

Azure Subscriptions should log every access and operation for all resources. Logs should be sent to Storage and a Log Analytics Workspace or equivalent third-party system. Logs should be kept in readily-accessible storage for a minimum of one year, and then moved to inexpensive cold storage for a duration of time as necessary. If retention policies are set but storing logs in a Storage Account is disabled (for example, if only Event Hubs or Log Analytics options are selected), the retention policies have no effect. Enable all monitoring at first, and then be more aggressive moving data to cold storage if the volume of data becomes a cost concern. From Azure Portal The specific steps for configuring resources within the Azure console vary depending on resource, but typically the steps are: 1. Go to the resource 2. Click on Diagnostic settings 3. In the blade that appears, click Add diagnostic setting 4. Configure the diagnostic settings 5. Click on Save From Azure CLI For each resource, run the following making sure to use a resource appropriate JSON encoded category for the --logs option. az monitor diagnostic-settings create --name <diagnostic settings name> --resource <resource ID> --logs [{category:<resource specific category>,enabled:true,rentention-policy:{enabled:true,days:180}}] --metrics [{category:AllMetrics,enabled:true,retention-policy:{enabled:true,days:180}}] <[--event-hub <event hub ID> --event-hub-rule <event hub auth rule ID> | --storage-account <storage account ID> |--workspace <log analytics workspace ID> | --marketplace-partner-id <full resource ID of third-party solution>]> From PowerShell Create the log settings object $logSettings = @() $logSettings += New-AzDiagnosticSettingLogSettingsObject -Enabled $true -RetentionPolicyDay 180 -RetentionPolicyEnabled $true -Category <resource specific category> $logSettings += New-AzDiagnosticSettingLogSettingsObject -Enabled $true -RetentionPolicyDay 180 -RetentionPolicyEnabled $true -Category <resource specific category number 2> Create the metric settings object $metricSettings = @() $metricSettings += New-AzDiagnosticSettingMetricSettingsObject -Enabled $true -RetentionPolicyDay 180 -RetentionPolicyEnabled $true -Category AllMetrics Create the diagnostic setting for a specific resource New-AzDiagnosticSetting -Name <diagnostic settings name> -ResourceId <resource ID> -Log $logSettings -Metric $metricSettings

Additional Information

Note: The CIS Benchmark covers some specific Diagnostic Logs separately. Section 3 - Storage Accounts: Ensure Storage Logging is Enabled for Queue Service for 'Read', 'Write', and 'Delete' requests Section 6 - Network: Ensure that Network Security Group Flow Log retention period is 'greater than 90 days' For an up-to-date list of Azure resources which support Azure Monitor, refer to the Supported Log Categories reference.

5.5Ensure that SKU Basic/Consumption is not used on artifacts that need to be monitored (Particularly for Production Workloads)0
Attributes
Profile

Level 2

Section

5 Logging and Monitoring

Description

The use of Basic or Free SKUs in Azure whilst cost effective have significant limitations in terms of what can be monitored and what support can be realized from Microsoft. Typically, these SKU’s do not have a service SLA and Microsoft may refuse to provide support for them. Consequently Basic/Free SKUs should never be used for production workloads.

Default Value

Policy should enforce standard SKUs for the following artifacts: - Public IP Addresses - Network Load Balancers - REDIS Cache - SQL PaaS Databases - VPN Gateways

Audit Procedure

This needs to be audited by Azure Policy (one for each resource type) and denied for each artifact that is production. From Azure Portal 1. Open Azure Resource Graph Explorer 1. Click New query 1. Paste the following into the query window: Resources | where sku contains 'Basic' or sku contains 'consumption' | order by type 4. Click Run query then evaluate the results in the results window. From Azure CLI az graph query -q Resources | sku contains 'Basic' or sku contains 'consumption' | order by type From PowerShell Get-AzResource | ?{ $_.Sku -EQ Basic}

Impact Statement

The impact of enforcing Standard SKU's is twofold 1) There will be a cost increase 2) The monitoring and service level agreements will be available and will support the production service. All resources should be either tagged or in separate Management Groups/Subscriptions

Assessment Status

Manual

Rationale Statement

Typically, production workloads need to be monitored and should have an SLA with Microsoft, using Basic SKUs for any deployed product will mean that that these capabilities do not exist. The following resource types should use standard SKUs as a minimum. - Public IP Addresses - Network Load Balancers - REDIS Cache - SQL PaaS Databases - VPN Gateways

Remediation Procedure

Each artifact has its own process for upgrading from basic to standard SKU's and this should be followed if required.

6 Networking76
6.1Ensure that RDP access from the Internet is evaluated and restricted1
Attributes
Profile

Level 1

Section

6 Networking

Description

Network security groups should be periodically evaluated for port misconfigurations. Where certain ports and protocols may be exposed to the Internet, they should be evaluated for necessity and restricted wherever they are not explicitly required.

Default Value

By default, RDP access from internet is not enabled.

Audit Procedure

From Azure Portal 1. For each VM, open the Networking blade 2. Verify that the INBOUND PORT RULES does not have a rule for RDP such as - port = 3389, - protocol = TCP OR ANY, - Source = Any OR Internet From Azure CLI List Network security groups with corresponding non-default Security rules: az network nsg list --query [*].[name,securityRules] Ensure that none of the NSGs have security rule as below access : Allow destinationPortRange : 3389 or * or [port range containing 3389] direction : Inbound protocol : TCP or * sourceAddressPrefix : * or 0.0.0.0 or <nw>/0 or /0 or internet or any 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: 22730e10-96f6-4aac-ad84-9383d35b5917 - Name: 'Management ports should be closed on your virtual machines'

Assessment Status

Automated

Rationale Statement

The potential security problem with using RDP over the Internet is that attackers can use various brute force techniques to gain access to Azure Virtual Machines. Once the attackers gain access, they can use a virtual machine as a launch point for compromising other machines on an Azure Virtual Network or even attack networked devices outside of Azure.

Remediation Procedure

Where RDP is not explicitly required and narrowly configured for resources attached to the Network Security Group, Internet-level access to your Azure resources should be restricted or eliminated. For internal access to relevant resources, configure an encrypted network tunnel such as: ExpressRoute Site-to-site VPN Point-to-site VPN

6.2Ensure that SSH access from the Internet is evaluated and restricted1
Attributes
Profile

Level 1

Section

6 Networking

Description

Network security groups should be periodically evaluated for port misconfigurations. Where certain ports and protocols may be exposed to the Internet, they should be evaluated for necessity and restricted wherever they are not explicitly required.

Default Value

By default, SSH access from internet is not enabled.

Audit Procedure

From Azure Portal 1. Open the Networking blade for the specific Virtual machine in Azure portal 2. Verify that the INBOUND PORT RULES does not have a rule for SSH such as - port = 22, - protocol = TCP OR ANY, - Source = Any OR Internet From Azure CLI List Network security groups with corresponding non-default Security rules: az network nsg list --query [*].[name,securityRules] Ensure that none of the NSGs have security rule as below access : Allow destinationPortRange : 22 or * or [port range containing 22] direction : Inbound protocol : TCP or * sourceAddressPrefix : * or 0.0.0.0 or <nw>/0 or /0 or internet or any 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: 22730e10-96f6-4aac-ad84-9383d35b5917 - Name: 'Management ports should be closed on your virtual machines'

Assessment Status

Automated

Rationale Statement

The potential security problem with using SSH over the Internet is that attackers can use various brute force techniques to gain access to Azure Virtual Machines. Once the attackers gain access, they can use a virtual machine as a launch point for compromising other machines on the Azure Virtual Network or even attack networked devices outside of Azure.

Remediation Procedure

Where SSH is not explicitly required and narrowly configured for resources attached to the Network Security Group, Internet-level access to your Azure resources should be restricted or eliminated. For internal access to relevant resources, configure an encrypted network tunnel such as: ExpressRoute Site-to-site VPN Point-to-site VPN

6.3Ensure that UDP access from the Internet is evaluated and restricted1
Attributes
Profile

Level 1

Section

6 Networking

Description

Network security groups should be periodically evaluated for port misconfigurations. Where certain ports and protocols may be exposed to the Internet, they should be evaluated for necessity and restricted wherever they are not explicitly required.

Default Value

By default, UDP access from internet is not enabled.

Audit Procedure

From Azure Portal 1. Open the Networking blade for the specific Virtual machine in Azure portal 2. Verify that the INBOUND PORT RULES does not have a rule for UDP such as - protocol = UDP, - Source = Any OR Internet From Azure CLI List Network security groups with corresponding non-default Security rules: az network nsg list --query [*].[name,securityRules] Ensure that none of the NSGs have security rule as below access : Allow destinationPortRange : * or [port range containing 53, 123, 161, 389, 1900, or other vulnerable UDP-based services] direction : Inbound protocol : UDP sourceAddressPrefix : * or 0.0.0.0 or <nw>/0 or /0 or internet or any

Assessment Status

Automated

Rationale Statement

The potential security problem with broadly exposing UDP services over the Internet is that attackers can use DDoS amplification techniques to reflect spoofed UDP traffic from Azure Virtual Machines. The most common types of these attacks use exposed DNS, NTP, SSDP, SNMP, CLDAP and other UDP-based services as amplification sources for disrupting services of other machines on the Azure Virtual Network or even attack networked devices outside of Azure.

Remediation Procedure

Where UDP is not explicitly required and narrowly configured for resources attached to the Network Security Group, Internet-level access to your Azure resources should be restricted or eliminated. For internal access to relevant resources, configure an encrypted network tunnel such as: ExpressRoute Site-to-site VPN Point-to-site VPN

6.4Ensure that HTTP(S) access from the Internet is evaluated and restricted1
Attributes
Profile

Level 1

Section

6 Networking

References

Express Route: https://docs.microsoft.com/en-us/azure/expressroute/:Site-to-Site VPN: https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-portal:Point-to-Site VPN: https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-point-to-site-resource-manager-portal:https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-network-security#ns-1-establish-network-segmentation-boundaries

Description

Network security groups should be periodically evaluated for port misconfigurations. Where certain ports and protocols may be exposed to the Internet, they should be evaluated for necessity and restricted wherever they are not explicitly required and narrowly configured.

Audit Procedure

From Azure Portal 1. For each VM, open the Networking blade 2. Verify that the INBOUND PORT RULES does not have a rule for HTTP(S) such as - port = 80/ 443, - protocol = TCP, - Source = Any OR Internet From Azure CLI List Network security groups with corresponding non-default Security rules: az network nsg list --query [*].[name,securityRules] Ensure that none of the NSGs have security rule as below access : Allow destinationPortRange : 80/443 or * or [port range containing 80/443] direction : Inbound protocol : TCP sourceAddressPrefix : * or 0.0.0.0 or <nw>/0 or /0 or internet or any

Assessment Status

Automated

Rationale Statement

The potential security problem with using HTTP(S) over the Internet is that attackers can use various brute force techniques to gain access to Azure resources. Once the attackers gain access, they can use the resource as a launch point for compromising other resources within the Azure tenant.

Remediation Procedure

Using Azure console 1. Go to Virtual machines. 2. For each VM, open the Networking blade. 3. Click on Inbound port rules. 4. Delete the rule with: * Port = 80/443 OR [port range containing 80/443] * Protocol = TCP OR Any * Source = Any (*) OR IP Addresses(0.0.0.0/0) OR Service Tag(Internet) * Action = Allow Using CLI 1. Run below command to list network security groups: az network nsg list --subscription <subscription-id> --output table 2. For each network security group, run below command to list the rules associated with the specified port: az network nsg rule list --resource-group <resource-group> --nsg-name <nsg-name> --query [?destinationPortRange=='80 or 443'] 3. Run the below command to delete the rule with: * Port = 80/443 OR [port range containing 80/443] * Protocol = TCP OR * * Source = Any (*) OR IP Addresses(0.0.0.0/0) OR Service Tag(Internet) * Action = Allow az network nsg rule delete --resource-group <resource-group> --nsg-name <nsg-name> --name <rule-name>

6.5Ensure that Network Security Group Flow Log retention period is 'greater than 90 days'1
Attributes
Profile

Level 2

Section

6 Networking

Description

Network Security Group Flow Logs should be enabled and the retention period set to greater than or equal to 90 days.

Default Value

By default, Network Security Group Flow Logs are disabled.

Audit Procedure

From Azure Portal 1. Go to Network Watcher. 1. Select Flow logs. 1. Review existing Network security group flow logs, if any remain, and ensure Status is set to On and Retention (days) is set to 0, 90, or a number greater than 90. 1. Review Virtual network flow logs for new or migrated coverage. From Azure CLI az network watcher flow-log list --location <location> --query [*].[name,retentionPolicy,targetResourceId] Ensure each relevant flow log has retention days set to 0, 90, or a number greater than 90. 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: 5e1cd26a-5090-4fdb-9d6a-84a90335e22d - Name: 'Configure network security groups to use specific workspace, storage account and flowlog retention policy for traffic analytics'

Impact Statement

This will keep IP traffic logs for longer than 90 days. As a level 2, first determine your need to retain data, then apply your selection here. As this is data stored for longer, your monthly storage costs will increase depending on your data use.

Assessment Status

Automated

Rationale Statement

Flow logs enable capturing information about IP traffic flowing in and out of network security groups. Logs can be used to check for anomalies and give insight into suspected breaches.

Remediation Procedure

From Azure Portal Existing NSG flow logs can still be reviewed under Network Watcher > Flow logs. If you already have NSG flow logs configured, ensure Status is set to On and Retention (days) is set to 0, 90, or a number greater than 90 until migration is complete. Azure no longer allows creation of new NSG flow logs after June 30, 2025. For new or migrated deployments, configure Virtual network flow logs instead and set Retention days to 0, 90, or a number greater than 90. From Azure CLI Update an existing flow log retention policy with: az network watcher flow-log update --location <location> --name <flow-log> --retention <number-of-days>

Additional Information

On September 30, 2027, NSG flow logs will be retired, and creating new NSG flow logs has not been possible since June 30, 2025. Azure recommends migrating to virtual network flow logs, which address NSG flow log limitations. After retirement, traffic analytics using NSG flow logs will no longer be supported, and existing NSG flow log resources will be deleted. Previously collected NSG flow log records will remain available per their retention policies.

6.6Ensure that Network Watcher is 'Enabled'1
Attributes
Profile

Level 2

Section

6 Networking

Description

Enable Network Watcher for physical regions in Azure subscriptions.

Default Value

Network Watcher is automatically enabled. When you create or update a virtual network in your subscription, Network Watcher will be enabled automatically in your Virtual Network's region. There is no impact to your resources or associated charge for automatically enabling Network Watcher.

Audit Procedure

From Azure Portal 1. Go to Network Watcher 2. Ensure that a network watcher is listed for each region. From Azure CLI az network watcher list --query [].{Location:location,State:provisioningState} -o table This will list all network watchers and their provisioning state. Ensure provisioningState is Succeeded for each network watcher. az account list-locations --query [?metadata.regionType=='Physical'].{Name:name,DisplayName:regionalDisplayName} -o table This will list all physical regions that exist in the subscription. Compare this list to the previous one to ensure that for each region, a network watcher exists with provisioningState set to Succeeded. From PowerShell Get a list of Network Watchers Get-AzNetworkWatcher Make sure each watcher is set with the ProvisioningState setting set to Succeeded and all Locations are set with a watcher. 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: b6e2945c-0b7b-40f5-9233-7a5323b5cdc6 - Name: 'Network Watcher should be enabled'

Impact Statement

There are additional costs per transaction to run and store network data. For high-volume networks these charges will add up quickly.

Assessment Status

Automated

Rationale Statement

Network diagnostic and visualization tools available with Network Watcher help users understand, diagnose, and gain insights to the network in Azure.

Remediation Procedure

Opting out of Network Watcher automatic enablement is a permanent change. Once you opt-out you cannot opt-in without contacting support. To manually enable Network Watcher in each region where you want to use Network Watcher capabilities, follow the steps below. From Azure Portal 1. Go to Network Watcher. 2. Click Create. 3. Select a Region from the drop-down menu. 4. Click Add. From Azure CLI az network watcher configure --locations <region> --enabled true --resource-group <resource_group>

6.7Ensure that Public IP addresses are Evaluated on a Periodic Basis0
Attributes
Profile

Level 1

Section

6 Networking

Description

Public IP Addresses provide tenant accounts with Internet connectivity for resources contained within the tenant. During the creation of certain resources in Azure, a Public IP Address may be created. All Public IP Addresses within the tenant should be periodically reviewed for accuracy and necessity.

Default Value

During Virtual Machine and Application creation, a setting may create and attach a public IP.

Audit Procedure

From Azure Portal 1. Open the All Resources blade 2. Click on Add Filter 3. In the Add Filter window, select the following: Filter: Type Operator: Equals Value: Public IP address 4. Click the Apply button 5. For each Public IP address in the list, use Overview (or Properties) to review the Associated to: field and determine if the associated resource is still relevant to your tenant environment. If the associated resource is relevant, ensure that additional controls exist to mitigate risk (e.g. Firewalls, VPNs, Traffic Filtering, Virtual Gateway Appliances, Web Application Firewalls, etc.) on all subsequently attached resources. From Azure CLI List all Public IP addresses: az network public-ip list For each Public IP address in the output, review the name property and determine if the associated resource is still relevant to your tenant environment. If the associated resource is relevant, ensure that additional controls exist to mitigate risk (e.g. Firewalls, VPNs, Traffic Filtering, Virtual Gateway Appliances, Web Application Firewalls, etc.) on all subsequently attached resources.

Assessment Status

Manual

Rationale Statement

Public IP Addresses allocated to the tenant should be periodically reviewed for necessity. Public IP Addresses that are not intentionally assigned and controlled present a publicly facing vector for threat actors and significant risk to the tenant.

Remediation Procedure

Remediation will vary significantly depending on your organization's security requirements for the resources attached to each individual Public IP address.

7 Virtual Machines97
7.1Ensure an Azure Bastion Host Exists1
Attributes
Profile

Level 2

Section

7 Virtual Machines

Description

The Azure Bastion service allows secure remote access to Azure Virtual Machines over the Internet without exposing remote access protocol ports and services directly to the Internet. The Azure Bastion service provides this access using TLS over 443/TCP, and subscribes to hardened configurations within an organization's Azure Active Directory service.

Default Value

By default, the Azure Bastion service is not configured.

Audit Procedure

From Azure Portal 1. Click on Bastions 2. Ensure there is at least one Bastion host listed under the Name column From Azure CLI Note: The Azure CLI network bastion module is in Preview as of this writing az network bastion list --subscription <subscription ID> Ensure the output of the above command is not empty. From PowerShell Retrieve the Bastion host(s) information for a specific Resource Group Get-AzBastion -ResourceGroupName <resource group name> Ensure the output of the above command is not empty.

Impact Statement

The Azure Bastion service incurs additional costs and requires a specific virtual network configuration. The Standard tier offers additional configuration options compared to the Basic tier and may incur additional costs for those added features.

Assessment Status

Automated

Rationale Statement

The Azure Bastion service allows organizations a more secure means of accessing Azure Virtual Machines over the Internet without assigning public IP addresses to those Virtual Machines. The Azure Bastion service provides Remote Desktop Protocol (RDP) and Secure Shell (SSH) access to Virtual Machines using TLS within a web browser, thus preventing organizations from opening up 3389/TCP and 22/TCP to the Internet on Azure Virtual Machines. Additional benefits of the Bastion service includes Multi-Factor Authentication, Conditional Access Policies, and any other hardening measures configured within Azure Active Directory using a central point of access.

Remediation Procedure

Remediation Procedures From Azure Portal 1. Click on Bastions 2. Select the Subscription 3. Select the Resource group 4. Type a Name for the new Bastion host 5. Select a Region 6. Choose Standard next to Tier 7. Use the slider to set the Instance count 8. Select the Virtual network or Create new 9. Select the Subnet named AzureBastionSubnet. Create a Subnet named AzureBastionSubnet using a /26 CIDR range if it doesn't already exist. 10. Selct the appropriate Public IP address option. 11. If Create new is selected for the Public IP address option, provide a Public IP address name. 12. If Use existing is selected for Public IP address option, select an IP address from Choose public IP address 13. Click Next: Tags > 14. Configure the appropriate Tags 15. Click Next: Advanced > 16. Select the appropriate Advanced options 17. Click Next: Review + create > 18. Click Create From Azure CLI az network bastion create --location <location> --name <name of bastion host> --public-ip-address <public IP address name or ID> --resource-group <resource group name or ID> --vnet-name <virtual network containing subnet called AzureBastionSubnet> --scale-units <integer> --sku Standard [--disable-copy-paste true|false] [--enable-ip-connect true|false] [--enable-tunneling true|false] From PowerShell Create the appropriate Virtual network settings and Public IP Address settings. $subnetName = AzureBastionSubnet $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix <IP address range in CIDR notation making sure to use a /26> $virtualNet = New-AzVirtualNetwork -Name <virtual network name> -ResourceGroupName <resource group name> -Location <location> -AddressPrefix <IP address range in CIDR notation> -Subnet $subnet $publicip = New-AzPublicIpAddress -ResourceGroupName <resource group name> -Name <public IP address name> -Location <location> -AllocationMethod Dynamic -Sku Standard Create the Azure Bastion service using the information within the created variables from above. New-AzBastion -ResourceGroupName <resource group name> -Name <bastion name> -PublicIpAddress $publicip -VirtualNetwork $virtualNet -Sku Standard -ScaleUnit <integer>

7.2Ensure Virtual Machines are utilizing Managed Disks1
Attributes
Profile

Level 1

Section

7 Virtual Machines

Description

Migrate blob-based VHDs to Managed Disks on Virtual Machines to exploit the default features of this configuration. The features include: 1) Default Disk Encryption 2) Resilience, as Microsoft will managed the disk storage and move around if underlying hardware goes faulty 3) Reduction of costs over storage accounts

Default Value

Managed disks or are an option upon the creation of VMs.

Audit Procedure

From Azure Portal 1. Using the search feature, go to Virtual Machines 2. Click the Manage view dropdown, then select Edit columns 3. Add Uses managed disks to the selected columns 4. Select Save 5. Ensure all virtual machines listed are using managed disks From PowerShell Get-AzVM | ForEach-Object {Name: + $_.Name;ManagedDisk Id: + $_.StorageProfile.OsDisk.ManagedDisk.Id;} Example output: Name: vm1 ManagedDisk Id: /disk1/id Name: vm2 ManagedDisk Id: /disk2/id If the 'ManagedDisk Id' field is empty the os disk for that vm is not managed. 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: 06a78e20-9358-41c9-923c-fb736d382a4d - Name: 'Audit VMs that do not use managed disks'

Impact Statement

There are additional costs for managed disks based off of disk space allocated. When converting to managed disks, VMs will be powered off and back on.

Assessment Status

Automated

Rationale Statement

Managed disks are by default encrypted on the underlying hardware, so no additional encryption is required for basic protection. It is available if additional encryption is required. Managed disks are by design more resilient that storage accounts. For ARM-deployed Virtual Machines, Azure Adviser will at some point recommend moving VHDs to managed disks both from a security and cost management perspective.

Remediation Procedure

From Azure Portal 1. Using the search feature, go to Virtual Machines 2. Select the virtual machine you would like to convert 3. Select Disks in the menu for the VM 4. At the top select Migrate to managed disks 5. You may follow the prompts to convert the disk and finish by selecting Migrate to start the process NOTE VMs will be stopped and restarted after migration is complete. From PowerShell Stop-AzVM -ResourceGroupName $rgName -Name $vmName -Force ConvertTo-AzVMManagedDisk -ResourceGroupName $rgName -VMName $vmName Start-AzVM -ResourceGroupName $rgName -Name $vmName

7.3Ensure that 'OS and Data' disks are encrypted with Customer Managed Key (CMK)1
Attributes
Profile

Level 2

Section

7 Virtual Machines

Description

Ensure that OS disks (boot volumes) and data disks (non-boot volumes) are encrypted with CMK (Customer Managed Keys). Customer Managed keys can be either ADE or Server Side Encryption (SSE).

Default Value

By default, Azure disks are encrypted using SSE with PMK.

Audit Procedure

From Azure Portal 1. Go to Virtual machines 2. For each virtual machine, go to Settings 3. Click on Disks 4. Ensure that the OS disk and Data disks have encryption set to CMK. From PowerShell $ResourceGroupName=yourResourceGroupName $DiskName=yourDiskName $disk=Get-AzDisk -ResourceGroupName $ResourceGroupName -DiskName $DiskName $disk.Encryption.Type 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: 0961003e-5a0a-4549-abde-af6a37f2724d - Name: 'Virtual machines should encrypt temp disks, caches, and data flows between Compute and Storage resources'

Impact Statement

Using CMK/BYOK will entail additional management of keys. NOTE: You must have your key vault set up to utilize this.

Assessment Status

Automated

Rationale Statement

Encrypting the IaaS VM's OS disk (boot volume) and Data disks (non-boot volume) ensures that the entire content is fully unrecoverable without a key, thus protecting the volume from unwanted reads. PMK (Platform Managed Keys) are enabled by default in Azure-managed disks and allow encryption at rest. CMK is recommended because it gives the customer the option to control which specific keys are used for the encryption and decryption of the disk. The customer can then change keys and increase security by disabling them instead of relying on the PMK key that remains unchanging. There is also the option to increase security further by using automatically rotating keys so that access to disk is ensured to be limited. Organizations should evaluate what their security requirements are, however, for the data stored on the disk. For high-risk data using CMK is a must, as it provides extra steps of security. If the data is low risk, PMK is enabled by default and provides sufficient data security.

Remediation Procedure

From Azure Portal Note: Disks must be detached from VMs to have encryption changed. 1. Go to Virtual machines 2. For each virtual machine, go to Settings 3. Click on Disks 4. Click the ellipsis (...), then click Detach to detach the disk from the VM 5. Now search for Disks and locate the unattached disk 6. Click the disk then select Encryption 7. Change your encryption type, then select your encryption set 8. Click Save 9. Go back to the VM and re-attach the disk From PowerShell $KVRGname = 'MyKeyVaultResourceGroup'; $VMRGName = 'MyVirtualMachineResourceGroup'; $vmName = 'MySecureVM'; $KeyVaultName = 'MySecureVault'; $KeyVault = Get-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KVRGname; $diskEncryptionKeyVaultUrl = $KeyVault.VaultUri; $KeyVaultResourceId = $KeyVault.ResourceId; Set-AzVMDiskEncryptionExtension -ResourceGroupName $VMRGname -VMName $vmName -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId; NOTE: During encryption it is likely that a reboot will be required. It may take up to 15 minutes to complete the process. NOTE 2: This may differ for Linux machines as you may need to set the -skipVmBackup parameter

7.4Ensure that 'Unattached disks' are encrypted with 'Customer Managed Key' (CMK)1
Attributes
Profile

Level 2

Section

7 Virtual Machines

Description

Ensure that unattached disks in a subscription are encrypted with a Customer Managed Key (CMK).

Default Value

By default, managed disks are encrypted with a Platform-managed key.

Audit Procedure

From Azure Portal 1. Go to Disks 1. Click on Add Filter 1. In the filter field select Disk state 1. In the Value field select Unattached 1. Click Apply 1. for each disk listed ensure that Encryption type in the encryption blade is Encryption at-rest with a customer-managed key' **From Azure CLI** Ensure command below does not return any output. ``` az disk list --query '[? diskstate == Unattached`].{encryptionSettings: encryptionSettings, name: name}' -o json Sample Output: [ { encryptionSettings: null, name: <Disk1> }, { encryptionSettings: null, name: <Disk2> } ] ``` 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: ca91455f-eace-4f96-be59-e6e2c35b4816 - Name: 'Managed disks should be double encrypted with both platform-managed and customer-managed keys'

Impact Statement

NOTE: You must have your key vault set up to utilize this. Encryption is available only on Standard tier VMs. This might cost you more. Utilizing and maintaining Customer-managed keys will require additional work to create, protect, and rotate keys.

Assessment Status

Automated

Rationale Statement

Managed disks are encrypted by default with Platform-managed keys. Using Customer-managed keys may provide an additional level of security or meet an organization's regulatory requirements. Encrypting managed disks ensures that its entire content is fully unrecoverable without a key and thus protects the volume from unwarranted reads. Even if the disk is not attached to any of the VMs, there is always a risk where a compromised user account with administrative access to VM service can mount/attach these data disks, which may lead to sensitive information disclosure and tampering.

Remediation Procedure

If data stored in the disk is no longer useful, refer to Azure documentation to delete unattached data disks at: -https://docs.microsoft.com/en-us/rest/api/compute/disks/delete -https://docs.microsoft.com/en-us/cli/azure/disk?view=azure-cli-latest#az-disk-delete If data stored in the disk is important, To encrypt the disk refer azure documentation at: -https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-customer-managed-keys-portal -https://docs.microsoft.com/en-us/rest/api/compute/disks/update#encryptionsettings

7.5Ensure that Only Approved Extensions Are Installed0
Attributes
Profile

Level 1

Section

7 Virtual Machines

Description

For added security, only install organization-approved extensions on VMs.

Default Value

By default, no extensions are added to the virtual machines.

Audit Procedure

From Azure Portal 1. Go to Virtual machines. 2. For each virtual machine, click on the server name to select it go to 3. In the new column menu, under Settings Click on Extensions + applications. 4. Ensure that all the listed extensions are approved by your organization for use. From Azure CLI Use the below command to list the extensions attached to a VM, and ensure the listed extensions are approved for use. az vm extension list --vm-name <vmName> --resource-group <sourceGroupName> --query [*].name From PowerShell Get a list of VMs. Get-AzVM For each VM run the following command. Get-AzVMExtension -ResourceGroupName <VM Resource Group> -VMName <VM Name> Review each Name, ExtensionType, and ProvisioningState to make sure no unauthorized extensions are installed on any virtual machines. 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: c0e996f8-39cf-4af9-9f45-83fbde810432 - Name: 'Only approved VM extensions should be installed'

Impact Statement

Functionality by unsupported extensions will be disabled.

Assessment Status

Manual

Rationale Statement

Azure virtual machine extensions are small applications that provide post-deployment configuration and automation tasks on Azure virtual machines. These extensions run with administrative privileges and could potentially access anything on a virtual machine. The Azure Portal and community provide several such extensions. Each organization should carefully evaluate these extensions and ensure that only those that are approved for use are actually implemented.

Remediation Procedure

From Azure Portal 1. Go to Virtual machines 2. For each virtual machine, go to Settings 3. Click on Extensions + applications 4. If there are unapproved extensions, uninstall them. From Azure CLI From the audit command identify the unapproved extensions, and use the below CLI command to remove an unapproved extension attached to VM. az vm extension delete --resource-group <resourceGroupName> --vm-name <vmName> --name <extensionName> From PowerShell For each VM and each insecure extension from the Audit Procedure run the following command. Remove-AzVMExtension -ResourceGroupName <ResourceGroupName> -Name <ExtensionName> -VMName <VirtualMachineName>

7.6Ensure that Endpoint Protection for all Virtual Machines is installed1
Attributes
Profile

Level 2

Section

7 Virtual Machines

Description

Install endpoint protection for all virtual machines.

Default Value

By default Endpoint Protection is disabled.

Audit Procedure

From Azure Portal 1. Go to Security Center 2. Click the Recommendations blade 3. Ensure that there are no recommendations for Endpoint Protection not installed on Azure VMs From Azure CLI az vm show -g <MyResourceGroup> -n <MyVm> -d --query resources[?type=='Microsoft.Compute/virtualMachines/extensions'].{ExtensionName:name} -o table If extensions are installed, it will list the installed extensions. EndpointSecurity || TrendMicroDSA* || Antimalware || EndpointProtection || SCWPAgent || PortalProtectExtension* || FileSecurity* Alternatively, you can employ your own endpoint protection tool for your OS. 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: 1f7c564c-0a90-4d44-b7e1-9d456cffaee8 - Name: 'Endpoint protection should be installed on your machines'

Impact Statement

Endpoint protection will incur an additional cost to you.

Assessment Status

Manual

Rationale Statement

Installing endpoint protection systems (like anti-malware for Azure) provides for real-time protection capability that helps identify and remove viruses, spyware, and other malicious software. These also offer configurable alerts when known-malicious or unwanted software attempts to install itself or run on Azure systems.

Remediation Procedure

Follow Microsoft Azure documentation to install endpoint protection from the security center. Alternatively, you can employ your own endpoint protection tool for your OS.

7.7[Legacy] Ensure that VHDs are Encrypted0
Attributes
Profile

Level 2

Section

7 Virtual Machines

References

CLI: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disk-encryption-cli-quickstart:Powershell: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disk-encryption-powershell-quickstart:https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-data-protection#dp-4-enable-data-at-rest-encryption-by-default:Convert VHD to Managed Disk: https://docs.microsoft.com/en-us/previous-versions/azure/virtual-machines/scripts/virtual-machines-powershell-sample-create-managed-disk-from-vhd

Description

NOTE: This is a legacy recommendation. Managed Disks are encrypted by default and recommended for all new VM implementations. VHD (Virtual Hard Disks) are stored in blob storage and are the old-style disks that were attached to Virtual Machines. The blob VHD was then leased to the VM. By default, storage accounts are not encrypted, and Microsoft Defender will then recommend that the OS disks should be encrypted. Storage accounts can be encrypted as a whole using PMK or CMK. This should be turned on for storage accounts containing VHDs.

Default Value

The default value for encryption is NO Encryption

Audit Procedure

From Azure CLI For each virtual machine identify if the VM is using a legacy VHD by reviewing the VHD parameter in the output of the following command. The VHD parameter will contain the Storage Account name used for the VHD. az vm show --name <MyVM> --resource-group <MyResourceGroup> Next, identify if the storage account from the VHD parameter is encrypted by reviewing the encryption --> services --> blob --> enabled within the output of the following command and make sure its value is True. az storage account show --name <storage account name> --resource-group <resource group> From PowerShell: Determine whether the VM is using a VHD for the OS Disk and any Data disks. $virtualMachine = Get-AzVM --Name <vm name> --ResourceGroup <resource group name> |Select-Object -ExpandProperty StorageProfile $virtualMachine.OsDisk $virtualMachine.DataDisks Next, use the value from VHD to see if the storage blob holding the VHD is encrypted. $storageAccount = Get-AzStorageAccount -Name <storage account name from VHD setting> -ResourceGroupName <resource group name> $storageAccount.Encryption.Services.Blob 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: 702dd420-7fcc-42c5-afe8-4026edd20fe0 - Name: 'OS and data disks should be encrypted with a customer-managed key'

Impact Statement

Depending on how the encryption is implemented will change the size of the impact. If provider-managed keys(PMK) are utilized, the impact is relatively low, but processes need to be put in place to regularly rotate the keys. If Customer-managed keys(CMK) are utilized, a key management process needs to be implemented to store and manage key rotation, thus the impact is medium to high depending on user maturity with key management.

Assessment Status

Manual

Rationale Statement

While it is recommended to use Managed Disks which are encrypted by default, legacy VHDs may exist for a variety of reasons and may need to remain in VHD format. VHDs are not encrypted by default, so this recommendation intends to address the security of these disks. In these niche cases, VHDs should be encrypted using the procedures in this recommendation to encrypt and protect the data content. If a virtual machine is using a VHD and can be converted to a managed disk, instructions for this procedure can be found in the resources section of this recommendation under the title Convert VHD to Managed Disk.

Remediation Procedure

From Azure Portal 1. Navigate to the storage account that you wish to encrypt 2. Select encryption 3. Select the encryption type that you wish to use If you wish to use a Microsoft-managed key (the default), you can save at this point and encryption will be applied to the account. If you select Customer-managed keys, it will ask for the location of the key (The default is an Azure Key Vault) and the key name. Once these are captured, save the configuration and the account will be encrypted using the provided key. From Azure CLI: Create the Key Vault az keyvault create --name <name> --resource-group <resourceGroup> --location <location> --enabled-for-disk-encryption Encrypt the disk and store the key in Key Vault az vm encryption enable -g <resourceGroup> --name <name> --disk-encryption-keyvault myKV From PowerShell This process uses a Key Vault to store the keys Create the Key Vault New-AzKeyvault -name <name> -ResourceGroupName <resourceGroup> -Location <location> -EnabledForDiskEncryption Encrypt the disk and store the key in Key Vault $KeyVault = Get-AzKeyVault -VaultName <name> -ResourceGroupName <resourceGroup> Set-AzVMDiskEncryptionExtension -ResourceGroupName <resourceGroup> -VMName <name> -DiskEncryptionKeyVaultUrl $KeyVault.VaultUri -DiskEncryptionKeyVaultId $KeyVault.ResourceId

7.8Ensure only MFA enabled identities can access privileged Virtual Machine1
Attributes
Profile

Level 2

Section

7 Virtual Machines

Description

Verify identities without MFA that can log in to a privileged virtual machine using separate login credentials. An adversary can leverage the access to move laterally and perform actions with the virtual machine's managed identity. Make sure the virtual machine only has necessary permissions, and revoke the admin-level permissions according to the least privileges principal

Audit Procedure

From Azure Portal 1. Log in to the Azure portal. 2. Select the Subscription, then click on Access control (IAM). 3. Select Role Assignments from the top menu and apply filters on Assignment type as Privileged administrator roles and Type as Virtual Machines. 4. Verify the list of privileged managed identities attached to any virtual machine. 5. If there are privileged managed identities from the above list, then check the list of users without MFA by navigating to Azure AD. 6. In the left navigation pane select Users from Manage. 7. Click on Per-User MFA from the top menu options and for each user with MULTI-FACTOR AUTH STATUS as Disabled follow the below-mentioned steps: * Select the Subscription, then click on Access control (IAM). * Select Check access and click on User, group, or service principal. * Enter the user name or email and verify there are no role assignments on the user that provides access like Virtual Machine Administrator Login or Virtual Machine User Login. Make sure this follows the least privileges principal.

Impact Statement

this recommendation requires an Azure AD P2 License to implement. Ensure that identities that are provisioned to a virtual machine utilizes an RBAC/ABAC group and is allocated a role using Azure PIM, and the Role settings require MFA or use another PAM solution (like CyberArk) for accessing Virtual Machines.

Assessment Status

Automated

Rationale Statement

Integrating multi-factor authentication (MFA) as part of the organizational policy can greatly reduce the risk of an identity gaining control of valid credentials that may be used for additional tactics such as initial access, lateral movement, and collecting information. MFA can also be used to restrict access to cloud resources and APIs. An Adversary may log into accessible cloud services within a compromised environment using Valid Accounts that are synchronized to move laterally and perform actions with the virtual machine's managed identity. The adversary may then perform management actions or access cloud-hosted resources as the logged-on managed identity.

Remediation Procedure

From Azure Portal 1. Log in to the Azure portal. 2. This can be remediated by enabling MFA for user, Removing user access or Reducing access of managed identities attached to virtual machines. - Case I : Enable MFA for users having access on virtual machines. 1. Navigate to Azure AD from the left pane and select Users from the Manage section. 2. Click on Per-User MFA from the top menu options and select each user with MULTI-FACTOR AUTH STATUS as Disabled and can login to virtual machines: * From quick steps on the right side select enable. * Click on enable multi-factor auth and share the link with the user to setup MFA as required. - Case II : Removing user access on a virtual machine. 1. Select the Subscription, then click on Access control (IAM). 2. Select Role assignments and search for Virtual Machine Administrator Login or Virtual Machine User Login or any role that provides access to log into virtual machines. 3. Click on Role Name, Select Assignments, and remove identities with no MFA configured. - Case III : Reducing access of managed identities attached to virtual machines. 1. Select the Subscription, then click on Access control (IAM). 2. Select Role Assignments from the top menu and apply filters on Assignment type as Privileged administrator roles and Type as Virtual Machines. 3. Click on Role Name, Select Assignments, and remove identities access make sure this follows the least privileges principal.

7.9Ensure Trusted Launch is enabled on Virtual Machines1
Attributes
Profile

Level 1

Section

7 Virtual Machines

Description

When Secure Boot and vTPM are enabled together, they provide a strong foundation for protecting your VM from boot attacks. For example, if an attacker attempts to replace the bootloader with a malicious version, Secure Boot will prevent the VM from booting. If the attacker is able to bypass Secure Boot and install a malicious bootloader, vTPM can be used to detect the intrusion and alert you.

Default Value

On Azure Generation 2 VMs, vTPM is enabled by default. Secure Boot is not enabled by default.

Audit Procedure

From Azure Portal 1. Go to Virtual Machines 1. For each VM, under Settings, click on Configuration on the left blade 1. Under Security Type, make sure security type is not standard and if it is Trusted Launch Virtual Machines then make sure Enable Secure Boot & Enable vTPM are checked 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: 97566dd7-78ae-4997-8b36-1c7bfe0d8121 - Name: '[Preview]: Secure Boot should be enabled on supported Windows virtual machines'

Impact Statement

Secure Boot and vTPM are not currently supported for Azure Generation 1 VMs. IMPORTANT: Before enabling Secure Boot and vTPM on a Generation 2 VM which does not already have both enabled, it is highly recommended to create a restore point of the VM prior to remediation.

Assessment Status

Automated

Rationale Statement

Secure Boot and vTPM work together to protect your VM from a variety of boot attacks, including bootkits, rootkits, and firmware rootkits. Not enabling Trusted Launch in Azure VM can lead to increased vulnerability to rootkits and boot-level malware, reduced ability to detect and prevent unauthorized changes to the boot process, and a potential compromise of system integrity and data security.

Remediation Procedure

From Azure Portal 1. Go to Virtual Machines 1. For each VM, under Settings, click on Configuration on the left blade 1. Under Security Type, select 'Trusted Launch Virtual Machines' 1. Make sure Enable Secure Boot & Enable vTPM are checked 1. Click on Apply. Note: Trusted launch on existing virtual machines (VMs) is currently not supported for Azure Generation 1 VMs

8 Key Vault88
8.1Ensure that the Expiration Date is set for all Keys in RBAC Key Vaults1
Attributes
Profile

Level 1

Section

8 Key Vault

Description

Ensure that all Keys in Role Based Access Control (RBAC) Azure Key Vaults have an expiration date set.

Default Value

By default, keys do not expire.

Audit Procedure

From Azure Portal: 1. Go to Key vaults. 2. For each Key vault, click on Keys. 3. In the main pane, ensure that an appropriate Expiration date is set for any keys that are Enabled. From Azure CLI: Get a list of all the key vaults in your Azure environment by running the following command: az keyvault list Then for each key vault listed ensure that the output of the below command contains Key ID (kid), enabled status as true and Expiration date (expires) is not empty or null: az keyvault key list --vault-name <VaultName> --query '[*].{kid:kid,enabled:attributes.enabled,expires:attributes.expires}' From PowerShell: Retrieve a list of Azure Key vaults: Get-AzKeyVault For each Key vault run the following command to determine which vaults are configured to use RBAC. Get-AzKeyVault -VaultName <VaultName> For each Key vault with the EnableRbacAuthorizatoin setting set to True, run the following command. Get-AzKeyVaultKey -VaultName <VaultName> Make sure the Expires setting is configured with a value as appropriate wherever the Enabled setting is set to True. 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: 152b15f7-8e1f-4c1f-ab71-8c010ba5dbc0 - Name: 'Key Vault keys should have an expiration date'

Impact Statement

Keys cannot be used beyond their assigned expiration dates respectively. Keys need to be rotated periodically wherever they are used.

Assessment Status

Automated

Rationale Statement

Azure Key Vault enables users to store and use cryptographic keys within the Microsoft Azure environment. The exp (expiration date) attribute identifies the expiration date on or after which the key MUST NOT be used for encryption of new data, wrapping of new keys, and signing. By default, keys never expire. It is thus recommended that keys be rotated in the key vault and set an explicit expiration date for all keys to help enforce the key rotation. This ensures that the keys cannot be used beyond their assigned lifetimes.

Remediation Procedure

From Azure Portal: 1. Go to Key vaults. 2. For each Key vault, click on Keys. 3. In the main pane, ensure that an appropriate Expiration date is set for any keys that are Enabled. From Azure CLI: Update the Expiration date for the key using the below command: az keyvault key set-attributes --name <keyName> --vault-name <vaultName> --expires Y-m-d'T'H:M:S'Z' Note: To view the expiration date on all keys in a Key Vault using Microsoft API, the List Key permission is required. To update the expiration date for the keys: 1. Go to the Key vault, click on Access Control (IAM). 2. Click on Add role assignment and assign the role of Key Vault Crypto Officer to the appropriate user. From PowerShell: Set-AzKeyVaultKeyAttribute -VaultName <VaultName> -Name <KeyName> -Expires <DateTime>

8.2Ensure that the Expiration Date is set for all Keys in Non-RBAC Key Vaults.1
Attributes
Profile

Level 1

Section

8 Key Vault

Description

Ensure that all Keys in Non Role Based Access Control (RBAC) Azure Key Vaults have an expiration date set.

Default Value

By default, keys do not expire.

Audit Procedure

From Azure Portal: 1. Go to Key vaults. 2. For each Key vault, click on Keys. 3. In the main pane, ensure that the status of the key is Enabled. 4. For each enabled key, ensure that an appropriate Expiration date is set. From Azure CLI: Get a list of all the key vaults in your Azure environment by running the following command: az keyvault list For each key vault, ensure that the output of the below command contains Key ID (kid), enabled status as true and Expiration date (expires) is not empty or null: az keyvault key list --vault-name <KEYVAULTNAME> --query '[*].{kid:kid,enabled:attributes.enabled,expires:attributes.expires}' From PowerShell: Retrieve a list of Azure Key vaults: Get-AzKeyVault For each Key vault, run the following command to determine which vaults are configured to not use RBAC: Get-AzKeyVault -VaultName <Vault Name> For each Key vault with the EnableRbacAuthorizatoin setting set to False or empty, run the following command. Get-AzKeyVaultKey -VaultName <Vault Name> Make sure the Expires setting is configured with a value as appropriate wherever the Enabled setting is set to True. 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: 152b15f7-8e1f-4c1f-ab71-8c010ba5dbc0 - Name: 'Key Vault keys should have an expiration date'

Impact Statement

Keys cannot be used beyond their assigned expiration dates respectively. Keys need to be rotated periodically wherever they are used.

Assessment Status

Automated

Rationale Statement

Azure Key Vault enables users to store and use cryptographic keys within the Microsoft Azure environment. The exp (expiration date) attribute identifies the expiration date on or after which the key MUST NOT be used for a cryptographic operation. By default, keys never expire. It is thus recommended that keys be rotated in the key vault and set an explicit expiration date for all keys. This ensures that the keys cannot be used beyond their assigned lifetimes.

Remediation Procedure

From Azure Portal: 1. Go to Key vaults. 2. For each Key vault, click on Keys. 3. In the main pane, ensure that the status of the key is Enabled. 4. For each enabled key, ensure that an appropriate Expiration date is set. From Azure CLI: Update the Expiration date for the key using the below command: az keyvault key set-attributes --name <keyName> --vault-name <vaultName> --expires Y-m-d'T'H:M:S'Z' Note: To view the expiration date on all keys in a Key Vault using Microsoft API, the List Key permission is required. To update the expiration date for the keys: 1. Go to Key vault, click on Access policies. 2. Click on Create and add an access policy with the Update permission (in the Key Permissions - Key Management Operations section). From PowerShell Set-AzKeyVaultKeyAttribute -VaultName <Vault Name> -Name <Key Name> -Expires <DateTime>

8.3Ensure that the Expiration Date is set for all Secrets in RBAC Key Vaults1
Attributes
Profile

Level 1

Section

8 Key Vault

Description

Ensure that all Secrets in Role Based Access Control (RBAC) Azure Key Vaults have an expiration date set.

Default Value

By default, secrets do not expire.

Audit Procedure

From Azure Portal: 1. Go to Key vaults. 2. For each Key vault, click on Secrets. 3. In the main pane, ensure that the status of the secret is Enabled. 4. For each enabled secret, ensure that an appropriate Expiration date is set. From Azure CLI: Ensure that the output of the below command contains ID (id), enabled status as true and Expiration date (expires) is not empty or null: az keyvault secret list --vault-name <KEYVAULTNAME> --query '[*].{kid:kid,enabled:attributes.enabled,expires:attributes.expires}' From PowerShell: Retrieve a list of Key vaults: Get-AzKeyVault For each Key vault, run the following command to determine which vaults are configured to use RBAC: Get-AzKeyVault -VaultName <Vault Name> For each Key vault with the EnableRbacAuthorizatoin setting set to True, run the following command: Get-AzKeyVaultSecret -VaultName <Vault Name> Make sure the Expires setting is configured with a value as appropriate wherever the Enabled setting is set to True. 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: 98728c90-32c7-4049-8429-847dc0f4fe37 - Name: 'Key Vault secrets should have an expiration date'

Impact Statement

Secrets cannot be used beyond their assigned expiry date respectively. Secrets need to be rotated periodically wherever they are used.

Assessment Status

Automated

Rationale Statement

The Azure Key Vault enables users to store and keep secrets within the Microsoft Azure environment. Secrets in the Azure Key Vault are octet sequences with a maximum size of 25k bytes each. The exp (expiration date) attribute identifies the expiration date on or after which the secret MUST NOT be used. By default, secrets never expire. It is thus recommended to rotate secrets in the key vault and set an explicit expiration date for all secrets. This ensures that the secrets cannot be used beyond their assigned lifetimes.

Remediation Procedure

From Azure Portal: 1. Go to Key vaults. 2. For each Key vault, click on Secrets. 3. In the main pane, ensure that the status of the secret is Enabled. 4. For each enabled secret, ensure that an appropriate Expiration date is set. From Azure CLI: Update the Expiration date for the secret using the below command: az keyvault secret set-attributes --name <secretName> --vault-name <vaultName> --expires Y-m-d'T'H:M:S'Z' Note: To view the expiration date on all secrets in a Key Vault using Microsoft API, the List Key permission is required. To update the expiration date for the secrets: 1. Go to the Key vault, click on Access Control (IAM). 2. Click on Add role assignment and assign the role of Key Vault Secrets Officer to the appropriate user. From PowerShell: Set-AzKeyVaultSecretAttribute -VaultName <Vault Name> -Name <Secret Name> -Expires <DateTime>

8.4Ensure that the Expiration Date is set for all Secrets in Non-RBAC Key Vaults1
Attributes
Profile

Level 1

Section

8 Key Vault

Description

Ensure that all Secrets in Non Role Based Access Control (RBAC) Azure Key Vaults have an expiration date set.

Default Value

By default, secrets do not expire.

Audit Procedure

From Azure Portal: 1. Go to Key vaults. 2. For each Key vault, click on Secrets. 3. In the main pane, ensure that the status of the secret is Enabled. 4. Set an appropriate Expiration date on all secrets. From Azure CLI: Get a list of all the key vaults in your Azure environment by running the following command: az keyvault list For each key vault, ensure that the output of the below command contains ID (id), enabled status as true and Expiration date (expires) is not empty or null: az keyvault secret list --vault-name <KEYVALUTNAME> --query '[*].{kid:kid,enabled:attributes.enabled,expires:attributes.expires}' From PowerShell: Retrieve a list of Key vaults: Get-AzKeyVault For each Key vault run the following command to determine which vaults are configured to use RBAC: Get-AzKeyVault -VaultName <Vault Name> For each Key Vault with the EnableRbacAuthorization setting set to False or empty, run the following command. Get-AzKeyVaultSecret -VaultName <Vault Name> Make sure the Expires setting is configured with a value as appropriate wherever the Enabled setting is set to True. 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: 98728c90-32c7-4049-8429-847dc0f4fe37 - Name: 'Key Vault secrets should have an expiration date'

Impact Statement

Secrets cannot be used beyond their assigned expiry date respectively. Secrets need to be rotated periodically wherever they are used.

Assessment Status

Automated

Rationale Statement

The Azure Key Vault enables users to store and keep secrets within the Microsoft Azure environment. Secrets in the Azure Key Vault are octet sequences with a maximum size of 25k bytes each. The exp (expiration date) attribute identifies the expiration date on or after which the secret MUST NOT be used. By default, secrets never expire. It is thus recommended to rotate secrets in the key vault and set an explicit expiration date for all secrets. This ensures that the secrets cannot be used beyond their assigned lifetimes.

Remediation Procedure

From Azure Portal: 1. Go to Key vaults. 2. For each Key vault, click on Secrets. 3. In the main pane, ensure that the status of the secret is Enabled. 4. Set an appropriate Expiration date on all secrets. From Azure CLI: Update the Expiration date for the secret using the below command: az keyvault secret set-attributes --name <secretName> --vault-name <vaultName> --expires Y-m-d'T'H:M:S'Z' Note: To view the expiration date on all secrets in a Key Vault using Microsoft API, the List Key permission is required. To update the expiration date for the secrets: 1. Go to Key vault, click on Access policies. 2. Click on Create and add an access policy with the Update permission (in the Secret Permissions - Secret Management Operations section). From PowerShell: For each Key vault with the EnableRbacAuthorization setting set to False or empty, run the following command. Set-AzKeyVaultSecret -VaultName <Vault Name> -Name <Secret Name> -Expires <DateTime>

8.5Ensure the Key Vault is Recoverable1
Attributes
Profile

Level 1

Section

8 Key Vault

Description

The Key Vault contains object keys, secrets, and certificates. Accidental unavailability of a Key Vault can cause immediate data loss or loss of security functions (authentication, validation, verification, non-repudiation, etc.) supported by the Key Vault objects. It is recommended the Key Vault be made recoverable by enabling the Do Not Purge and Soft Delete functions. This is in order to prevent loss of encrypted data, including storage accounts, SQL databases, and/or dependent services provided by Key Vault objects (Keys, Secrets, Certificates) etc. This may happen in the case of accidental deletion by a user or from disruptive activity by a malicious user. WARNING: A current limitation is that role assignments disappearing when Key Vault is deleted. All role assignments will need to be recreated after recovery.

Default Value

When a new Key Vault is created, both the parameters enableSoftDelete and enablePurgeProtection are set to null, disabling both the features.

Audit Procedure

From Azure Portal 1. Go to Key Vaults 2. For each Key Vault 3. Click Properties 4. Ensure the Enable purge protection (enforce a mandatory retention period for deleted vaults and vault objects) is selected for Purge protection option on this key vault **From Azure CLI** 1. List all Resources of type Key Vaults: ``` az resource list --query [?type=='Microsoft.KeyVault/vaults'] ``` 2. For Every Key Vault ID ensure check parametersenablePurgeProtectionis set to true. ``` az resource show --id /subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/<resourceGroupName>/providers/Microsoft.KeyVault /vaults/<keyVaultName> ``` **From PowerShell** Get all Key Vaults. ``` Get-AzKeyVault ``` For each Key Vault run the following command. ``` Get-AzKeyVault -VaultName <Vault Name> ``` Examine the results of the above command for theEnablePurgeProtectionsetting. Make sure enablePurgeProtection is set toTrue`.

Impact Statement

Once purge-protection and soft-delete are enabled for a Key Vault, the action is irreversible.

Assessment Status

Automated

Rationale Statement

There could be scenarios where users accidentally run delete/purge commands on Key Vault or an attacker/malicious user deliberately does so in order to cause disruption. Deleting or purging a Key Vault leads to immediate data loss, as keys encrypting data and secrets/certificates allowing access/services will become non-accessible. There is a Key Vault property that plays a role in permanent unavailability of a Key Vault: enablePurgeProtection: Setting this parameter to true for a Key Vault ensures that even if Key Vault is deleted, Key Vault itself or its objects remain recoverable for the next 90 days. Key Vault/objects can either be recovered or purged (permanent deletion) during those 90 days. If no action is taken, the key vault and its objects will subsequently be purged. Enabling the enablePurgeProtection parameter on Key Vaults ensures that Key Vaults and their objects cannot be deleted/purged permanently.

Remediation Procedure

To enable Do Not Purge and Soft Delete for a Key Vault: From Azure Portal 1. Go to Key Vaults 2. For each Key Vault 3. Click Properties 4. Ensure the status of Purge protection reads Enable purge protection (enforce a mandatory retention period for deleted vaults and vault objects). Note, once enabled you cannot disable it. From Azure CLI az resource update --id /subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/<resourceGroupName>/providers/Microsoft.KeyVault /vaults/<keyVaultName> --set properties.enablePurgeProtection=true From PowerShell Update-AzKeyVault -VaultName <vaultName -ResourceGroupName <resourceGroupName -EnablePurgeProtection

Additional Information

When a key is used for SQL server TDE or Encrypting Storage Account, both the features Do Not Purge and Soft Delete are enabled for the corresponding Key Vault by default by Azure Backend. WARNING: A current limitation of the soft-delete feature across all Azure services is role assignments disappearing when Key Vault is deleted. All role assignments will need to be recreated after recovery.

8.6Enable Role Based Access Control for Azure Key Vault1
Attributes
Profile

Level 2

Section

8 Key Vault

Description

WARNING: Role assignments disappear when a Key Vault has been deleted (soft-delete) and recovered. Afterwards it will be required to recreate all role assignments. This is a limitation of the soft-delete feature across all Azure services.

Default Value

The default value for Access control in Key Vaults is Vault Policy.

Audit Procedure

From Azure Portal 1. From Azure Home open the Portal Menu in the top left corner 2. Select Key Vaults 3. Select a Key Vault to audit 4. Select Access configuration 5. Ensure the Permission Model radio button is set to Azure role-based access control From Azure CLI* Run the following command for each Key Vault in each Resource Group: az keyvault show --resource-group <RESOURCE GROUP NAME> --name <KEY VAULT NAME> Ensure the enableRbacAuthorization setting is set to true within the output of the above command. From PowerShell Run the following PowerShell command: Get-AzKeyVault -Vaultname <KEY VAULT NAME> -ResourceGroupName <RESOURCE GROUP NAME> Ensure the Enabled For RBAC Authorization setting is set to True 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: 12d4fa5e-1f9f-4c21-97a9-b99b3c6611b5 - Name: '[Preview]: Azure Key Vault should use RBAC permission model'

Impact Statement

Implementation needs to be properly designed from the ground up, as this is a fundamental change to the way key vaults are accessed/managed. Changing permissions to key vaults will result in loss of service as permissions are re-applied. For the least amount of downtime, map your current groups and users to their corresponding permission needs.

Assessment Status

Manual

Rationale Statement

The new RBAC permissions model for Key Vaults enables a much finer grained access control for key vault secrets, keys, certificates, etc., than the vault access policy. This in turn will permit the use of privileged identity management over these roles, thus securing the key vaults with JIT Access management.

Remediation Procedure

From Azure Portal Key Vaults can be configured to use Azure role-based access control on creation. For existing Key Vaults: 1. From Azure Home open the Portal Menu in the top left corner 2. Select Key Vaults 3. Select a Key Vault to audit 4. Select Access configuration 5. Set the Permission model radio button to Azure role-based access control, taking note of the warning message 6. Click Save 7. Select Access Control (IAM) 8. Select the Role Assignments tab 9. Reapply permissions as needed to groups or users From Azure CLI* To enable RBAC Authorization for each Key Vault, run the following Azure CLI command: az keyvault update --resource-group <RESOURCE GROUP NAME> --name <KEY VAULT NAME> --enable-rbac-authorization true From PowerShell To enable RBAC authorization on each Key Vault, run the following PowerShell command: Update-AzKeyVault -ResourceGroupName <RESOURCE GROUP NAME> -VaultName <KEY VAULT NAME> -EnableRbacAuthorization $True

8.7Ensure that Private Endpoints are Used for Azure Key Vault1
Attributes
Profile

Level 2

Section

8 Key Vault

Description

Private endpoints will secure network traffic from Azure Key Vault to the resources requesting secrets and keys.

Default Value

By default, Private Endpoints are not enabled for any services within Azure.

Audit Procedure

From Azure Portal 1. From Azure Home open the Portal Menu in the top left. 2. Select Key Vaults. 3. Select a Key Vault to audit. 4. Select Networking in the left column. 5. Select Private endpoint connections from the top row. 6. View if there is an endpoint attached. From Azure CLI Run the following command within a subscription for each Key Vault you wish to audit. az keyvault private-endpoint-connection show -g <resourceGroup> --vault-name <keyVaultName> From Powershell Run the following command within a subscription for each Key Vault you wish to audit. Get-AzPrivateEndpointConnection -PrivateLinkResourceId '/subscriptions/<subscriptionNumber>/resourceGroups/<resourceGroup>/providers/Microsoft.KeyVault/vaults/<keyVaultName>/' 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: a6abeaec-4d90-4a02-805f-6b26c4d3fbe9 - Name: 'Azure Key Vaults should use private link'

Impact Statement

Incorrect or poorly-timed changing of network configuration could result in service interruption. There are also additional costs tiers for running a private endpoint per petabyte or more of networking traffic.

Assessment Status

Manual

Rationale Statement

Private endpoints will keep network requests to Azure Key Vault limited to the endpoints attached to the resources that are whitelisted to communicate with each other. Assigning the Key Vault to a network without an endpoint will allow other resources on that network to view all traffic from the Key Vault to its destination. In spite of the complexity in configuration, this is recommended for high security secrets.

Remediation Procedure

Please see the additional information about the requirements needed before starting this remediation procedure. From Azure Portal 1. From Azure Home open the Portal Menu in the top left. 2. Select Key Vaults. 3. Select a Key Vault to audit. 4. Select Networking in the left column. 5. Select Private endpoint connections from the top row. 6. Select + Create. 7. Select the subscription the Key Vault is within, and other desired configuration. 8. Select Next. 9. For resource type select Microsoft.KeyVault/vaults. 10. Select the Key Vault to associate the Private Endpoint with. 11. Select Next. 12. In the Virtual Networking field, select the network to assign the Endpoint. 13. Select other configuration options as desired, including an existing or new application security group. 14. Select Next. 15. Select the private DNS the Private Endpoints will use. 16. Select Next. 17. Optionally add Tags. 18. Select Next : Review + Create. 19. Review the information and select Create. Follow the Audit Procedure to determine if it has successfully applied. 20. Repeat steps 3-19 for each Key Vault. From Azure CLI 1. To create an endpoint, run the following command: az network private-endpoint create --resource-group <resourceGroup --vnet-name <vnetName> --subnet <subnetName> --name <PrivateEndpointName> --private-connection-resource-id /subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<resourceGroup>/providers/Microsoft.KeyVault/vaults/<keyVaultName> --group-ids vault --connection-name <privateLinkConnectionName> --location <azureRegion> --manual-request 2. To manually approve the endpoint request, run the following command: az keyvault private-endpoint-connection approve --resource-group <resourceGroup> --vault-name <keyVaultName> –name <privateLinkName> 4. Determine the Private Endpoint's IP address to connect the Key Vault to the Private DNS you have previously created: 5. Look for the property networkInterfaces then id; the value must be placed in the variable <privateEndpointNIC> within step 7. az network private-endpoint show -g <resourceGroupName> -n <privateEndpointName> 6. Look for the property networkInterfaces then id; the value must be placed on <privateEndpointNIC> in step 7. az network nic show --ids <privateEndpointName> 7. Create a Private DNS record within the DNS Zone you created for the Private Endpoint: az network private-dns record-set a add-record -g <resourcecGroupName> -z privatelink.vaultcore.azure.net -n <keyVaultName> -a <privateEndpointNIC> 8. nslookup the private endpoint to determine if the DNS record is correct: nslookup <keyVaultName>.vault.azure.net nslookup <keyVaultName>.privatelink.vaultcore.azure.n

Additional Information

This recommendation assumes that you have created a Resource Group containing a Virtual Network that the services are already associated with and configured private DNS. A Bastion on the virtual network is also required, and the service to which you are connecting must already have a Private Endpoint. For information concerning the installation of these services, please see the attached documentation. Microsoft's own documentation lists the requirements as: A Key Vault. An Azure virtual network. A subnet in the virtual network. Owner or contributor permissions for both the Key Vault and the virtual network.

8.8Ensure Automatic Key Rotation is Enabled Within Azure Key Vault for the Supported Services1
Attributes
Profile

Level 2

Section

8 Key Vault

Description

Automatic Key Rotation is available in Public Preview. The currently supported applications are Key Vault, Managed Disks, and Storage accounts accessing keys within Key Vault. The number of supported applications will incrementally increased.

Default Value

By default, Automatic Key Rotation is not enabled.

Audit Procedure

From Azure Portal 1. From Azure Portal select the Portal Menu in the top left. 2. Select Key Vaults. 3. Select a Key Vault to audit. 4. Under Objects select Keys. 5. Select a key to audit. 6. In the top row select Rotation policy. 7. Ensure Enable auto rotation is set to Enabled. 8. Repeat steps 3-7 for each Key Vault and Key. From Azure CLI Run the following command: az keyvault key rotation-policy show --vaultname <vaultName> --name <keyName> From PowerShell Run the following command: Get-AzKeyVaultKeyRotationPolicy -VaultName <vaultName> -Name <keyName> 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: d8cf8476-a2ec-4916-896e-992351803c44 - Name: 'Keys should have a rotation policy ensuring that their rotation is scheduled within the specified number of days after creation.'

Impact Statement

There are an additional costs per operation in running the needed applications.

Assessment Status

Manual

Rationale Statement

Once set up, Automatic Private Key Rotation removes the need for manual administration when keys expire at intervals determined by your organization's policy. The recommended key lifetime is 2 years. Your organization should determine its own key expiration policy.

Remediation Procedure

Note: Azure CLI and Powershell use ISO8601 flags to input timespans. Every timespan input will be in the format P<timespanInISO8601Format>(Y,M,D). The leading P is required with it denoting period. The (Y,M,D) are for the duration of Year, Month,and Day respectively. A time frame of 2 years, 2 months, 2 days would be (P2Y2M2D). From Azure Portal 1. From Azure Portal select the Portal Menu in the top left. 2. Select Key Vaults. 3. Select a Key Vault to audit. 4. Under Objects select Keys. 5. Select a key to audit. 6. In the top row select Rotation policy. 7. Select an Expiry time. 8. Set Enable auto rotation to Enabled. 9. Set an appropriate Rotation option and Rotation time. 10. Optionally set the Notification time. 11. Select Save. 12. Repeat steps 3-11 for each Key Vault and Key. From Azure CLI Run the following command for each key to update its policy to be auto-rotated: az keyvault key rotation-policy update -n <keyName> --vault-name <vaultName> --value <path/to/policy.json> Note: It is easiest to supply the policy flags in a .json file. An example json file would be: { lifetimeActions: [ { trigger: { timeAfterCreate: <timespanInISO8601Format>, timeBeforeExpiry : null }, action: { type: Rotate } }, { trigger: { timeBeforeExpiry : <timespanInISO8601Format> }, action: { type: Notify } } ], attributes: { expiryTime: <timespanInISO8601Format> } } From PowerShell Run the following command for each key to update its policy: Set-AzKeyVaultKeyRotationPolicy -VaultName test-kv -Name test-key -PolicyPath rotation_policy.json Note: It is easiest to supply the policy flags in a .json file. An example json file would be: <# rotation_policy.json { lifetimeActions: [ { trigger: { timeAfterCreate: P<timespanInISO8601Format>M, timeBeforeExpiry: null }, action: { type: Rotate } }, { trigger: { timeBeforeExpiry: P<timespanInISO8601Format>D }, action: { type: Notify } } ], attributes: { expiryTime: P<timespanInISO8601Format>Y } } #>

Additional Information

Automatic Key Rotation is in public preview, so any configuration will not change upon full release. **Note: ** Azure CLI and Powershell use ISO8601 flags to input timespans. Every timespan input will be in the format P<timespanInISO8601Format>(Y,M,D). The leading P is required with it denoting period. The (Y,M,D) are for the duration of Year, Month, Day respectively. A time frame of 2 years, 2 months, 2 days would be (P2Y2M2D).

9 AppService109
9.1Ensure App Service Authentication is set up for apps in Azure App Service1
Attributes
Profile

Level 2

Section

9 AppService

Description

Azure App Service Authentication is a feature that can prevent anonymous HTTP requests from reaching a Web Application or authenticate those with tokens before they reach the app. If an anonymous request is received from a browser, App Service will redirect to a logon page. To handle the logon process, a choice from a set of identity providers can be made, or a custom authentication mechanism can be implemented.

Default Value

By default, App Service Authentication is disabled when a new app is created using the command-line tool or Azure Portal console.

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Under Settings section, Click on Authentication 5. Ensure that App Service authentication set to Enabled (Will only appear once an Identity provider is set up/selected) 6. Navigate back to the application blade 7. Under Settings, click on Configuration 8. Click on the 'General Settings' tab 9. Under Platform settings, ensure Basic Auth Publishing Credentials is set to Off From Azure CLI To check App Service Authentication status for an existing app, run the following command (using authV1 extension), az webapp auth show --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> The output should return true if App Service authentication is set to On. If using the authV2 extension for the az webapp auth CLI, run the following command, az webapp auth show --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> Ensure that the enabled setting under azureActiveDirectory is set to true. To check whether the Basic Auth Publishing Credentials are disabled, issue the following commands, az resource show --resource-group <RESOURCE GROUP NAME> --name scm --namespace Microsoft.Web --resource-type basicPublishingCredentialsPolicies --parent sites/<APPLICATION NAME> az resource show --resource-group <RESOURCE GROUP NAME> --name ftp --namespace Microsoft.Web --resource-type basicPublishingCredentialsPolicies --parent sites/<APPLICATION NAME> Ensure allow is set to false under properties within the output of each of the above commands. 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: c75248c1-ea1d-4a9c-8fc9-29a6aabd5da8 - Name: 'Function apps should have authentication enabled' - Policy ID: 95bccee9-a7f8-4bec-9ee9-62c3473701fc - Name: 'App Service apps should have authentication enabled'

Impact Statement

This is only required for App Services which require authentication. Enabling on site like a marketing or support website will prevent unauthenticated access which would be undesirable. Adding Authentication requirement will increase cost of App Service and require additional security components to facilitate the authentication.

Assessment Status

Automated

Rationale Statement

By Enabling App Service Authentication, every incoming HTTP request passes through it before being handled by the application code. It also handles authentication of users with the specified provider (Entra ID, Facebook, Google, Microsoft Account, and Twitter), validation, storing and refreshing of tokens, managing the authenticated sessions and injecting identity information into request headers. Disabling HTTP Basic Authentication functionality further ensures legacy authentication methods are disabled within the application.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Under Setting section, click on Authentication 5. If no identity providers are set up, then click Add identity provider 6. Choose other parameters as per your requirements and click on Add To disable the Basic Auth Publishing Credentials setting, perform the following steps: 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Under Settings, click on Configuration 5. Click on the 'General Settings' tab 6. Under Platform settings, ensure Basic Auth Publishing Credentials is set to Off From Azure CLI To set App Service Authentication for an existing app, run the following command: az webapp auth update --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --enabled true Note In order to access App Service authentication settings for Web app using Microsoft API requires Website contributor permission at subscription level. A custom role can be created in place of Website contributor to provide more specific permission and maintain the principle of least privileged access.

Additional Information

You're not required to use App Service for authentication and authorization. Many web frameworks are bundled with security features, and you can use them if you like. If you need more flexibility than App Service provides, you can also write your own utilities. Secure authentication and authorization require deep understanding of security, including federation, encryption, JSON web tokens (JWT) management, grant types, and so on.

9.2Ensure Web App Redirects All HTTP traffic to HTTPS in Azure App Service1
Attributes
Profile

Level 1

Section

9 AppService

Description

Azure Web Apps allows sites to run under both HTTP and HTTPS by default. Web apps can be accessed by anyone using non-secure HTTP links by default. Non-secure HTTP requests can be restricted and all HTTP requests redirected to the secure HTTPS port. It is recommended to enforce HTTPS-only traffic.

Default Value

By default, HTTPS-only feature will be disabled when a new app is created using the command-line tool or Azure Portal console.

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Click on configuration 5. Ensure that the HTTPS Only setting is toggled to On From Azure CLI To check HTTPS-only traffic value for an existing app, run the following command, az webapp show --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --query httpsOnly The output should return true if HTTPS-only traffic value is set to On. From PowerShell List all the web apps configured within the subscription. Get-AzWebApp | Select-Object ResourceGroup, Name, HttpsOnly For each web app review the HttpsOnly setting and make sure it is set to True. 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: a4af4a39-4135-47fb-b175-47fbdf85311d - Name: 'App Service apps should only be accessible over HTTPS'

Impact Statement

When it is enabled, every incoming HTTP request is redirected to the HTTPS port. This means an extra level of security will be added to the HTTP requests made to the app.

Assessment Status

Automated

Rationale Statement

Enabling HTTPS-only traffic will redirect all non-secure HTTP requests to HTTPS ports. HTTPS uses the TLS/SSL protocol to provide a secure connection which is both encrypted and authenticated. It is therefore important to support HTTPS for the security benefits.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Click on configuration 5. Under the HTTPS Only heading select 'On' to enable https only 5. Click Save at the top From Azure CLI To set HTTPS-only traffic value for an existing app, run the following command: az webapp update --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --set httpsOnly=true From PowerShell Set-AzWebApp -ResourceGroupName <RESOURCE_GROUP_NAME> -Name <APP_NAME> -HttpsOnly $true

9.3Ensure Web App is using the latest version of TLS encryption1
Attributes
Profile

Level 1

Section

9 AppService

Description

The TLS (Transport Layer Security) protocol secures transmission of data over the internet using standard encryption technology. Encryption should be set with the latest version of TLS. App service allows TLS 1.2 by default, which is the recommended TLS level by industry standards such as PCI DSS.

Default Value

By default, TLS Version feature will be set to 1.2 when a new app is created using the command-line tool or Azure Portal console.

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Under Setting section, Click on TLS/SSL settings 5. Under the Bindings pane, ensure that Minimum TLS Version set to 1.2 under Protocol Settings From Azure CLI To check TLS Version for an existing app, run the following command, az webapp config show --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --query minTlsVersion The output should return 1.2 if TLS Version is set to 1.2 (Which is currently the latest version). From PowerShell List all web apps. Get-AzWebApp For each web app run the following command. Get-AzWebApp -ResourceGroupName <RESOURCE_GROUP_NAME> -Name <APP_NAME> |Select-Object -ExpandProperty SiteConfig Make sure the minTlsVersion is set to at least 1.2. 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: f9d614c5-c173-4d56-95a7-b4437057d193 - Name: 'Function apps should use the latest TLS version' - Policy ID: f0e6e85b-9b9f-4a4b-b67b-f730d42f1b0b - Name: 'App Service apps should use the latest TLS version'

Assessment Status

Automated

Rationale Statement

App service currently allows the web app to set TLS versions 1.0, 1.1 and 1.2. It is highly recommended to use the latest TLS 1.2 version for web app secure connections.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Under Setting section, Click on SSL settings 5. Under the Bindings pane, set Minimum TLS Version to 1.2 under Protocol Settings section From Azure CLI To set TLS Version for an existing app, run the following command: az webapp config set --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --min-tls-version 1.2 From PowerShell Set-AzWebApp -ResourceGroupName <RESOURCE_GROUP_NAME> -Name <APP_NAME> -MinTlsVersion 1.2

9.4Ensure that Register with Entra ID is enabled on App Service1
Attributes
Profile

Level 1

Section

9 AppService

Description

Managed service identity in App Service provides more security by eliminating secrets from the app, such as credentials in the connection strings. When registering an App Service with Entra ID, the app will connect to other Azure services securely without the need for usernames and passwords.

Default Value

By default, Managed service identity via Entra ID is disabled.

Audit Procedure

From Azure Portal 1. From Azure Portal open the Portal Menu in the top left 2. Go to App Services 3. Click on each App 4. Under the Setting section, Click on Identity 5. Under the System assigned pane, ensure that Status set to On From Azure CLI To check Register with Entra ID feature status for an existing app, run the following command, az webapp identity show --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --query principalId The output should return unique Principal ID. If no output for the above command then Register with Entra ID is not set. From PowerShell List the web apps. Get-AzWebApp For each web app run the following command. Get-AzWebapp -ResourceGroupName <app resource group> -Name <app name> Make sure the Identity setting contains a unique Principal ID 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: 0da106f2-4ca3-48e8-bc85-c638fe6aea8f - Name: 'Function apps should use managed identity' - Policy ID: 2b9ad585-36bc-4615-b300-fd4435808332 - Name: 'App Service apps should use managed identity'

Assessment Status

Automated

Rationale Statement

App Service provides a highly scalable, self-patching web hosting service in Azure. It also provides a managed identity for apps, which is a turn-key solution for securing access to Azure SQL Database and other Azure services.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Under Setting section, Click on Identity 5. Under the System assigned pane, set Status to On From Azure CLI To register with Entra ID for an existing app, run the following command: az webapp identity assign --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> From PowerShell To register with Entra ID for an existing app, run the following command: Set-AzWebApp -AssignIdentity $True -ResourceGroupName <resource_Group_Name> -Name <App_Name>

9.5Ensure That 'PHP version' is the Latest, If Used to Run the Web App1
Attributes
Profile

Level 1

Section

9 AppService

Description

Periodically newer versions are released for PHP software either due to security flaws or to include additional functionality. Using the latest PHP version for web apps is recommended in order to take advantage of security fixes, if any, and/or additional functionalities of the newer version.

Default Value

The version of PHP is whatever was selected upon App creation.

Audit Procedure

From Azure Portal 1. From Azure Home open the Portal Menu in the top left 2. Go to App Services 3. Click on each App 4. Under Settings section, click on Configuration 5. Click on the General settings pane, ensure that for a Stack of PHP the Major Version and Minor Version reflect the latest stable and supported release. ** The latest stable version can be confirmed by going to php.net. Navigate to the downloads, and then find the most recent version that is marked by Current Stable PHP [version_number]. ** NOTE: No action is required If PHP version is set to Off as PHP is not used by your web app. From Azure CLI To check PHP version for an existing app, run the following command, az webapp config show --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --query {LinuxFxVersion:linuxFxVersion,PHP_Version:phpVersion} From PowerShell $application = Get-AzWebApp -ResourceGroupName <resource group name> -Name <app name> $application.SiteConfig | select-object LinuxFXVersion, phpVersion The output should return the latest available version of PHP. Any other version of PHP would be considered a finding. NOTE: No action is required, If the output is empty as PHP is not used by your web app. 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: f466b2a6-823d-470d-8ea5-b031e72d79ae - Name: 'App Service app slots that use PHP should use a specified 'PHP version'' - Policy ID: 7261b898-8a84-4db8-9e04-18527132abb3 - Name: 'App Service apps that use PHP should use a specified 'PHP version''

Impact Statement

If your app is written using version-dependent features or libraries, they may not be available on the latest version. If you wish to upgrade, research the impact thoroughly. Upgrading may have unforeseen consequences that could result in downtime.

Assessment Status

Manual

Rationale Statement

Newer versions may contain security enhancements and additional functionality. Using the latest software version is recommended in order to take advantage of enhancements and new capabilities. With each software installation, organizations need to determine if a given update meets their requirements. They must also verify the compatibility and support provided for any additional software against the update revision that is selected.

Remediation Procedure

From Azure Portal 1. From Azure Home open the Portal Menu in the top left 2. Go to App Services 3. Click on each App 4. Under Settings section, click on Configuration 5. Click on the General settings pane, ensure that for a Stack of PHP the Major Version and Minor Version reflect the latest stable and supported release. NOTE: No action is required If PHP version is set to Off or is set with an empty value as PHP is not used by your web app. From Azure CLI List the available PHP runtimes: az webapp list-runtimes To set latest PHP version for an existing app, run the following command: az webapp config set --resource-group <resource group name> --name <app name> [--linux-fx-version <php runtime version>][--php-version <php version>] From PowerShell To set latest PHP version for an existing app, run the following command: Set-AzWebApp -ResourceGroupName <resource group name> -Name <app name> -phpVersion <php version> NOTE: Currently there is no way to update an existing web app Linux FX Version setting using PowerShell, nor is there a way to create a new web app using PowerShell that configures the PHP runtime in the Linux FX Version setting.

9.6Ensure that 'Python version' is the Latest Stable Version, if Used to Run the Web App1
Attributes
Profile

Level 1

Section

9 AppService

Description

Periodically, newer versions are released for Python software either due to security flaws or to include additional functionality. Using the latest full Python version for web apps is recommended in order to take advantage of security fixes, if any, and/or additional functionalities of the newer version.

Default Value

The version of Python is whatever was selected upon App creation.

Audit Procedure

From Azure Console 1. From Azure Home open the Portal Menu in the top left 2. Go to App Services 3. Click on each App 4. Under Settings section, click on Configuration 5. Click on the General settings pane and ensure that for a Stack of Python, with Major Version of Python 3, that the Minor Version is set to the latest stable version available (Python 3.11, at the time of writing) NOTE: No action is required if Python version is set to Off, as Python is not used by your web app. From Azure CLI To check Python version for an existing app, run the following command az webapp config show --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --query {LinuxFxVersion:linuxFxVersion,WindowsFxVersion:windowsFxVersion,PythonVersion:pythonVersion} The output should return the latest stable version of Python. NOTE: No action is required if the output is empty, as Python is not used by your web app. From PowerShell $app = Get-AzWebApp -Name <app name> -ResourceGroup <resource group name> $app.SiteConfig |Select-Object LinuxFXVersion, WindowsFxVersion, PythonVersion Ensure the output of the above command shows the latest version of Python. NOTE: No action is required if the output is empty, as Python is not used by your web app. 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: 9c014953-ef68-4a98-82af-fd0f6b2306c8 - Name: 'App Service app slots that use Python should use a specified 'Python version'' - Policy ID: 7008174a-fd10-4ef0-817e-fc820a951d73 - Name: 'App Service apps that use Python should use a specified 'Python version''

Impact Statement

If your app is written using version-dependent features or libraries, they may not be available on the latest version. If you wish to upgrade, research the impact thoroughly. Upgrading may have unforeseen consequences that could result in downtime.

Assessment Status

Manual

Rationale Statement

Newer versions may contain security enhancements and additional functionality. Using the latest software version is recommended in order to take advantage of enhancements and new capabilities. With each software installation, organizations need to determine if a given update meets their requirements. They must also verify the compatibility and support provided for any additional software against the update revision that is selected. Using the latest full version will keep your stack secure to vulnerabilities and exploits.

Remediation Procedure

From Azure Portal 1. From Azure Home open the Portal Menu in the top left 2. Go to App Services 3. Click on each App 4. Under Settings section, click on Configuration 5. Click on the General settings pane and ensure that the Major Version and the Minor Version is set to the latest stable version available (Python 3.11, at the time of writing) NOTE: No action is required if Python version is set to Off, as Python is not used by your web app. From Azure CLI To see the list of supported runtimes: az webapp list-runtimes To set latest Python version for an existing app, run the following command: az webapp config set --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> [--windows-fx-version PYTHON|3.11] [--linux-fx-version PYTHON|3.11] From PowerShell As of this writing, there is no way to update an existing application's SiteConfig or set the a new application's SiteConfig settings during creation via PowerShell.

Additional Information

** The latest stable version can be confirmed by going to python.org. Navigate to the downloads, and then find the most recent version that is marked by security in the maintenance column. **

9.7Ensure that 'Java version' is the latest, if used to run the Web App1
Attributes
Profile

Level 1

Section

9 AppService

Description

Periodically, newer versions are released for Java software either due to security flaws or to include additional functionality. Using the latest Java version for web apps is recommended in order to take advantage of security fixes, if any, and/or new functionalities of the newer version.

Default Value

The default setting is whichever setting was chosen in the creation of the webapp.

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Under Settings section, click on Configuration 5. Click on the General settings pane and ensure that for a Stack of Java the Major Version and Minor Version reflect the latest stable and supported release, and that the Java web server version is set to the auto-update option. NOTE: No action is required if Java version is set to Off, as Java is not used by your web app. From Azure CLI To check Java version for an existing app, run the following command, az webapp config show --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --query {LinuxFxVersion:linuxFxVersion, WindowsFxVersion:windowsFxVersion, JavaVersion:javaVersion, JavaContainerVersion:javaContainerVersion, JavaContainer:javaContainer} The output should return the latest available version of Java (if java is being used for the web application being audited). From PowerShell For each application, store the application information within an object, and then interrogate the SiteConfig information for that application object. $app = Get-AzWebApp -Name <app name> -ResourceGroup <resource group name> $app.SiteConfig |Select-Object LinuxFXVersion, WindowsFxVersion, JavaVersion, JavaContainerVersion, JavaContainer Ensure the Java version used within the application is a currently supported version (if java is being used for the web application being audited). 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: e1d1b522-02b0-4d18-a04f-5ab62d20445f - Name: 'Function app slots that use Java should use a specified 'Java version'' - Policy ID: 9d0b6ea4-93e2-4578-bf2f-6bb17d22b4bc - Name: 'Function apps that use Java should use a specified 'Java version''

Impact Statement

If your app is written using version-dependent features or libraries, they may not be available on the latest version. If you wish to upgrade, research the impact thoroughly. Upgrading may have unforeseen consequences that could result in downtime.

Assessment Status

Manual

Rationale Statement

Newer versions may contain security enhancements and additional functionality. Using the latest software version is recommended in order to take advantage of enhancements and new capabilities. With each software installation, organizations need to determine if a given update meets their requirements. They must also verify the compatibility and support provided for any additional software against the update revision that is selected.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Under Settings section, click on Configuration 5. Click on the General settings pane and ensure that for a Stack of Java the Major Version and Minor Version reflect the latest stable and supported release, and that the Java web server version is set to the auto-update option. NOTE: No action is required if Java version is set to Off, as Java is not used by your web app. From Azure CLI To see the list of supported runtimes: az webapp list-runtimes To set latest Java version for an existing app, run the following command: az webapp config set --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> [--java-version <JAVA_VERSION> --java-container <JAVA_CONTAINER> --java-container-version <JAVA_CONTAINER_VERSION> [--windows-fx-version <java runtime version>] [--linux-fx-version <java runtime version version>] If creating a new web application to use a currently supported version of Java, run the following commands. To create an app service plan: az appservice plan create --resource-group <resource group name> --name <plan name> --location <location> [--is-linux --number-of-workers <int> --sku <pricing tier>] [--hyper-v --sku <pricing tier>] Get the app service plan ID: az appservice plan list --query [].{Name:name, ID:id, SKU:sku, Location:location} To create a new Java web application using the retrieved app service ID: az webapp create --resource-group <resource group name> --plan <app service plan ID> --name <app name> [--linux-fx-version <java run time version>] [--windows-fx-version <java run time version>] From PowerShell As of this writing, there is no way to update an existing application's SiteConfig or set a new application's SiteConfig settings during creation via PowerShell.

9.8Ensure that 'HTTP Version' is the Latest, if Used to Run the Web App1
Attributes
Profile

Level 1

Section

9 AppService

Description

Periodically, newer versions are released for HTTP either due to security flaws or to include additional functionality. Using the latest HTTP version for web apps to take advantage of security fixes, if any, and/or new functionalities of the newer version.

Audit Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Under Setting section, Click on Configuration 5. Ensure that HTTP Version set to 2.0 version under General settings NOTE: Most modern browsers support HTTP 2.0 protocol over TLS only, while non-encrypted traffic continues to use HTTP 1.1. To ensure that client browsers connect to your app with HTTP/2, either buy an App Service Certificate for your app's custom domain or bind a third party certificate. From Azure CLI To check HTTP 2.0 version status for an existing app, run the following command, az webapp config show --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --query http20Enabled The output should return true if HTTPS 2.0 traffic value is set to On. From PowerShell For each application, run the following command: Get-AzWebApp -ResourceGroupName <app resource group> -Name <app name> |Select-Object -ExpandProperty SiteConfig If the value of the Http20Enabled setting is true, the application is compliant. Otherwise if the value of the Http20Enabled setting is false, the application is non-compliant. 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: e2c1c086-2d84-4019-bff3-c44ccd95113c - Name: 'Function apps should use latest 'HTTP Version'' - Policy ID: 8c122334-9d20-4eb8-89ea-ac9a705b74ae - Name: 'App Service apps should use latest 'HTTP Version''

Assessment Status

Automated

Rationale Statement

Newer versions may contain security enhancements and additional functionality. Using the latest version is recommended in order to take advantage of enhancements and new capabilities. With each software installation, organizations need to determine if a given update meets their requirements. They must also verify the compatibility and support provided for any additional software against the update revision that is selected. HTTP 2.0 has additional performance improvements on the head-of-line blocking problem of old HTTP version, header compression, and prioritization of requests. HTTP 2.0 no longer supports HTTP 1.1's chunked transfer encoding mechanism, as it provides its own, more efficient, mechanisms for data streaming.

Remediation Procedure

From Azure Portal 1. Login to Azure Portal using https://portal.azure.com 2. Go to App Services 3. Click on each App 4. Under Setting section, Click on Configuration 5. Set HTTP version to 2.0 under General settings NOTE: Most modern browsers support HTTP 2.0 protocol over TLS only, while non-encrypted traffic continues to use HTTP 1.1. To ensure that client browsers connect to your app with HTTP/2, either buy an App Service Certificate for your app's custom domain or bind a third party certificate. From Azure CLI To set HTTP 2.0 version for an existing app, run the following command: az webapp config set --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --http20-enabled true From PowerShell To enable HTTP 2.0 version support, run the following command: Set-AzWebApp -ResourceGroupName <app resource group> -Name <app name> -Http20Enabled $true

9.9Ensure FTP deployments are Disabled1
Attributes
Profile

Level 1

Section

9 AppService

References

Azure Web Service Deploy via FTP:Azure Web Service Deployment:https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-data-protection#dp-3-encrypt-sensitive-data-in-transit:https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-posture-vulnerability-management#pv-6-rapidly-and-automatically-remediate-vulnerabilities

Description

By default, Azure Functions, Web, and API Services can be deployed over FTP. If FTP is required for an essential deployment workflow, FTPS should be required for FTP login for all App Service Apps and Functions.

Default Value

By default, FTP based deployment is All allowed

Audit Procedure

From Azure Portal 1. Go to the Azure Portal 2. Select App Services 3. Click on an app 4. Select Settings and then Configuration 5. Under General Settings, for the Platform Settings, the FTP state should not be set to All allowed From Azure CLI List webapps to obtain the ids. az webapp list List the publish profiles to obtain the username, password and ftp server url. az webapp deployment list-publishing-profiles --ids <ids> { publishUrl: <URL_FOR_WEB_APP>, userName: <USER_NAME>, userPWD: <USER_PASSWORD>, } From PowerShell List all Web Apps: Get-AzWebApp For each app: Get-AzWebApp -ResourceGroupName <resource group name> -Name <app name> | Select-Object -ExpandProperty SiteConfig In the output, look for the value of FtpsState. If its value is AllAllowed the setting is out of compliance. Any other value is considered in compliance with this check. 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: 399b2637-a50f-4f95-96f8-3a145476eb15 - Name: 'Function apps should require FTPS only' - Policy ID: 4d24b6d4-5e53-4a4f-a7f4-618fa573ee4b - Name: 'App Service apps should require FTPS only'

Impact Statement

Any deployment workflows that rely on FTP or FTPs rather than the WebDeploy or HTTPs endpoints may be affected.

Assessment Status

Automated

Rationale Statement

Azure FTP deployment endpoints are public. An attacker listening to traffic on a wifi network used by a remote employee or a corporate network could see login traffic in clear-text which would then grant them full control of the code base of the app or service. This finding is more severe if User Credentials for deployment are set at the subscription level rather than using the default Application Credentials which are unique per App.

Remediation Procedure

From Azure Portal 1. Go to the Azure Portal 2. Select App Services 3. Click on an app 4. Select Settings and then Configuration 5. Under General Settings, for the Platform Settings, the FTP state should be set to Disabled or FTPS Only From Azure CLI For each out of compliance application, run the following choosing either 'disabled' or 'FtpsOnly' as appropriate: az webapp config set --resource-group <resource group name> --name <app name> --ftps-state [disabled|FtpsOnly] From PowerShell For each out of compliance application, run the following: Set-AzWebApp -ResourceGroupName <resource group name> -Name <app name> -FtpsState <Disabled or FtpsOnly>

9.10Ensure Azure Key Vaults are Used to Store Secrets0
Attributes
Profile

Level 2

Section

9 AppService

Description

Azure Key Vault will store multiple types of sensitive information such as encryption keys, certificate thumbprints, and Managed Identity Credentials. Access to these 'Secrets' can be controlled through granular permissions.

Default Value

By default, no Azure Key Vaults are created.

Audit Procedure

From Azure Portal 1. Login to Azure Portal 2. In the expandable menu on the left go to Key Vaults 3. View the Key Vaults listed. From Azure CLI To list key vaults within a subscription run the following command: Get-AzKeyVault To list the secrets within these key vaults run the following command: Get-AzKeyVaultSecret [-VaultName] <vault name> From Powershell To list key vaults within a subscription run the following command: Get-AzKeyVault To list all secrets in a key vault run the following command: Get-AzKeyVaultSecret -VaultName '<vaultName'

Impact Statement

Integrating references to secrets within the key vault are required to be specifically integrated within the application code. This will require additional configuration to be made during the writing of an application, or refactoring of an already written one. There are also additional costs that are charged per 10000 requests to the Key Vault.

Assessment Status

Manual

Rationale Statement

The credentials given to an application have permissions to create, delete, or modify data stored within the systems they access. If these credentials are stored within the application itself, anyone with access to the application or a copy of the code has access to them. Storing within Azure Key Vault as secrets increases security by controlling access. This also allows for updates of the credentials without redeploying the entire application.

Remediation Procedure

Remediation has 2 steps 1. Setup the Key Vault 2. Setup the App Service to use the Key Vault Step 1: Set up the Key Vault From Azure CLI az keyvault create --name <name> --resource-group <myResourceGroup> --location myLocation From Powershell New-AzKeyvault -name <name> -ResourceGroupName <myResourceGroup> -Location <myLocation> Step 2: Set up the App Service to use the Key Vault Sample JSON Template for App Service Configuration: { //... resources: [ { type: Microsoft.Storage/storageAccounts, name: [variables('storageAccountName')], //... }, { type: Microsoft.Insights/components, name: [variables('appInsightsName')], //... }, { type: Microsoft.Web/sites, name: [variables('functionAppName')], identity: { type: SystemAssigned }, //... resources: [ { type: config, name: appsettings, //... dependsOn: [ [resourceId('Microsoft.Web/sites', variables('functionAppName'))], [resourceId('Microsoft.KeyVault/vaults/', variables('keyVaultName'))], [resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('storageConnectionStringName'))], [resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('appInsightsKeyName'))] ], properties: { AzureWebJobsStorage: [concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageConnectionStringResourceId')).secretUriWithVersion, ')')], WEBSITE_CONTENTAZUREFILECONNECTIONSTRING: [concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageConnectionStringResourceId')).secretUriWithVersion, ')')], APPINSIGHTS_INSTRUMENTATIONKEY: [concat('@Microsoft.KeyVault(SecretUri=', reference(variables('appInsightsKeyResourceId')).secretUriWithVersion, ')')], WEBSITE_ENABLE_SYNC_UPDATE_SITE: true //... } }, { type: sourcecontrols, name: web, //... dependsOn: [ [resourceId('Microsoft.Web/sites', variables('functionAppName'))], [resourceId('Microsoft.Web/sites/config', variables('functionAppName'), 'appsettings')] ], } ] }, { type: Microsoft.KeyVault/vaults, name: [variables('keyVaultName')], //... dependsOn: [ [resourceId('Microsoft.Web/sites', variables('functionAppName'))] ], properties: { //... accessPolicies: [ { tenantId: [reference(concat('Microsoft.Web/sites/', variables('functionAppName'), '/providers/Microsoft.ManagedIdentity/Identities/default'), '2015-08-31-PREVIEW').tenantId], objectId: [reference(concat('Microsoft.Web/sites/', variables('functionAppName'), '/providers/Microsoft.ManagedIdentity/Identities/default'), '2015-08-31-PREVIEW').principalId], permissions: { secrets: [ get ] } } ] }, resources: [ { type: secrets, name: [variables('storageConnectionStringName')], //... dependsOn: [ [resourceId('Microsoft.KeyVault/vaults/', variables('keyVaultName'))], [resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))] ], properties: { value: [concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountResourceId'),'2015-05-01-preview').key1)] } }, { type: secrets, name: [variables('appInsightsKeyName')], //... dependsOn: [ [resourceId('Microsoft.KeyVault/vaults/', variables('keyVaultName'))], [resourceId('Microsoft.Insights/components', variables('appInsightsName'))] ], properties: { value: [reference(resourceId('microsoft.insights/components/', variables('appInsightsName')), '2015-05-01').InstrumentationKey] } } ] } ] }

10 Miscellaneous10
10.1Ensure that Resource Locks are set for Mission-Critical Azure Resources0
Attributes
Profile

Level 2

Section

10 Miscellaneous

Description

Resource Manager Locks provide a way for administrators to lock down Azure resources to prevent deletion of, or modifications to, a resource. These locks sit outside of the Role Based Access Controls (RBAC) hierarchy and, when applied, will place restrictions on the resource for all users. These locks are very useful when there is an important resource in a subscription that users should not be able to delete or change. Locks can help prevent accidental and malicious changes or deletion.

Default Value

By default, no locks are set.

Audit Procedure

From Azure Portal 1. Navigate to the specific Azure Resource or Resource Group 2. Click on Locks 3. Ensure the lock is defined with name and description, with type Read-only or Delete as appropriate. From Azure CLI Review the list of all locks set currently: az lock list --resource-group <resourcegroupname> --resource-name <resourcename> --namespace <Namespace> --resource-type <type> --parent From Powershell Run the following command to list all resources. Get-AzResource For each resource, run the following command to check for Resource Locks. Get-AzResourceLock -ResourceName <Resource Name> -ResourceType <Resource Type> -ResourceGroupName <Resource Group Name> Review the output of the Properties setting. Compliant settings will have the CanNotDelete or ReadOnly value.

Impact Statement

There can be unintended outcomes of locking a resource. Applying a lock to a parent service will cause it to be inherited by all resources within. Conversely, applying a lock to a resource may not apply to connected storage, leaving it unlocked. Please see the documentation for further information.

Assessment Status

Manual

Rationale Statement

As an administrator, it may be necessary to lock a subscription, resource group, or resource to prevent other users in the organization from accidentally deleting or modifying critical resources. The lock level can be set to to CanNotDelete or ReadOnly to achieve this purpose. - CanNotDelete means authorized users can still read and modify a resource, but they cannot delete the resource. - ReadOnly means authorized users can read a resource, but they cannot delete or update the resource. Applying this lock is similar to restricting all authorized users to the permissions granted by the Reader role.

Remediation Procedure

From Azure Portal 1. Navigate to the specific Azure Resource or Resource Group 2. For each mission critical resource, click on Locks 3. Click Add 4. Give the lock a name and a description, then select the type, Read-only or Delete as appropriate 5. Click OK From Azure CLI To lock a resource, provide the name of the resource, its resource type, and its resource group name. az lock create --name <LockName> --lock-type <CanNotDelete/Read-only> --resource-group <resourceGroupName> --resource-name <resourceName> --resource-type <resourceType> From Powershell Get-AzResourceLock -ResourceName <Resource Name> -ResourceType <Resource Type> -ResourceGroupName <Resource Group Name> -Locktype <CanNotDelete/Read-only>