Open jiasli opened 2 years ago
For Microsoft internal users, to avoid triggering sev 2 IcM, you may
--nsg-rule NONE
first,CorpNetPublic
which allows all Microsoft IP addresses.# SSH 22
az network nsg rule create --resource-group $rg --nsg-name $nsgname --name allow_ssh --priority 100 --source-address-prefixes CorpNetPublic --destination-port-ranges 22 --direction Inbound --access Allow --protocol Tcp --description "Allow SSH from CorpNet"
# RDP 3389
az network nsg rule create --resource-group $rg --nsg-name $nsgname --name allow_rdp --priority 100 --source-address-prefixes CorpNetPublic --destination-port-ranges 3389 --direction Inbound --access Allow --protocol Tcp --description "Allow RDP from CorpNet"
Context
--nsg-rule
fromaz vm create
by default opens port3389
for RDP on Windows VM and port22
for SSH on Linux VM to public internet:This imposes a security risk and will trigger sev 2 IcM. If this behavior is considered insecure Microsoft/Azure internally, it is considered insecure externally for public users.
Proposed solution
--nsg-rule
should be default toNONE
. User must explicitly specifyRDP
orSSH
.