- 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:
Paths into this note
9 notes lead here
-
No need to manage NSG each time we add a VM
-
tells which NSG or rule allowed or denied traffic
-
Basic allows traffic by default. NSGs can be used to control access.
-
In continuation to Create NSG in Azure about adding rules to NSG
-
ASG can be added as source or destination in NSG
-
NSGs are focused on traffic into and out of the virtual network
-
Network Security Groups, Application Security Groups and Service Tags
-
we can use NSG to deny traffic as needed
-
Control traffic flows via Azure Firewall or NSG/ASG