Azure · Bastion · Máquinas Virtuais · Virtual Network

Improve Security with Azure Bastion

Are you looking for a new way to improve security when connecting to your virtual machines in Azure? You should check out Azure Bastion.

In the past, to ensure RDP and SSH connectivity to your Azure Virtual Machines, you would probably have used a jump box where people would connect to access the other VMs.

Of course, a jump box improves the security of your access, but it introduces some gaps that Azure Bastion addresses.

Azure Bastion overview

First, Azure Bastion is a platform-as-a-service that provides secure RDP and SSH connectivity to protect your Azure virtual machines.

The Azure Bastion implementation enables access to all VMs within a virtual network through a single reinforced access point, the AzureBastionSubnet.

azure bastion overview diagram blog vinicius deschamps
azure bastion overview diagram blog vinicius deschamps

And as you can imagine, the connection to your VM will now occur through the Azure Portal, which connects to the Azure Bastion service using its public IP and loads your VM directly in your browser.

Cost

To enjoy the benefits of Azure Bastion, you will incur an additional cost to your subscription

US$0.19/hour (~ US$138.70/month per Azure Bastion)

There is also outbound data transfer cost, but prices may vary depending on usage. However, the first 5 GB/month are free.

Requirements

To create the Azure Bastion in your Subscription

  • Your virtual network must have a Subnet named AzureBastionSubnet
  • The AzureBastionSubnet must be /27 or larger
  • Azure Bastion uses a Public IP and must be of the Standard Public IP SKU

To use Azure Bastion

  • Any HTML5-compatible browser
  • Users or Security Groups using the Azure Bastion resource must have
    • Reader role on the Virtual Machine(s)
    • Reader role on the network interface where the VM's private IP resides
    • Reader role for the Azure Bastion resource

Creating Azure Bastion in a new environment

Create Azure Bastion

First, we will create the Azure Bastion resource by typing Azure Search Bastion and clicking on Bastions

azure search bastion blog vinicius deschamps

In Bastions, we will click on Add

azure bastion add blog vinicius deschamps

To create Bastion, select the Resource group (1), an Name (2) for your Bastion instance, the Region (3), then click Create new (4) to configure the new Virtual Network

azure bastion create a bastion create virtual network blog vinicius deschamps

When creating a virtual network, keep in mind that your Azure Bastion must have a subnet called AzureBastionSubnet and the address range must be at least /27 and the address space must be able to accommodate it.

azure bastion create a bastion create virtual network azurebastionsubnet blog vinicius deschamps

After creating the new Virtual Network, everything else is under Configure Virtual Networks and properly filled, but feel free to change if you have a specific need to create the Bastion resource. Then, click Review + Create

azure bastion create a bastion configure virtual networks blog vinicius deschamps

Now, re-check that everything is OK and click Create

azure bastion create a bastion review create create blog vinicius deschamps

Create a virtual machine with Bastion access

Type Virtual Machines, and click Virtual machines in the Azure Portal search

azure search virtual machine blog vinicius deschamps

In Virtual Machines, go to Add (1) and Virtual Machine (2)

azure virtual machines add virutal machine blog vinicius deschamps

You will need to provide all information from 1 to 8, then go to the Networking tab

azure create a virtual machine blog vinicius deschamps

In Networking you should be careful when choosing options and ensure that you select the same Virtual Network (1) used to create the AzureBastionSubnet, and choose any available Subnet (2).

Note that I chose None for the Public IP (3) and Public inbound ports (4) because Azure Bastion does not require the virtual machine to have a Public IP, since we will connect through Azure

Then click Review + Create

azure create a virtual machine networking blog vinicius deschamps

Verify that everything is correct with the information and press Create

azure create a virtual machine review create create blog vinicius deschamps

Connect to your virtual machine using Bastion

Go to the virtual machine you created and look for Bastion

azure virtual machine operations bastion blog vinicius deschamps

Fill in your Username (1) and Password (2), then press Connect (3)

azure virtual machine bastion connect blog vinicius deschamps

Voila, you are now accessing your Virtual Machine through the browser, using Bastion

azure virtual machine bastion remote desktop browser blog vinicius deschamps

And for those who want a little more, here is a demonstration we did at Azure Floripa

AzureAzure BastionSegurança
Improve Security with Azure Bastion — Vinicius Deschamps