Lab7 - Understanding Features of Network Security Group - Azure
Lab7 - Understanding Features of Network Security Group - Azure
You can filter network traffic to and from Azure resources in an Azure
virtual network with a network security group. A network security
group contains security rules that allow or deny inbound network traffic
to, or outbound network traffic from, several types of Azure resources.
To learn about which Azure resources can be deployed into a virtual
network and have network security groups associated to them, see
Virtual network integration for Azure services. For each rule, you can
specify source and destination, port, and protocol.
This article explains network security group concepts, to help you use
them effectively. If you've never created a network security group, you
can complete a quick tutorial to get some experience creating one. If
you're familiar with network security groups and need to manage
them, see Manage a network security group. If you're having
communication problems and need to troubleshoot network security
groups, see Diagnose a virtual machine network traffic filter problem.
You can enable network security group flow logs to analyze network
traffic to and from resources that have an associated network security
group.
Security rules
Page 1 of 88
Cloud Computing - Azure
Property
Explanation
Name
Priority
Source or destination
Page 2 of 88
Cloud Computing - Azure
Protocol
TCP, UDP, or Any, which includes TCP, UDP, and ICMP. You cannot
specify ICMP alone, so if you require ICMP, use Any.
Direction
Port range
You can specify an individual or range of ports. For example, you could
specify 80 or 10000-10005. Specifying ranges enables you to create
fewer security rules. Augmented security rules can only be created in
network security groups created through the Resource Manager
deployment model. You cannot specify multiple ports or port ranges in
the same security rule in network security groups created through the
classic deployment model.
Action
Allow or deny
Topology:
Page 4 of 88
Cloud Computing - Azure
Page 5 of 88
Cloud Computing - Azure
Page 6 of 88
Cloud Computing - Azure
Page 7 of 88
Cloud Computing - Azure
Page 8 of 88
Cloud Computing - Azure
Page 9 of 88
Cloud Computing - Azure
Page 10 of 88
Cloud Computing - Azure
Page 11 of 88
Cloud Computing - Azure
Page 12 of 88
Cloud Computing - Azure
Page 13 of 88
Cloud Computing - Azure
Page 14 of 88
Cloud Computing - Azure
Click “Create”.
Page 15 of 88
Cloud Computing - Azure
Page 16 of 88
Cloud Computing - Azure
Page 17 of 88
Cloud Computing - Azure
Page 18 of 88
Cloud Computing - Azure
In “Instance details”
Page 19 of 88
Cloud Computing - Azure
In “Administrator Account”.
Page 20 of 88
Cloud Computing - Azure
In “Save Money”
Click “Yes”.
Page 21 of 88
Cloud Computing - Azure
Page 22 of 88
Cloud Computing - Azure
In “Disks”,
Page 23 of 88
Cloud Computing - Azure
In “Networking”
Page 24 of 88
Cloud Computing - Azure
Page 25 of 88
Cloud Computing - Azure
In “Management”.
Page 26 of 88
Cloud Computing - Azure
Page 27 of 88
Cloud Computing - Azure
In “Guest config”
Page 28 of 88
Cloud Computing - Azure
In “Tags”.
Page 29 of 88
Cloud Computing - Azure
Click “Create”.
Page 30 of 88
Cloud Computing - Azure
Once you have successfully deployed Virtual machine, then click “Virtual machines”.
Page 31 of 88
Cloud Computing - Azure
In “Virtual machines”,
Page 32 of 88
Cloud Computing - Azure
Page 33 of 88
Cloud Computing - Azure
Page 34 of 88
Cloud Computing - Azure
Page 35 of 88
Cloud Computing - Azure
In “Disks”
Page 36 of 88
Cloud Computing - Azure
Subnet “Sans-Subnet”.
Page 37 of 88
Cloud Computing - Azure
Page 38 of 88
Cloud Computing - Azure
In “Management”
Page 39 of 88
Cloud Computing - Azure
In “Guest config”.
Page 40 of 88
Cloud Computing - Azure
Click “Tags”.
Page 41 of 88
Cloud Computing - Azure
Click “Create”.
Page 42 of 88
Cloud Computing - Azure
Page 43 of 88
Cloud Computing - Azure
Page 44 of 88
Cloud Computing - Azure
In “Azure Marketplace”
Page 45 of 88
Cloud Computing - Azure
Page 46 of 88
Cloud Computing - Azure
Click “Create”.
Page 47 of 88
Cloud Computing - Azure
In “All resources”.
Click “NSG-AllowRDPSSH”.
Page 48 of 88
Cloud Computing - Azure
In “Inbound security rules” is a rule which allows user specified traffic from public network.
Page 49 of 88
Cloud Computing - Azure
In “Outbound security rules” is a rule which allows user specified traffic from internal network of Azure
(Private) to public network for access internet.
By default, it will deny all outbound traffic except Internet access and VNet outbound traffic.
Page 50 of 88
Cloud Computing - Azure
Click “Add”.
I have required to create rules for allow RDP (3389) and SSH (22) Ports for this Network security group.
Page 51 of 88
Cloud Computing - Azure
Source : Any
Destination : Any
Protocol : TCP
Action : Allow
Priority : 100
Name : AllowRDP :
Page 52 of 88
Cloud Computing - Azure
Click “Add”.
Page 53 of 88
Cloud Computing - Azure
You are able to see that Inbound security rules has been created with priority “100”. RDP is not
recommended to access the server through public. That is the reason it shows warning.
Page 54 of 88
Cloud Computing - Azure
Click “Add”.
Page 55 of 88
Cloud Computing - Azure
Source : Any
Destination : Any
Protocol : TCP
Action : Allow
Priority : 110
Name : AllowSSH
Page 56 of 88
Cloud Computing - Azure
Click “Add”.
Page 57 of 88
Cloud Computing - Azure
You are able to see 100 & 110 inbound security rules are created.
While any inbound traffic come from outside first it will check the lowest priority rule “100” if the traffic
is allowed in that rule it will match and allow. Otherwise it will check next priority rule.
Page 58 of 88
Cloud Computing - Azure
By default it will allow Internet (any protocol and and any port) from azure virtual machine to public.
Page 59 of 88
Cloud Computing - Azure
Click “Associate”.
Page 60 of 88
Cloud Computing - Azure
You are able to see list of VM’s Network interface(s) which you have created.
Note: If you have checked any one of the network interface, NSG (Network Security Group) will be
associated only for that particular network interface simultaneously. If you have required to apply
the same NSG to other VM(s) also, in that case you will click on the “Network interface” named
manually. I will click on “Ubuntuvm-azure19”.
Page 61 of 88
Cloud Computing - Azure
In “Network Interfaces”
You are able to see that “UbuntuVM-Azure” has been successfully associated.
Page 62 of 88
Cloud Computing - Azure
Page 63 of 88
Cloud Computing - Azure
By default “Windows-VM” network interface has been selected. Because existing network interface has
been already associated.
Click on “windowsvm-azure134”.
Page 64 of 88
Cloud Computing - Azure
Now you are able to see that Windows VM network interface also associated with “NSG-AllowRDPSSH”
network security group.
Page 65 of 88
Cloud Computing - Azure
Page 66 of 88
Cloud Computing - Azure
Page 67 of 88
Cloud Computing - Azure
Click “Dissociate”.
Page 68 of 88
Cloud Computing - Azure
Click “Yes”.
Page 69 of 88
Cloud Computing - Azure
In “Network Interfaces”
There is no network interfaces are associated with Network Security Group (NSG).
Page 70 of 88
Cloud Computing - Azure
Page 71 of 88
Cloud Computing - Azure
In “Associate subnet”
Page 72 of 88
Cloud Computing - Azure
Click on “SANS-VNET”.
Page 73 of 88
Cloud Computing - Azure
Page 74 of 88
Cloud Computing - Azure
Click “Ok”.
Page 75 of 88
Cloud Computing - Azure
“NSG-AllowRDPSSH” Network Security Group has been associated with Sans-Subnet (10.0.1.0/24) of
“SANS-VNET”.
Page 76 of 88
Cloud Computing - Azure
Page 77 of 88
Cloud Computing - Azure
Page 78 of 88
Cloud Computing - Azure
Type “mstsc” in your local machine to access the “Windows Server 2008 R2” remotely.
Type the public IP address of Windows server in Remote Desktop Connection console and click
“Connect”.
Page 79 of 88
Cloud Computing - Azure
Type Username and Password for the Windows 2008 Server R2 which you have provided in Azure portal
while creating a virtual machine.
Click “Ok”.
Page 80 of 88
Cloud Computing - Azure
Click “Yes”.
Page 81 of 88
Cloud Computing - Azure
In Windows Server 2008 R2, I can able to access the internet because the network 10.0.1.0/24 subnet is
belongs to Public Network (publicly accessible).
Page 82 of 88
Cloud Computing - Azure
Page 83 of 88
Cloud Computing - Azure
Kindly note the public address provided by azure to access the Ubuntu through SSH.
Page 84 of 88
Cloud Computing - Azure
Page 85 of 88
Cloud Computing - Azure
Click “Yes”.
Page 86 of 88
Cloud Computing - Azure
Type user name of the Ubuntu server as “sansbound” and press “Enter”.
Page 87 of 88
Cloud Computing - Azure
Earlier days we have created Network Security Group and Allow the required ports while
creating the Virtual machine.
But, today we have created Network Security Group manually and understood its features like
associate the Network Security Group with Network Interface / Subnet. If we associate the Network
Security Group it will applicable for the VM’s in entire subnet.
Page 88 of 88