CCN-STIC-884A-Secure Configuration Guide For Azure
CCN-STIC-884A-Secure Configuration Guide For Azure
CCN-STIC-884A-Secure Configuration Guide For Azure
CCN-STIC 884A
December 2019
CCN-STIC 884A Secure Configuration Guide for Azure
Edit:
LIMITATION OF RESPONSIBILITY
This document is provided in accordance with the terms compiled in it, expressly rejecting any type of
implicit guarantee that might be related to it. In no case can the National Cryptologic Centre be considered
liable for direct, indirect, accidental or extraordinary damage derived from using information and software
that are indicated even when warning is provided concerning this damage.
LEGAL NOTICE
Without written authorisation from the National Cryptologic Centre, it is strictly forbidden, incurring
penalties set by law, to partially or totally reproduce this document by any means or procedure, including
photocopying and computer processing, or distribute copies of it by means of rental or public lending
2
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
FOREWORD
3
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
TABLE OF CONTENTS
1. SECURE GUIDE FOR AZURE ..................................................................................... 6
1.1 DESCRIPTION OF THE USE OF THIS GUIDE ...............................................................6
1.2 SERVICE DEFINITION ................................................................................................6
1.3 FUNCTIONALITIES OF THE AZURE SERVICE ..............................................................6
2. SECURE DEPLOYMENT FOR AZURE ......................................................................... 7
2.1 USING THE POWERSHELL CONSOLE.........................................................................7
2.2 ACCESS TO THE AZURE PORTAL FROM A BROWSER................................................9
2.3 RESOURCE MANAGEMENT IN AZURE ....................................................................16
3. SECURE CONFIGURATION FOR AZURE .................................................................. 21
3.1 OPERATING FRAMEWORK .....................................................................................21
3.1.1 ACCESS CONTROL ..............................................................................................21
3.1.1.1 ACCESS REQUIREMENTS ...............................................................................28
3.1.1.2 SEGREGATION OF FUNCTIONS AND TASKS ..................................................52
3.1.1.3 ACCESS RIGHTS MANAGEMENT PROCESS ....................................................52
3.1.1.4 AUTHENTICATION MECHANISM ...................................................................55
3.1.1.5 LOCAL ACCESS (LOCAL LOGON) ....................................................................67
3.1.1.6 REMOTE ACCESS (REMOTE LOGIN) ..............................................................67
3.1.2 EXPLOITATION ...................................................................................................67
3.1.2.1 RECORDING USER ACTIVITY ..........................................................................67
3.1.2.2 PROTECTION OF ACTIVITY RECORDS ............................................................71
3.1.2.3 PROTECTION OF CRYPTOGRAPHIC KEYS.......................................................83
3.1.3 CONTINUITY OF SERVICE .................................................................................102
3.1.4 CONTINUITY PLAN ...........................................................................................102
3.1.5 PERIODIC TESTING ...........................................................................................114
3.1.6 SYSTEM MONITORING.....................................................................................118
3.1.6.1 INTRUSION DETECTION ..............................................................................118
3.1.6.2 METRIC SYSTEM ..........................................................................................127
3.2 PROTECTIVE MEASURES .......................................................................................149
3.2.1 PROTECTION OF COMMUNICATIONS .............................................................149
3.2.1.1 NETWORK SEGREGATION ...........................................................................149
3.2.1.2 SECURE PERIMETER ....................................................................................156
3.2.1.3 PROTECTION OF CONFIDENTIALITY. ...........................................................168
3.2.1.4 PROTECTION OF AUTHENTICITY AND INTEGRITY .......................................171
4
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
5
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
6
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
7
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
PS C:\> Connect-AzAccount
Password-based authentication
To obtain the service entity's credentials, use the Get-Credential cmdlet command. This
cmdlet shows a notice for a username and password. Use the service entity identifier as
your username.
From the Powershell console execute the following command:
$pscredential = Get-Credential
Connect-AzAccount -ServicePrincipal -Credential $pscredential -Tenant
$tenantId
In automation scenarios, credentials can be created from a username and a secure string
(Password), the syntax would be as follows:
$passwd = ConvertTo-SecureString <use a secure password here> -
AsPlainText -Force
$pscredential = New-Object
System.Management.Automation.PSCredential('service principal
name/id', $passwd)
Connect-AzAccount -ServicePrincipal -Credential $pscredential -
Tenant $tenantId
8
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
To add a new context after login, use Set-AzContext (or its alias, Select-AzSubscription).
PS C:\> Set-AzContext -Subscription "Subscription 1" -Name "Domain"
Regarding security, it is important to remove all the credentials and associated contexts
from a user or service entity using the Disconnect-AzAccount command (also known as
Logout-AzAccount).
Disconnect-AzAccount user1@su_dominio
9
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Portal Configuration
Once you have logged into Azure's portal, a home page is displayed with the icons of
all the applications you have access to.
10
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. If you want to set a logout for inactivity, display the bar and choose a custom
duration.
11
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: If you want to restore all the default settings click on Restore default settings.
Custom Panel
From the Azure’s portal you can customize and create multiple panels by creating a new
Dashboard or edit the existing one. To do this, it is recommended to follow these
guidelines:
1. To create a new one, click on [Panel/New Panel].
12
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: From here you can add all the services you want to view in the custom panel.
Share panel
Once you have created a new custom panel, you can publish and manage the accesses
to users that can be viewed and operated on it.
Follow these guidelines:
1. From the Panel, click on [share].
Note: This panel appears where you must define a name, your subscription and the location
which is Northern Europe.
13
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. Once published, a new assistant appears where the users who have access must
managed. To do this, click on Manage users.
14
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
5. Select the role to grant to the user. In this example the role of Collaborator is
assigned.
15
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Resource Group
A resource group is a container where resources that are managed as a group are stored.
16
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: The list of commands can be consulted from the following link:
https://docs.microsoft.com/en-us/cli/azure/resource?view=azure-cli-latest
17
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Click on [add].
3. In resource group click on Create new one. At this moment the name is assigned.
Note: A new resource group can be created or deploy and select an existing one for this new
storage account.
4. Next, the following fields are filled in:
18
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
19
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
20
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
9. Click on [create].
Azure Active Directory is the main tool for managing access and privileges to Azure's
resources within an organization.
While this guide only addresses Azure Active Directory cloud user account management,
it also allows hybrid configurations.
The hybrid identity documentation can be consulted in the link:
https://docs.microsoft.com/es-es/azure/active-directory/hybrid/index
21
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
To meet the requirements within the scope of the ENS, the following sections discuss
the initial configuration, user account management and administration of Azure Active
Directory.
Important: This guide does not discuss how to manage Windows Server Active Directory
users and objects. For this type of activities, it is recommended to consult the guide CCN-
STIC-870A Implementation of the ENS in Windows Server 2012 R2.
Identification
The identity provider is responsible for checking the identity of users and applications
that exist in an organization's directory and for issuing security tokens after the correct
authentication of those users and applications.
Any application that needs to outsource authentication to the Microsoft identity
platform must be registered in Azure Active Directory (Azure AD). Azure AD records the
application and uniquely identifies it in the directory.
To do this, accounts must be created in Azure Active Directory.
Also note that this guide only describes the management of Azure Active directory
accounts in its Tenant but not in Hybrid environments.
Reference is made to these Microsoft links:
https://docs.microsoft.com/es-es/azure/active-directory/hybrid/whatis-hybrid-
identity
https://docs.microsoft.com/es-es/azure/active-directory/devices/hybrid-
azuread-join-managed-domains
The following describes how user account and user group management is performed.
Azure Active Directory - Add, delete and modify accounts and user groups
To manage users/groups click on [Azure Active Directory] in the left menu, you can also
use the search engine at the top:
22
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: Optionally you can create a guest user belonging to another organization. The
same is notified by mail.
If you want to create the guest account, it is recommended to follow the guidelines
below.
1. From the Users panel click on New Guest User.
23
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
24
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. Press [delete].
25
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. From this panel you can modify the account properties and add additional
information.
26
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
27
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Group Deletion
Group creation.
PS C:\>New-AzureADGroup -DisplayName "Administrador_SQL" -MailEnabled
$false -SecurityEnabled $true -MailNickName "NotSet"
Note: More information about PowerShell commands can be found in the link:
https://docs.microsoft.com/es-es/azure/active-directory/users-groups-roles/groups-settings-
v2-cmdlets
28
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
29
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
The "No" option allows a non-administrator user to use this experience with Azure AD's
administration portal to access Azure AD resources for which they have read permission,
or to manage their own resources.
The "Yes" option limits access to Azure AD data in the administration portal to all non-
administrator users, but it doesn't limit access if you use PowerShell or another client,
such as Visual Studio.
Conditional access
30
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
31
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: In this section you can define geographic locations and configure the trust IPs.
3. Click on [New Location].
4. You must define a name and a geographic location, in this case select SPAIN.
The Include unknown areas box defines IP addresses that cannot be assigned to any
country or region.
32
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Define a name
Click on IP ranges
Click on the Mark as Trusted Location box
Define the public IPs you trust.
At the end of the name location panel, the two locations created are displayed.
In order to make these locations online, a policy is created defining to whom this
condition applies.
To do so, follow the guidelines below.
1. From the Azure portal click on [Azure Active Directory/Conditional Access].
33
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. Define the name of the policy and click on [Users and Groups].
34
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
35
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
9. Select 'MFA check'. The Azure Multi-Factor Authentication service can be found
in the section [3.1.1.5 Authentication Mechanisms] of this guide.
36
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: To enable this condition, you must have Azure AD Identity Protection.
You can consult the documentation in the link: https://docs.microsoft.com/es-es/azure/active-
directory/identity-protection/howto-sign-in-risk-policy#what-is-the-sign-in-risk-policy
Device platforms
The device platform is the operating system that executes on the device. Azure AD
identifies the platform using the information provided by the device, such as the user
agent. It is recommended that all platforms have a policy applied to them.
37
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
All the applications in the cloud by applying baseline guidelines that apply to the
entire Tenant. These policies require multi-factor authentication. A policy that
applies to all the cloud applications applies to the access to all the websites and
services.
Select applications to target specific services by its policy. For example, to
require users to have a compatible device to access SharePoint Online. This
policy also applies to other services when accessing SharePoint content. An
example is Microsoft Teams.
38
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
RBAC operation
The way in which the access to resources is controlled by RBAC is through role
assignments. This is a key concept: It is about how permits are applied and their scope.
A role assignment consists of three elements: security entity, role definition and scope.
The principle of minimum privilege should be applied in order to allow users to perform
only those operations that are necessary within the scope of their duties.
Azure allows the use of several integrated roles. Four key roles are listed below. The first
three apply to all types of resources.
Owner: Has full access to all resources, including the right to delegate this access
to others.
Collaborator: Has permissions to create and manage all the types of Azure
resources, but you cannot grant access to others.
Reader: Has permission to view Azure's existing resources.
User Access Manager: Has permissions to manage user access to Azure's
resources.
In addition, there are also others roles focused on service already created in Azure, such
as "SQL Database Collaborator", "SQL Security Administrator", etc.
Note: All these roles can be found in the official Microsoft documentation:
https://docs.microsoft.com/es-es/azure/role-based-access-control/built-in-roles
39
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
{
"Name": "Role Operator",
"Go": null,
"IsCustom": true,
"Description": "You can create, change and delete roles",
"Actions": [
"Microsoft.Authorization/*/read."
"Microsoft.Authorization/roleDefinitions/write",
"Microsoft.Authorization/roleDefinitions/delete"
],
"NotActions." [],
"AssignableScopes": [
"/subscriptions/965c7398-06c7-4edf-87ee-35744843942b"
]
}
Prerequisites
It is necessary that the administrator user that connects to Azure's portal has the
appropriate permissions for the management of RBAC roles. To do this, perform the
following checks:
1. From the Azure portal search subscriptions.
2. Click on [Subscriptions].
40
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
4. Click on [roles].
41
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: The route of the parameter file -InputFile can be either an absolute route or a relative
route.
4. In the case of a user, this command is used, with the desired user.
$user = Get-AzADUser -DisplayName "ccn-user"
5. In the case of a service user, use this command, with the desired service
username.
$userservice = Get-AzADServicePrincipal -DisplayName
"OperationsServicePrincipal
6. You can also find out which Azure subscription the role will be applied to. To do
this, the following command is used:
42
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
A new window opens where you select the subscription to which you want to
apply the role.
7. Next, you must create the variable $scope with the format that the display
needs. To do this, concatenate the string /subscriptions/ and the subscription ID.
$scope="/subscriptions/"+$sub. id
8. Finally, you must assign the role to the entity, which in this case is the group
called "Administrator Roles"
In the case of a group, the following command is used
New-AzRoleAssignment -ObjectId $group. ObjectId -RoleDefinitionName "
Role Operator" -Scope $scope
Delete a role.
43
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
44
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
6. Select High.
45
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
46
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Click on [Users].
47
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
48
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
The MFA Registry policies are now configured. To do this, perform the following steps:
1. Click on [MFA Registration Policy].
2. Click on [Users].
49
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
50
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
From the dashboard you can view real-time risk reports on logins or risk detections.
At the end of the panel you can configure alerts that will arrive via email or a weekly
summary with the detections found.
In addition, please refer to section [3.1.1.5 Authentication mechanisms/Conditional
access policies] of this guide.
Recommendations
Next, some recommended services that can be configured.
51
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
52
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
You can specify a range at various levels: management group, subscription, resource
group or resource.
The roles that are recommended from a security point of view are described below.
Owner: Full access to all resources, including the right to delegate this
access to others
Collaborator: Has permissions to create and manage all types of Azure
resources but cannot grant access to others.
Reader: Has permission to view Azure's existing resources.
User Access Manager: Has permissions to manage user access to Azure's
resources.
To do so, follow these instructions:
1. Click on [Subscriptions] or use the search engine on the Azure’s portal.
3. Click on [roles].
4. Here you can see the users who have the mentioned roles.
53
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
7. Select a a role.
8. Select User/Group.
9. Choose the user who grants the role.
54
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Implementation Considerations
Azure Multi-Factor Authentication can be implemented without the need to apply
conditional access policies. In this guide, it is recommended that when MFA is
implemented, a conditional access policy should be used so that users can perform
multi-factor authentication and meet certain criteria, for example
All users, a specific user, the member of a group or an assigned role.
A specific cloud application is accessed.
Device platform.
Device status.
Network location or geographic location of IP address.
Client applications.
Login risk (requires Identity Protection).
Compatible devices.
Client application approved.
A specific cloud application is accessed
Device platform
Device status
Network location or geographic location of IP address
Client applications
Authentication methods
Azure MFA allows to configure several authentication methods. To do this, you must
configure a policy that defines the method by which users will be registered.
The methods recommended from a security point of view are described below.
Notification via mobile application
A mobile application such as Microsoft Authenticator generates a new OATH verification
code every 30 seconds. The user writes the verification code in the login interface.
Phone call
55
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
An automatic voice call is made to the user. The user answers the call and presses # on
the phone keyboard to approve their authentication.
Text message to the phone
A text message containing a verification code is sent to the user, then the user is asked
for the verification code in the login interface.
56
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
57
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
58
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
A CSV file is downloaded where the user's email and status are filled in.
When you complete the csv with the users, click on Massive Update and then on Search
File.
2. This example of a PowerShell script enables MFA for an individual user. The state
property of the variable $st is modified. Depending on whether you enable or
disable the value is: "Enable" or "Disabled”
59
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Import-Module MSOnline
$st = New-Object -TypeName
Microsoft.Online.Administration.StrongAuthenticationRequirement
$st.RelyingParty = "*"
$st.State = "Enabled"
$sta = @($st)
Set-MsolUser -PrimaryUserName1@domain -
StrongAuthenticationRequirements $this
Note: Using PowerShell is a good option when you need to massively enable users. For example,
the following script loops through a list of users and enables MFA on their accounts:
$users = "user1@domain", "user2@domain", "user3@domain"
foreach ($user in $users)
{
$st = New-Object -TypeName
Microsoft.Online.Administration.StrongAuthenticationRequirement
$st.RelyingParty = "*"
$st.State = "Enabled"
$sta = @($st)
Set-MsolUser -PrincipalUser $user -StrongAuthenticationRequirements
$sta
}
To disable MFA, use this script:
Get-MsolUser -PrincipalUserNameUser@domain | Set-MsolUser -
StrongAuthenticationMethods @()
60
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Registered and unregistered Azure MFA users can be identified with PowerShell
commands that are based on the PowerShell MSOnline module.
61
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: It is recommended to use multifactor authentication when adding devices to Azure AD.
When it is set to "Yes", users who add devices from the Internet must use a second authentication
method.
62
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: Remember that this setting applies to all devices. From the same panel you can select the
users and groups that can join devices to Azure AD in case you want to limit it.
63
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Authentication mechanisms
Another measure recommended in this guide is the protection through Azure Active
Directory's password settings, both at the attempt threshold and in locks and audit.
To do so, it is recommended to follow these guidelines.
1. From the Azure portal, search for Authentication Methods.
You must customize the account blocking in multiple attempts by following these
instructions.
64
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
65
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Once created you can view the new service account from the [Azure Active
Directory/Registration Applications] menu.
To delete a business application (service account) from the previous window, click on
the one you want to delete. Finally, click on the delete button.
66
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3.1.2 Exploitation
67
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Audit Logs: The audit log activity report provides access to the history of all tasks
performed at the Tenant.
Logon records: The Logon activity report determines who has performed the
tasks included in the audit log report.
Note: Remember that only administrators with permissions can access the log.
In order to consult the log, follow these instructions:
Click on:
1. [Azure Active Directory].
2. [Audit Logs].
4. [Adding a diagnosis].
68
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
69
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
In addition, you can export the results in CSV or JSON format from:
You can also view user logins. To do this, from the [Azure/Active Directory/Login] portal.
70
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
You can customize your search by clicking on columns. Where you can define the filters
you want.
71
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
The Log Analytics work area offers multiple advantages, in addition to being able to
perform searches and log queries, which can be associated with an Azure panel. This
panel offers a general overview of the state of the Tenant's most vital resources, as well
as the metrics you have previously configured.
The Azure panel can be shared among several users. It is configured from your work area
(through the implementation of solutions in the Working Area Summary and the View
Designer).
It would be important to highlight the possibility of establishing both a data retention
period and a maximum daily consumption. This allows to control the use of the
application and the expenditure.
Choose a name for the working area and click on create new resource group.
72
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: Remember that you can find Log Analytics from All Resources.
73
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
74
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. On the advanced options tab, enable security and a data retention of at least 365 days
is recommended.
3. On the Labels tab identify a dedicated name and value for all the components of the
storage account.
75
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
5. Once the storage account has been created, you must perform an export to the event
center.
76
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
77
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Deployment of a panel.
Azure allows the creation of customized panels in order to create an organized view of
Azure's resources. It is recommended for use in daily operations or tasks and for
monitoring resources, thus allowing for quick monitoring.
The following steps are taken to create a custom panel:
1. Sign in.
2. Select Panel, this view is usually the default view when you enter the
portal.
3. Click on [New Panel].
4. Clicking on New Panel opens the Icon Gallery, from which you select the
icons, and an empty grid where you organize the icons.
78
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
5. Press (no.1) and change the name of the panel to a more descriptive one
and add the elements that make up the panel. In example, metrics are
added.
Note: Metrics are added to the panel but are configured after the panel is created.
6. Press [Customization Complete] to save the panel.
79
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
7. Once the creation of the panel is completed, the metrics are configured.
Click on [Edit Metrics]. In the example, the metrics are configured to see
the traffic that passes through the VPN.
80
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Metrics
Aggregation
81
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
82
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
1
Hardware Security Module
83
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Key Management: Azure Key Vault can also be used as a key management
solution. Azure Key Vault makes it easy to create and control the encryption keys
used to encrypt data.
3. Certificate Management: Azure Key Vault is also a service that allows you to easily
provision, manage and deploy public and private Secure Sockets Layer and
Transport Layer Security (SSL/TLS) certificates for use with Azure and its connected
internal resources.
4. Secrecy storage based on hardware security modules: keys and secrets can be
protected by software or HSM devices.
Authentication Methods
To perform any operation with Key Vault, you need to authenticate yourself. It is
recommended that you use the following method.
Azure Managed Resource Identities: When you deploy an application to a virtual
machine in Azure, you can assign an identity to the virtual machine that has access to
Key Vault. You can also assign identities to other Azure resources. The advantage of this
approach is that the application or service does not manage the rotation of the first
secret.
84
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Click on [add].
85
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
86
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Access policies assign defined roles to administrators who manage keys, secrets,
and certificates.
Configure from a template: Azure Key Vault comes with predefined templates for
assigning roles in management groups.
87
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
88
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
89
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
90
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
In the browser pop-up window, enter the username and password for your Azure
account. Azure PowerShell obtains all subscriptions associated with this account.
PowerShell uses the first one by default.
You may need to specify the subscription that was used to create the key vault.
To view your account subscriptions, type the following command:
Get-AzSubscription
Note: Making PowerShell work on the right subscription is an important step, especially
if you have multiple subscriptions associated with your account.
Although you can use an existing storage account for your records, you must
create a storage account that is dedicated to the Key Vault logs.
$sa = New-AzStorageAccount -ResourceGroupName CNN-ResourceGroup -Name
cnnkeyvaultlogs -Type Standard_LRS -Location 'North Europe'
3. Then, execute.
$kv = Get-AzKeyVault -VaultName 'ccnKeyVault
Optionally, a retention policy can be set for logs so that older logs are
automatically deleted.
For example, setting the retention policy by configuring the -RetentionEnabled
mark in fbb$true and setting the -RetentionInDays number of days parameter,
91
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Microsoft recommends 90, so that records older than 90 days are automatically
deleted.
Set-AzDiagnosticSetting -ResourceId $kv.ResourceId -
StorageAccountId $sa.Id -Enabled $true -Category AuditEvent -
RetentionEnabled $true -RetentionInDays 90
Access to logs
Key Vault logs are stored in the insights-logs-auditevent container of the provided
storage account. All access and access attempts to Azure Key Vault are stored in these
logs. To view the logs, you have to download the blobs.
Blobs store text and binary data, up to about 4.7 TB. Blobs are composed of data
blocks that can be managed individually.
First, a variable is created for the name of the container. This variable is used in the
rest of this guide.
1. From the PowerShell console.
$container = 'insights-logs-auditevent
The following are step-by-step instructions for configuring Azure Key Vault firewalls
and virtual networks to restrict access to the key vault.
1. Login to Azure Powershell
Connect-AzAccount
2. The list of available virtual network rules is displayed. If no rule has been set
for this key vault location, the list is empty.
(Get-AzKeyVault -VaultName "mykeyvault").NetworkAcls
3. Enable a service connection point for Key Vault on an existing virtual network
and subnet.
92
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
6. If any trusted service needs to access this key vault, the bypass option is set
in AzureServices.
Update-AzKeyVaultNetworkRuleSet -VaultName "mykeyvault" -Bypass
AzureServices
Creation of keys
3. Click on [keys].
93
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Type: Key Vault supports only RSA and elliptic curve keys.
EC: "soft" elliptic curve key.
EC-HSM: "strong" elliptic curve key.
RSA: "soft" RSA key.
RSA-HSM: RSA key "strong".
94
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
RSA Key Size: Key Vault supports RSA keys with sizes of 2048, 3072 and 4096.
Key Vault supports elliptical curve key types p-256, p-384, p-521 and P-256K
(SECP256K1).
For the selection of the key types and their size, it must comply with the
requirements specified in the guide CCN-STIC-807 Cryptologic of Employment in
the National Security Framework. For this reason, for information systems
categorized as ENS High, the use of RSA-2048 key sizes is not allowed, since they
have a cryptological strength of 112 bits, which is lower than the 128 required.
Creation of secrets
1. Click on [secrets].
95
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Certificate creation
1. Click on [certificates].
96
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Content type: In the certificate combination are supported two formats based on PEM.
Or you can combine a single certificate encoded in PKCS #8 or a P7B file encoded in
base64. ----- BEGIN CERTIFICATE----- ----- END CERTIFICATE-----
97
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Percentage of duration: The percentage varies depending on the renewal option. In this
case it is defined as 80.
Advanced policy configuration: Optionally, a policy can be defined for this certificate.
4. Click on [create].
98
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Click on [encryption].
4. A new warehouse is created and used centrally for all storage accounts.
99
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
100
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
8. Select the key type. More information is available in section [4.3.8 Creating a key]
of this guide.
9. Click on [create].
Limitations
The table below represents the number of key transactions, the maximum number of
transactions allowed in 10 seconds per warehouse and region.
Service limits in Key Vault serve to prevent the misuse of resources and ensure the
quality of service for all Key Vault customers. When a service threshold is exceeded,
Key Vault limits the successive requests from that client over a period of time. When
this happens, Key Vault returns HTTP 429 status code (too many requests) and a
request error. In addition, failed requests that return a 429 code count towards the
limitation that Key Vault tracks.
In the HTTP 429 error code, start the client limiting by using an exponential backward
approach:
101
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Azure Site Recovery ensures service continuity by keeping applications running during
outages.
Workloads executing on physical and virtual machines are replicated from a primary site
to a secondary location. When an outage occurs at the primary site, it is mistakenly
switched to the secondary location. Once the primary location is running again, the
failback can be performed.
With Site Recovery you can manage the replication of:
Azure virtual machines that replicate between different regions.
Local virtual machines, Azure Stack virtual machines and physical servers.
The following steps are necessary for the correct configuration of ASR:
102
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: The virtual machines can be replicated in another region of Azure to cover your continuity
and disaster recovery needs. Periodic disaster recovery scans are recommended to ensure that
compliance needs are met. The VM is replicated with the specified configuration in the selected
region, so that your applications can be recovered in case of outages in the source region.
4. Select the region where you want to perform the replication.
5. Click on [advanced settings].
103
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Virtual Machine Resource Group: This new group is used to perform failover.
Virtual Network: A new virtual network is created for failover.
Availability: Select the type of availability in the region of destination. You can only
select "Availability Zone" if the region of destination supports availability zones. If the
destination availability type is "Availability Set" and you are protecting a VM with
managed disks, you can only view and select a managed availability set for VMs with
managed disks and an unmanaged availability set for VMs without managed disks.
Storage configuration
Cache account: The cache account is in the region of origin. It is used as a temporary
data store before replicating changes to the region of destination. By default, one
cache account per deposit is created and reused. You can select a different cache
account if you want to customize the cache account used for this virtual machine.
Source Managed Disk: Data that is replicated from the source VM is stored on the
replicated managed disks in the region of destination. For each managed disk in the
source VM, a managed disk is created as a replication and used in the target region.
Replication configuration
Warehouse Subscription: Select the Azure subscription in which the Recovery
Services store exists. Only the metadata corresponding to the WVs are stored in
104
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
this store. The real data on the discs never leaves the source and destination
regions.
Recovery Services Warehouse: The Recovery Services Warehouse contains the
configuration of the target virtual machine and organizes replication. In the event
of an outage and the source virtual machine is not available, a failover can be made
from the Recovery Services Warehouse.
Warehouse resource group: Recovery Services warehouse resource group.
Replication policy: The replication policy defines the configuration of the recovery
point retention record and snapshot frequency consistent with the application.
Extension configuration
Azure Virtual Machine (VM) extensions are small applications that provide configuration
and automation tasks after the deployment in Azure virtual machines.
Update configuration: Site Recovery manages extensions to all replicated items
associated with the warehouse and keeps them updated. You can also choose to update
the extensions manually. This does not require any reboot or affects the ongoing
replication of the virtual machines.
Automation Account: Site Recovery uses this automation account to update the Site
Recovery extension on all the replicated machines associated with the warehouse.
105
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Database replication
Active geographic replication is the feature of Azure SQL Database that allows you to
create secondary databases on a SQL Database server in the same or a different data
center (region).
The following steps create another secondary database replicated in another geographic
region of Azure.
1. Click from the Azure portal on [SQL Database].
106
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
107
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
108
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Service replication
This is done using the Site Recovery service: Site Recovery ensures service continuity by
keeping business applications and workloads up and running during outages. Replicates
workloads executing on physical and virtual machines from a primary site to a secondary
location.
When an outage occurs at the primary site, the secondary location is mistakenly
switched and applications are accessed from there. When the main location becomes
available again, the recovery switching can be performed there.
The first thing to do is to create a recovery services warehouse.
1. From the Azure portal search for recovery services warehouses.
2. Click on [add].
3. Then, the fields that request the creation of the warehouse must be completed.
Project details
109
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: Once we have created the warehouse, configure the continuity plan for the applications.
6. Click on [go to the resource].
110
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
111
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Source Resource Group: Choose the resource group where the virtual machine is
located.
9. Click on [Accept].
10. Select the virtual machine and click on [Accept].
112
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Recovery plans
3. In this step choose the source and destination region that the recovery plan is
created.
113
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
4. Click on [Accept].
Check failover.
From Azure you can perform periodic tests of the replicated services in different regions.
Test failover is executed to validate the replication and disaster recovery strategy
without any data loss or downtime. Test failover does not impact ongoing replication,
or the production environment.
114
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
115
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Recovery point
116
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
6. Click on [Accept].
The switching process takes a few minutes.
Note: At the end, the result of the test failover between regions is displayed.
3. After the test is completed in the virtual machine that was switched by
test fail, clean the test copy by a clean test failover. This operation
removes the test copy of the virtual machine that was created by the test
failover.
117
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
$Job_TFOCleanup = Start-ASRTestFailoverCleanupJob -
ReplicationProtectedItem $ReplicationProtectedItem
Get-ASRJob -Job $Job_TFOCleanup | Select State
118
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
6. Select [Add].
119
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
120
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Click on [Users].
121
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
122
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
123
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
124
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
125
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
From the panel you can view real-time risk reports on logins or risk detections.
At the end of the panel you can configure alerts that will come via email or a weekly
summary with the detections found.
In addition, the Authentication Mechanisms can be found in section [3.1.1.4 Conditional
Access Policies] of this Guide.
126
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Network Watcher
Network Watcher is a set of tools to monitor, diagnose and view log metrics in a virtual
network in Azure.
Creating a virtual network in a subscription is automatically enabled in the virtual
network region (VNET). This does not affect resources or associated charges.
Supervision
Monitoring communication between a machine
Network Watcher monitors communication at regular intervals by reporting
changes in availability, latency and topology between a virtual machine and
another connection point, such as another virtual machine.
Viewing resources in a virtual network
Network Watcher generates a diagram of the resources that contain a virtual
network and the relationships between the various resources.
To generate the diagram, the following steps are carried out:
1. Search Network Watcher
2. Click on [topology].
127
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. Select Subscription, resource group and the virtual network from which you
will generate the diagram.
Diagnosis
Network Watcher allows to detect problems in the following scenarios:
In network traffic towards a virtual machine or a gateway
In network routing from a virtual machine
On outgoing connections from a virtual machine
Determine latencies between different regions of Azure and Internet providers
In addition, it allows you to capture packets to and from a virtual machine.
Metrics
The metrics option allows to control the limits in Azure for all resources. To see it you
have to follow the next steps:
1. Search for Network watcher.
128
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. Select subscription, all resources the to be analyzed for quotas, the resource
regions and display all items. The example shows the quotas of all the network
elements for the Northern Europe region.
Logs
Network watcher allows to analyze traffic that has passed through an NSG. To do this,
perform the following configuration:
1. Search Network Watcher
129
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. Click on [configure].
4. Enable the NSGs where traffic is analyzed. To do this, click on the NSGs and
enable the option.
You must have a storage account created exclusively for saving the logs.
130
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
In addition, it is necessary to define the processing interval of the traffic analysis. You
can set it on every 10 minutes or every hour. By default, it will be set to every hour,
unless a very thorough analysis is required.
Package capture.
In the event that it is necessary to capture all the network traffic passing through a
specific machine, the Network Watcher packet catcher can be used.
For the configuration, the following steps are performed:
1. Search Network Watcher
131
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Filtering: It is also possible to filter by the source of the packets, the port through
which the traffic arrives. This part is optionalService Health
Provides a status of Azure's services, providing personalized guidance and support when
problems arise.
132
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Service Health: Provides a personalized view of the status of Azure services and
regions being used.
Resource Health: Reports on the status of individual cloud resources, such as a
virtual machine instance, firewall, etc.
The Service Health can be consulted as Resource Health:
1. Search Service Health
2. For Service Health click on [Service Problems], select subscription, region and the
service you want to check. In the example, SQL is checked.
133
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. For resource Health click on [Resource Status]. Select subscription and resource
type.
Azure Monitor
Azure Monitor is the solution that allows you to collect, analyze and manage telemetric
data both in the cloud and in local environments. It allows you to proactively identify
the issues that affect them and the resources on which they depend.
All data collected by Azure Monitor can be classified as one of the two fundamental
types: metrics and logs. Metrics are numerical values that describe some aspect of a
system at a given time.
The log data collected by Azure Monitor can be analyzed with queries that quickly
retrieve, consolidate and analyze the collected data.
Azure Monitor collects data from each of the following levels:
Application monitoring data: data on the performance and functionality of the code
written, regardless of the platform
Guest operating system monitoring data: data on the operating system on which the
application is running. The application can be executed in Azure, in another cloud or
in the local environment.
Monitoring of resources with DMV: data on the operation of an Azure resource.
Azure's subscription monitoring data: data on the operation and administration of
an Azure subscription, as well as on the status and operation of Azure itself.
Azure's tenant monitoring data: data on the performance of Azure's services at the
tenant level, such as Azure Active Directory
134
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
The log data collected by Azure Monitor can be analyzed with queries that quickly
retrieve, consolidate and analyze the collected data. You can create and test queries
using Log Analytics.
Azure monitor can be accessed by following these guidelines:
1. From the Azure portal in the search engine type Azure monitor.
135
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Alerts
Alerts allow to identify and fix problems before users can see them.
The key attributes of the alert rules are:
Destination resource: Defines the scope and available signals for the alerts. A
destination can be any Azure resource, such as a virtual machine or a log analytics
workspace.
Signal: It is emitted by the destination resource. The signals can be of the following
types:
o Metrics: For more information see [3.1.6.2 Metrics Systems/Azure
Monitor/Metrics Explorer].
o Activity Log: These are alerts that are activated when an event in the activity
log meets the conditions specified in the alert.
Activity log alerts are usually created when
Specific operations take place in Azure's resources.
A service maintenance event occurs.
136
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
When an alert from the activity log is activated, a group of actions is used to
generate actions or notifications. A group of actions is a reusable set of
notification recipients.
o Log: Log alerts consist of rules created for Azure Monitor or Application
Insights logs, to automatically execute specified log queries at regular
intervals. If the query results match certain criteria, an alert log is created.
As an example, an alert is created that sends a notification via mail when there is an
event in Service Health. To create the alert, perform the following steps:
1. Search Service Health, click on [Status Alerts/Create Service Health Alert].
2. Select subscription, services, regions and type of event. Select only those regions
where there is a resource created.
Type of event can be:
Service problem
Planned maintenance
Status messages
Once selected, in actions click on create action group.
137
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. Name the action group, give a short name that is part of the mail when the alert
fires, select subscription and resource group where the action group is saved.
Once done, we configure the action, write the name, press on the type and press on
edit details.
4. Select email, and add the desired email, only one per action is allowed. If you want
to send it to more recipients, add more actions.
138
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
5. Once the actions have been defined, the section Details of the alert is completed.
Name the alert, description (optional) and click on resource group.
Architecture
Since Security Center is a native part of Azure, Azure's PaaS services (such as Service
Fabric, SQL databases, and storage accounts) are monitored and protected by Security
Center without any implementation.
139
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Ongoing evaluations
Security Center is always detecting new resources that are deployed to workloads and
evaluating if they are configured according to recommended security procedures. If not,
they are marked and the user receives a list of recommendations ranked in order of
priority of what to correct in order to protect their services.
Initial Setup
1. Initially, Azure Security Center is configured, to do so, from Azure's portal search
Security Center.
140
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Note: You can set up an email account where all the notifications will arrive, or a phone number
where messages will be sent to you.
141
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Click on [recommendations].
Note: This panel shows all the recommendations found for your services.
142
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
5. Click on [correct].
143
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Virtual machines
1. Click on [Process and applications].
Note: In this panel you can follow the recommendations for each virtual machine Data and
Storage.
2. Click on [data and storage].
144
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. From this panel you can review the recommendations of the databases and
storage accounts.
Azure Sentinel
Azure Sentinel is a scalable, native security information management and automated
response solution in Azure. This service provides security analysis and intelligence
against threats, being a solution that allows to detect alerts, threats and offer a
response.
Azure Sentinel natively incorporates Log Analytics and Logic Apps.
145
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Collect data in the cloud: From applications, devices, users and the entire infrastructure,
both local and in different clouds.
Detect threats and reduce false positives through Microsoft's threat analysis and
intelligence
Investigate threats with artificial intelligence to look for suspicious activities by taking
advantage of Microsoft's cyber security work.
Respond with integrated orchestration and automation of common tasks.
146
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Workbooks
Once the data sources are connected, the data can be monitored through the
integration with Azure Monitor's books, providing versatility when creating custom
books.
Azure Sentinel allows you to create personalized books in the data, including also
integrated book templates that allow you to quickly get information from the data.
To view the workbooks (Books in the Portal), the following steps are taken:
1. Search for Azure Sentinel
2. Click on [Books].
Analysis
Azure Sentinel analyzes the alerts so that they are related to the incidents. Incidents are
groups of related alerts, which together create a potential threat that can be
investigated and resolved.
In addition, automatic learning rules are provided to map network behavior and search
resource anomalies.
To view the analysis rules, follow these steps:
1. Search for Azure Sentinel
2. Click on [Analysis].
147
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Research
Azure Sentinel's in-depth research tools are currently in draft form and help to
understand the scope of a potential security threat. You can choose an entity in the
interactive graphic to explore in depth the entity and its connections to reach the main
cause of the threat.
To consult this section, follow these steps:
1. Search for Azure Sentinel
2. Click on [Incidents] and select the incident to view the analysis.
Community
The Azure Sentinel community is a very effective resource for threat detection and
automation. New books, strategy notebooks, search for queries in a GitHub repository
are added. (https://github.com/Azure/Azure-Sentinel)
148
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
149
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Create the VNET with the subnets that were defined in the previous step.
New-AzVirtualNetwork -Name VNet1 -ResourceGroupName CCNVPN `
-Location ' North Europe'' -AddressPrefix 10.1.0.0/16 -Subnet $subnet1,
$subnet2
3. If you already have a virtual network, follow these steps to add a gateway
subnet
1. Select the VNET to which the subnet will be added
$vnet = Get-AzVirtualNetwork -ResourceGroupName CCNVPN -Name VNet1
150
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
151
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
152
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. Add connection to the virtual gateway, which is then used for the
VPN.
153
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
154
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Public IP
A VPN gateway must have a public IP address. The IP address resource is first requested
and then referred to when creating the virtual network gateway. The IP address is
dynamically assigned to the resource when the VPN gateway is created.
155
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Securing Subnets
Introduction to NSGs
This is performed through the NSGs. Network Security Groups (NSGs) are a firewall of
layer 4, since source and destination ports can be filtered by protocol (TCP/UDP/ICMP),
but not by content. They can be applied at two levels:
NIC: The rules only affect the machine on which the NSG is applied. They can also
be applied to machines with various NICs (Multi-Hommed)
Subnet: The rules affect all the machines on the subnet.
All created NSGs have six default rules established, 3 inbound and 3 outbound. These
rules cannot be modified or deleted. They have very high priorities so that they are
always the last to be implemented.
The incoming rule with priority 65000 allows machines on the same VNet to
communicate with each other. The incoming rule with priority 65001 allows access to
the machine from an Azure Load Balancer.
Finally, we have an incoming 65500 rule that blocks any other traffic that has not been
explicitly allowed in a rule with a lower priority value.
As for outbound rules, it is allowed the traffic from the virtual machine to any other
machine in the same VNet and also from the virtual machine to the Internet.
To see the activity log, see the monitoring section.
156
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
When a package arrives at the NSG, the rules are applied in increasing order of priority.
The first rule whose conditions are met applies the action and the rest of the rules are
not applied to that package.
The behavior of any package passing through the NSG would be as follows:
1. If a packet arrives on port 80 with source IP 10.10.0.22 and destination IP
10.10.0.50, the entry is allowed. Otherwise, the next rule applies.
2. If the packet is addressed to port 3389 it is allowed to enter. Otherwise,
the next rule applies.
3. If the package comes from an Azure Load Balanced, it is allowed to enter.
Otherwise, the next rule applies.
4. If the package does not meet any of the conditions of the rules above, the
last rule is met, access is denied.
As soon as a package complies with a rule, it does not continue processing and the rule
is met.
NSG Rules
An NSG may have zero rules or as many as necessary as long as they are within the limits
of Azure. Each rule has the following properties:
- Name: Unique within the same NSG. 80 characters limit. You cannot use the
characters dash, underscore, period, comma.
- Priority: Values between 100-4096. The rules are processed in order of priority,
from the lowest to the highest priority number.
- Origin and destination: It can be any (*), an individual IP, an IP range or a service
tag.
- Protocol: They can be TCP, UDP, ICMP or any other.
- Direction: Both incoming and outgoing traffic is applied.
- Port Range: You can specify an individual port (80) or a port range (10000-
10005).
157
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
In virtual machines you see the machines in which you have applied this NSG, choose
what you are going to check. To display the rules, the machine must be switched on.
You can also see the effective rules if you go to the virtual machine, to the networking
option, it shows server´s effective rules, and that NSG is applying it.
NSG limits
The default limits that exist by subscription are:
158
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
DNS by VNet 20
Deployment of an NSG.
An NSG is then deployed from both the Azure and Powershell portals:
1. Access Azure's portal, search for "network security groups"
159
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Click on [Add].
160
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
$Name = "CCN-NSG-Backend"
$RG = Get-AzResourceGroup -Name "CCN-RG-NSGs"
3. The NSG is created. This NSG is created with the default rules.
New-AzNetworkSecurityGroup -Name $Name -ResourceGroupName
$rg.ResourceGroupName -Location "northeurope"
2. Click on the menu on [entry or exit security rules], depending on the rule, in
the example an entry rule is created, add.
161
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. The variables are declared to know which NSG is going to be modified and
the name and port parameters of the rule.
$rgname="CCN-RG-NSGs"
$port=80
$rulename="AllowHTTP"
$nsgname="CCN-NSG-Backend"
3. You get the resource you are going to modify and add the rule
# You get the NSG
$nsg = Get-AzNetworkSecurityGroup -Name $nsgname -
ResourceGroupName $RGname
# You add the rule
$nsg | Add-AzNetworkSecurityRuleConfig -Name $rulename -
Description "Allow app port" -Access Allow `
-Protocol * -Direction Inbound -Priority 1000 -
SourceAddressPrefix "*" -SourcePortRange * `
-DestinationAddressPrefix * -DestinationPortRange $for
It is updated so that changes are applied.
#The NSG is updated.
$nsg | Set-AzNetworkSecurityGroup
162
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Azure Firewall
Previously, the guide showed the default option used to control traffic between
different networks.
There is another tool in Azure called Azure Firewall. Unlike the NSG Azure Firewall, it is
a firewall that is presented as a service that provides network and application level
protection in all the subscriptions and virtual networks.
In addition, it incorporates the following features:
163
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
High availability. This feature avoids having to set up any additional load balancers
and there is no need to set anything up manually.
Scalability. It can be vertically scaled as much as necessary to accommodate the
required network flows.
Areas of availability. You can cover several availability zones and thus increase
availability to 99.99% uptime. (It is produced with two or more availability zones).
The standard service time is 99.95%.
Threat information. You can enable a threat intelligence-based filtering to make the
firewall alert and deny traffic to and from malicious domains and IP addresses. This
information comes from Microsoft's Threat Intelligence source.
All events are integrated with Azure Monitor, allowing logs to be archived in a
storage account.
Allows integration with NSGs to provide greater security. Azure firewall applied to
the subnet and NSG applied to machine.
Configuration
To deploy Azure Firewall through the portal:
1. Search for Firewalls:
2. Click on [Add].
164
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
165
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Depending on the type of rule you need to click on NAT Rule Collection, Network Rule
Collection, Application Rule Collection.
NAT Rule
In the example below, NAT is performed for all the packets leaving the 10.80.10.0/24
network to the outside.
The required fields are:
Name of the rule collection
Priority: Between 100 and 65000
166
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Rules:
1. Name of the rule
2. Protocol
3. Source addresses
4. Destination Addresses: Must be the IP of the Firewall's Public IP
5. Destination Ports
6. Translated address: It is advisable to use a specific IP address of the
firewall subnet
7. Port translated
Network rules
In the example, rules are configured for communication between machines in the same
network. We allow access to Azure Monitor and Azure Backup services to machines in
the 10.80.10.0/24 and 10.80.20.0/24 networks. In addition, the machines in the
10.80.10.0/24 network are allowed to have an SSH connection to the machines in the
10.80.20.0/24 network and the ping is enabled between them.
Application rules
A rule is created to allow updates to machines from Windows Update.
167
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
VPN
This guide explains how to create a site-to-site VPN gateway connection from the local
network to the virtual network.
This type of connection requires a local VPN device that has a public IP address assigned.
Before starting the configuration, check that the following criteria are met:
1. Have a qualified compatible VPN device (included in the Virtual Private Networks
family of the CCN-STIC-105 Guide Information and Communication Technologies
Security Products Catalogue). For the list of compatible devices, please see
https://docs.microsoft.com/es-es/azure/vpn-gateway/vpn-gateway-about-vpn-
devices
2. Check that you have an external public IPv4 address for the VPN device.
Site-to-site connections to a local network require a VPN device. In this step, the VPN
device must be configured. To configure the VPN device, you need the following items:
A shared key. This is the same shared key that is specified when creating the site-
to-site VPN connection. (Point 4 Gateway and local network)
The public IP address of the virtual network gateway. You can see the public IP
address, to view it from the portal:
1. Search for the public IP name or search for public IPs to see all existing
ones.
168
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
169
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Next, two virtual networks gateways are needed, to work in case one fails,
name of the two connections and the key that was created in the local
network gateway.
170
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
171
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
172
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
In addition, you can see all the tags from Azure's search engine writes tags.
Below are some guidelines that can be followed using the Powershell console.
To view the existing tags of a resource group, use:
(Get-AzResourceGroup -Name examplegroup).Tags
To view the existing tags of a resource that has a specified resource identifier, use
(Get-AzResource -ResourceId /subscriptions/<subscription-
id>/resourceGroups/<rg-
name>/providers/Microsoft.Storage/storageAccounts/<storage-
name>).Tags
Or, to see the existing labels for a resource that has a specified name and resource
group, use:
173
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
To add tags to a resource group that already has tags, retrieve the existing tags, add the
new one, and reapply all of them:
$tags = (Get-AzResourceGroup -Name examplegroup).Tags
$tags.Add("Status", "Approved")
Set-AzResourceGroup -Tag $tags -Name examplegroup
3.2.2.2 Encryption
Information with a high level of confidentiality must be encrypted, both at rest and
during transmission.
What is the encryption at rest?
Encryption of stored data is called encryption at rest. Azure's standby encryption
procedures use symmetric encryption to quickly encrypt or decrypt large amounts of
data according to a simple conceptual model.
As described above, the purpose of encryption at rest is to encrypt the data stored on
the disk with a secret encryption key. To achieve the creation of a secure key, the system
needs to provide storage, access control and management of the encryption keys. To do
this, it is recommended to use the following services from Azure.
Azure Key Vault
Azure Key Vault is the recommended key storage solution and provides a routine
management experience for services.
Note: More information on Azure Key Vault key management can be found in the section [3.1.2.3
Protecting Cryptographic Keys] of this guide.
3.2.2.3 Backup
The Azure Backup service backs up data to the Microsoft Azure cloud. Local workloads
and machines as well as Azure virtual machines can be backed up.
174
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. Create a new resource group and a name that identifies the storage.
175
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
176
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. From here you can back up an entire virtual machine, an Azure resource or a virtual
server with SQL Server.
5. The first Azure Backup assistant asks for the copy frequency and the retention.
177
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
178
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Recommendations:
The recommended retention period is 180 days.
Set the copy points on a daily or monthly basis.
In addition, it is recommended that you select annual copy point retention.
7. When you have finished this configuration, click on [accept].
Then choose the virtual machine you want to back up.
8. Click on [accept].
9. To enable the backup, click on [Enable Backup].
To check if a machine is protected by Azure Backup, perform the following steps:
Search Azure Backup
Click on [Backup Items].
179
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
In addition, you can view and create new policies. To do this, click on backup
policies.
180
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Database backups
Also, from an Azure SQL Database server, a copy of the database can be made.
1. To do this, click on [all resources] and then select the database.
181
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
182
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Click on [add].
183
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
3. Choose a name and select the group of resources where you have the
virtual networks.
184
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
2. Then, deploy the plan and choose the plan you previously set up.
3. Finally, click on [save].
The DDOS panel shows the VNETs in which the plan is applied.
185
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
186
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Static threshold uses a user-defined threshold value to evaluate the rule, while dynamic
thresholds use automatic learning algorithms to continuously learn the metric behavior
pattern and calculate thresholds automatically.
A new action group should be created to execute this alert.
187
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
188
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Finally, add a name to the alert and click on [Create Alert Rule].
189
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Term Definition
Resource Group Container that stores the resources related to an Azure solution.
The resource group includes the resources you want to manage as
a group.
JSON Acronym for JavaScript Object Notation, is a simple text format for
data exchange.
Replication: RA- It replicates the data to another data center in a secondary region,
GRS but that data is available to be read-only if Microsoft initiates a
failover from the primary region to the secondary region.
190
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Key Vault Azure Key Vault is a tool for securely storing and accessing secrets.
A secret is anything to which you want to closely control access,
such as certificates, passwords or API keys. A warehouse is a logical
set of secrets.
Azure Disk It uses the industry standard BitLocker on Windows and DM-Crypt
Encryption on Linux to provide system-based encryption solutions that
integrate with Azure Key Vault.
ASR Azure Site Recovery is used for disasters recovery of local machines
and workloads in Azure and Azure VM virtual machines in a
secondary Azure region.
Service Health Azure Service Health informs you of service incidents and scheduled
maintenance work at Azure, allowing you to take action to mitigate
downtime.
191
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
op Operational Framework
op.acc.1 Identification
Yes No
192
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Yes No
Yes No
193
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
op.exp Exploitation
Yes No
Yes No
It applies: It complies:
194
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Yes No
Yes No
Yes No
It applies: It complies:
195
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Yes No
Yes No
It applies: It complies:
196
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Yes No
Yes No
Y No Yes No
e
s
Evidence collected: Comments:
Yes No
Yes No Yes No
197
National Cryptologic Centre
CCN-STIC 884A Secure Configuration Guide for Azure
Yes No
Mp.info.3 Encryption
Yes No Yes No
Comments:
Mp.info.9 Backup
Yes No Yes No
Yes No
Yes No
198
National Cryptologic Centre