You can use an Azure network security group to filter network traffic between Azure resources in an Azure virtual network. 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. For each rule, you can specify source and destination, port, and protocol.

Default security rules

Azure creates the following default rules in each network security group that you create:

Inbound

AllowVNetInBound

PrioritySourceSource portsDestinationDestination portsProtocolAccess
65000VirtualNetwork0-65535VirtualNetwork0-65535AnyAllow

AllowAzureLoadBalancerInBound

PrioritySourceSource portsDestinationDestination portsProtocolAccess
65001AzureLoadBalancer0-655350.0.0.0/00-65535AnyAllow

DenyAllInbound

PrioritySourceSource portsDestinationDestination portsProtocolAccess
655000.0.0.0/00-655350.0.0.0/00-65535AnyDeny

Outbound

AllowVnetOutBound
PrioritySourceSource portsDestinationDestination portsProtocolAccess
65000VirtualNetwork0-65535VirtualNetwork0-65535AnyAllow

AllowInternetOutBound
PrioritySourceSource portsDestinationDestination portsProtocolAccess
650010.0.0.0/00-65535Internet0-65535AnyAllow

DenyAllOutBound
PrioritySourceSource portsDestinationDestination portsProtocolAccess
655000.0.0.0/00-655350.0.0.0/00-65535AnyDeny

In the Source and Destination columns, VirtualNetworkAzureLoadBalancer, and Internet are service tags, rather than IP addresses. In the protocol column, Any encompasses TCP, UDP, and ICMP. When creating a rule, you can specify TCP, UDP, ICMP or Any. 0.0.0.0/0 in the Source and Destination columns represents all addresses. Clients like Azure portal, Azure CLI, or PowerShell can use * or any for this expression.

You can’t remove the default rules, but you can override them by creating rules with higher priorities.

Rules

AllowVnetInBound – This rule permits all the hosts inside the virtual network (including subnets) to communicate between them without any blocks.

AllowAzureLoadBalancerInBound – This rule allows an Azure load balancer to communicate with your VM and send heartbeats.

DenyAllInBound – This is the deny all rule that blocks any inbound traffic to the VM by default and protect the VM from malicious access outside the Azure Vnet.

Source

About Author

Leave a Reply