Network Security Group
https://www.greatminditacademy.com/
Azure Network Security groups
- Azure Network Security Groups (NSG) can be used to filter network traffic to azure resources
- NSG contains security rules that allow or deny in bound traffic and outbound traffic
- Every NSG has security rules. Each Security rule has the following properties
- Name
- Priority: This is number b/w 100 and 4096
- Source: Individual IP or Any or cidr range of the source
- Destination: Individual IP or Any or cidr range of the destination
- Protocol: TCP, UDP, ICMP or Any
- Direction: Inbound or outbound
- Port Range: Which ports you want to apply the traffic to
- Action: allow or deny
- Lets create a network security group in Azure
- Create a resource group
- Create a nsg
- Every NSG has security rules. Each Security rule has the following properties
- Name
- Priority: This is number b/w 100 and 4096
- Source: Individual IP or Any or cidr range of the source
- Destination: Individual IP or Any or cidr range of the destination
- Protocol: TCP, UDP, ICMP or Any
- Direction: Inbound or outbound
- Port Range: Which ports you want to apply the traffic to
- Action: allow or deny
- Lets create a network security group in Azure
- Create a resource group
- Create a nsg
- The NSG which we create already has some security rules which are referred as default security rules
- These default security rules
- allows all of the traffic outbound (from Azure Resource to anywhere)
- allows all of the traffic within virtual network inbound (b/w azure resources in a vnet)
- allows all communication from AzureLoadbalancer to Azure resource in a vnet
LAB Practice: Create a network security group which
- allows ping and http (tcp port 80 ) communication from any where
- allow tcp port 3306 from 100.120.200.220
- denies tcp port 3306 from anywhere
Next steps?
- Whey space in numbering in rules
- nsg can be applied to subnets as well
- consider one enterprise architecture and design nsg
- NSG can be applied to the subnet as well.
- Lets try to create the network, subnets and NSG for the architecture shown below
- So that only port 443 and 80 is allowed from internet
Now lets apply this NSG to Application Gateway Subnet
Now lets try to create a NSG for Management subnet which
- allows 3389 port from anywhere (ideally this would be your organization n/w range)
- If there is contradicting rule one says allow and the other says deny in nsg associated with nic and nsg associated with subnet, deny always wins
- Lets look at this scenario
- Create a nsg rule for subnet3
- allow all connections from subnet1 cidr range
- deny all connections from subnet2 cidr range
Comments
Post a Comment