l="eastus2"; echo $l
env="prod"; echo $env
project="bicephub"; echo $env
tags="env=$env project=$project"; echo $tags
rg="rg-nsg-$project-$env-$l"; echo $rg
sub_id='########-####-####-####-############'; echo $sub_id
# Default NSG
# nsg_n="nsg-default-$project-$env-$l"; echo $nsg_n
# AGW NSG
nsg_n="nsg-agw-$project-$env-$l"; echo $nsg_n
# RG
az group create \
--subscription $sub_id \
--name $rg \
--location $l \
--tags $tags
# NSG
az network nsg create \
--name $nsg_n \
--subscription $sub_id \
--resource-group $rg \
--location $l \
--tags $tags
# -----------------------------------------------------------------------------------------------
# RDP
# -----------------------------------------------------------------------------------------------
az network nsg rule create \
--direction Inbound \
--source-address-prefixes "*" \
--source-port-ranges "*" \
--destination-address-prefixes VirtualNetwork \
--destination-port-ranges 3389 \
--protocol "TCP" \
--access Allow \
--priority 100 \
--name AllowRdpInbound \
--nsg-name $nsg_n \
--subscription $sub_id \
--resource-group $rg
# -----------------------------------------------------------------------------------------------
# SSH
# -----------------------------------------------------------------------------------------------
az network nsg rule create \
--direction Inbound \
--source-address-prefixes "*" \
--source-port-ranges "*" \
--destination-address-prefixes VirtualNetwork \
--destination-port-ranges 22 \
--protocol "TCP" \
--access Allow \
--priority 200 \
--name AllowSshInbound \
--nsg-name $nsg_n \
--subscription $sub_id \
--resource-group $rg
# -----------------------------------------------------------------------------------------------
# AGW V1
# -----------------------------------------------------------------------------------------------
# AllowGatewayManagerInbound
az network nsg rule create \
--direction Inbound \
--priority 300 \
--destination-port-ranges 65503-65534 \
--protocol TCP \
--source-address-prefixes GatewayManager \
--destination-address-prefixes "*" \
--access Allow \
--name AllowGatewayManagerInbound \
--nsg-name $nsg_n \
--subscription $sub_id \
--resource-group $rg
# -----------------------------------------------------------------------------------------------
# AGW V2
# -----------------------------------------------------------------------------------------------
# AllowGatewayManagerInbound
az network nsg rule create \
--direction Inbound \
--priority 400 \
--destination-port-ranges 65200-65535 \
--protocol TCP \
--source-address-prefixes GatewayManager \
--destination-address-prefixes "*" \
--access Allow \
--name AllowGatewayManagerInbound \
--nsg-name $nsg_n \
--subscription $sub_id \
--resource-group $rg
# -----------------------------------------------------------------------------------------------
# FD
# -----------------------------------------------------------------------------------------------
# AllowAzureFrontDoor.BackendInbound
az network nsg rule create \
--direction Inbound \
--priority 500 \
--destination-port-ranges 443 80 \
--protocol TCP \
--source-address-prefixes AzureFrontDoor.Backend \
--destination-address-prefixes VirtualNetwork \
--access Allow \
--name AllowAzureFrontDoor.Backend \
--nsg-name $nsg_n \
--subscription $sub_id \
--resource-group $rg
az-bicep-nsg's Introduction
az-bicep-nsg's People
az-bicep-nsg's Issues
create nsg repo with generic rules
rdp rule
ssh rule
sql rule
etc.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.