- Can be used to control traffic flow
- NSGs can be applied at the subnet or NIC level but are always enforced at the NIC
Security Rules consist of:
- Source
- Destination
- Protocol
- Port
- Action
- Priority
- Lower priority number has higher priority
Source and destination
- can be CIDR
- can be service tags
- ASG (Application Security Group) (Tags basically)
Default rules
VNet, Internet, etc are service tags.
Inbound
- AllowVNetInBound
- AllowAzureLoadBalancerInBound
- DenyAllInbound
Outbound
- AllowVnetOutBound
- AllowInternetOutBound
- DenyAllOutBound
How it works if both vnet and subnet have nsg
In terms of precedence. Whichever is the first thing traffic encounters. So,
Incoming
- Subnet wins
Outgoing
- VM NIC NSG wins
references:
Subscribe to NordLetter
A weekly newsletter on living in Finland.