Remediation
From Azure Portal
- Click on
Bastions. - Select the
Subscription. - Select the
Resource group. - Type a
Namefor the new Bastion host. - Select a
Region. - Choose
Standardnext toTier. - Use the slider to set the
Instance count. - Select the
Virtual networkorCreate new. - Select the
SubnetnamedAzureBastionSubnet. Create aSubnetnamedAzureBastionSubnetusing a/26CIDR range if it doesn't already exist. - Select the appropriate
Public IP addressoption. - If
Create newis selected for thePublic IP addressoption, provide aPublic IP address name. - If
Use existingis selected forPublic IP addressoption, select an IP address fromChoose public IP address. - Click
Next: Tags >. - Configure the appropriate
Tags. - Click
Next: Advanced >. - Select the appropriate
Advancedoptions. - Click
Next: Review + create >. - Click
Create.
From Azure CLI
az network bastion create \
--location {{location}} \
--name {{bastion-host-name}} \
--public-ip-address {{public-ip-address-name-or-id}} \
--resource-group {{resource-group-name}} \
--vnet-name {{virtual-network-name}} \
--scale-units {{integer}} \
--sku Standard \
--disable-copy-paste true|false \
--enable-ip-connect true|false \
--enable-tunneling true|false
From PowerShell
Create the appropriate Virtual network settings and Public IP Address settings:
$subnetName = "AzureBastionSubnet"
$subnet = New-AzVirtualNetworkSubnetConfig `
-Name $subnetName `
-AddressPrefix {{bastion-subnet-cidr-26}}
$virtualNet = New-AzVirtualNetwork `
-Name {{virtual-network-name}} `
-ResourceGroupName {{resource-group-name}} `
-Location {{location}} `
-AddressPrefix {{virtual-network-cidr}} `
-Subnet $subnet
$publicip = New-AzPublicIpAddress `
-ResourceGroupName {{resource-group-name}} `
-Name {{public-ip-address-name}} `
-Location {{location}} `
-AllocationMethod Dynamic `
-Sku Standard
Create the Azure Bastion service using the information within the created variables from above:
New-AzBastion `
-ResourceGroupName {{resource-group-name}} `
-Name {{bastion-host-name}} `
-PublicIpAddress $publicip `
-VirtualNetwork $virtualNet `
-Sku "Standard" `
-ScaleUnit {{scale-unit-count}}