Skip to content

Commit a67f34b

Browse files
authored
Merge pull request #310780 from asudbring/tsk544780-sfi-bastion
Replace RDP/DNAT with Azure Bastion in tutorial-firewall-deploy-portal.md
2 parents 01bae91 + a21d3ee commit a67f34b

1 file changed

Lines changed: 62 additions & 32 deletions

File tree

articles/firewall/tutorial-firewall-deploy-portal.md

Lines changed: 62 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Network traffic is subjected to the configured firewall rules when you route you
2525

2626
For this article, you create a simplified single virtual network with two subnets for easy deployment.
2727

28-
For production deployments, a [hub and spoke model](/azure/architecture/reference-architectures/hybrid-networking/hub-spoke) is recommended, where the firewall is in its own virtual network. The workload servers are in peered virtual networks in the same region with one or more subnets.
28+
For production deployments, a [hub and spoke model](/azure/architecture/reference-architectures/hybrid-networking/hub-spoke) is recommended, where the firewall is in its own virtual network. The workload servers are in peered virtual networks in West US with one or more subnets.
2929

3030
* **AzureFirewallSubnet** - the firewall is in this subnet.
3131
* **Workload-SN** - the workload server is in this subnet. This subnet's network traffic goes through the firewall.
@@ -40,7 +40,7 @@ In this article, you learn how to:
4040
> * Create a default route
4141
> * Configure an application rule to allow access to www.google.com
4242
> * Configure a network rule to allow access to external DNS servers
43-
> * Configure a NAT rule to allow a remote desktop to the test server
43+
> * Deploy Azure Bastion for secure VM access
4444
> * Test the firewall
4545
4646
> [!NOTE]
@@ -64,7 +64,7 @@ The resource group contains all the resources used in this procedure.
6464
2. On the Azure portal menu, select **Resource groups** or search for and select *Resource groups* from any page. Then select **Create**.
6565
4. For **Subscription**, select your subscription.
6666
1. For **Resource group** name, type **Test-FW-RG**.
67-
1. For **Region**, select a region. All other resources that you create must be in the same region.
67+
1. For **Region**, select **West US**. All other resources that you create must be in West US.
6868
1. Select **Review + create**.
6969
1. Select **Create**.
7070

@@ -81,7 +81,7 @@ This virtual network has two subnets.
8181
1. For **Subscription**, select your subscription.
8282
1. For **Resource group**, select **Test-FW-RG**.
8383
1. For **Virtual network name**, type **Test-FW-VN**.
84-
1. For **Region**, select the same region that you used previously.
84+
1. For **Region**, select **West US**.
8585
1. Select **Next**.
8686
1. On the **Security** tab, select **Enable Azure Firewall**.
8787
1. For **Azure Firewall name**, type **Test-FW01**.
@@ -103,17 +103,20 @@ This virtual network has two subnets.
103103
Now create the workload virtual machine, and place it in the **Workload-SN** subnet.
104104

105105
1. On the Azure portal menu or from the **Home** page, select **Create a resource**.
106-
2. Select **Windows Server 2019 Datacenter**.
106+
2. Select **Ubuntu Server 22.04 LTS**.
107107
4. Enter these values for the virtual machine:
108108

109109
|Setting |Value |
110110
|---------|---------|
111111
|Resource group |**Test-FW-RG**|
112112
|Virtual machine name |**Srv-Work**|
113-
|Region |Same as previous|
114-
|Image|Windows Server 2019 Datacenter|
115-
|Administrator user name |Type a user name|
116-
|Password |Type a password|
113+
|Region |West US|
114+
|Image|Ubuntu Server 22.04 LTS - x64 Gen2|
115+
|Size|Standard_B2s|
116+
|Authentication type|SSH public key|
117+
|Username |**azureuser**|
118+
|SSH public key source|Generate new key pair|
119+
|Key pair name|**Srv-Work_key**|
117120

118121
4. Under **Inbound port rules**, **Public inbound ports**, select **None**.
119122
6. Accept the other defaults and select **Next: Disks**.
@@ -124,6 +127,7 @@ Now create the workload virtual machine, and place it in the **Workload-SN** sub
124127
1. Accept the defaults and select **Next: Monitoring**.
125128
1. For **Boot diagnostics**, select **Disable** to disable boot diagnostics. Accept the other defaults and select **Review + create**.
126129
1. Review the settings on the summary page, and then select **Create**.
130+
1. On the **Generate new key pair** dialog, select **Download private key and create resource**. Save the key file as **Srv-Work_key.pem**.
127131
1. After the deployment is complete, select **Go to resource** and note the **Srv-Work** private IP address that you'll need to use later.
128132

129133
[!INCLUDE [ephemeral-ip-note.md](~/reusable-content/ce-skilling/azure/includes/ephemeral-ip-note.md)]
@@ -147,7 +151,7 @@ For the **Workload-SN** subnet, configure the outbound default route to go throu
147151
1. Select **Create**.
148152
1. For **Subscription**, select your subscription.
149153
1. For **Resource group**, select **Test-FW-RG**.
150-
1. For **Region**, select the same location that you used previously.
154+
1. For **Region**, select **West US**.
151155
1. For **Name**, type **Firewall-route**.
152156
1. Select **Review + create**.
153157
1. Select **Create**.
@@ -209,24 +213,34 @@ This is the network rule that allows outbound access to two IP addresses at port
209213
1. For **Destination Ports**, type **53**.
210214
2. Select **Add**.
211215

212-
## Configure a DNAT rule
216+
## Deploy Azure Bastion
213217

214-
This rule allows you to connect a remote desktop to the Srv-Work virtual machine through the firewall.
218+
Now deploy Azure Bastion to provide secure access to the virtual machine.
215219

216-
1. Select the **NAT rule collection** tab.
217-
2. Select **Add NAT rule collection**.
218-
3. For **Name**, type **rdp**.
219-
4. For **Priority**, type **200**.
220-
5. Under **Rules**, for **Name**, type **rdp-nat**.
221-
6. For **Protocol**, select **TCP**.
222-
7. For **Source type**, select **IP address**.
223-
8. For **Source**, type **\***.
224-
9. For **Destination address**, type the firewall public IP address.
225-
10. For **Destination Ports**, type **3389**.
226-
11. For **Translated address**, type the Srv-work private IP address.
227-
12. For **Translated port**, type **3389**.
228-
13. Select **Add**.
220+
1. On the Azure portal menu, select **Create a resource**.
221+
1. In the search box, type **Bastion** and select it from the results.
222+
1. Select **Create**.
223+
1. On the **Create a Bastion** page, configure the following settings:
224+
225+
| Setting | Value |
226+
|---------|-------|
227+
| Subscription | Select your subscription |
228+
| Resource group | **Test-FW-RG** |
229+
| Name | **Test-Bastion** |
230+
| Region | West US |
231+
| Tier | **Developer** |
232+
| Virtual network | **Test-FW-VN** |
233+
| Subnet | Select **Manage subnet configuration** |
234+
235+
1. In the **Subnets** page, select **+ Subnet**.
236+
1. Configure the new subnet:
237+
- **Name**: **AzureBastionSubnet** (this name is required)
238+
- **Subnet address range**: **10.0.4.0/26**
239+
1. Select **Save** and close the subnets page.
240+
1. Select **Review + create**.
241+
1. After validation passes, select **Create**.
229242

243+
The Bastion deployment takes about 10 minutes to complete.
230244

231245
### Change the primary and secondary DNS address for the **Srv-Work** network interface
232246

@@ -244,19 +258,35 @@ For testing purposes, configure the server's primary and secondary DNS addresses
244258

245259
Now, test the firewall to confirm that it works as expected.
246260

247-
1. Connect a remote desktop to the firewall public IP address and sign in to the Srv-Work virtual machine.
248-
1. Open Internet Explorer and browse to `https://www.google.com`.
249-
4. Select **OK** > **Close** on the Internet Explorer security alerts.
261+
1. In the Azure portal, navigate to the **Srv-Work** virtual machine.
262+
1. Select **Connect**, then select **Connect via Bastion**.
263+
1. Select **Use SSH Private Key from Local File**.
264+
1. For **Username**, type **azureuser**.
265+
1. Select the folder icon and browse to the **Srv-Work_key.pem** file you downloaded earlier.
266+
1. Select **Connect**.
267+
1. At the bash prompt, run the following commands to test DNS resolution:
268+
269+
```bash
270+
nslookup www.google.com
271+
nslookup www.microsoft.com
272+
```
273+
274+
Both commands should return answers, showing that your DNS queries are getting through the firewall.
250275

251-
You should see the Google home page.
276+
1. Run the following commands to test the application rule:
252277

253-
5. Browse to `https://www.microsoft.com`.
278+
```bash
279+
curl https://www.google.com
280+
curl https://www.microsoft.com
281+
```
254282

255-
The firewall should block you.
283+
The `www.google.com` request should succeed, and you should see the HTML response.
284+
285+
The `www.microsoft.com` request should fail, showing that the firewall is blocking the request.
256286

257287
So now you verified that the firewall rules are working:
258288

259-
* You can connect to the virtual machine using RDP.
289+
* You can connect to the virtual machine using Bastion and SSH.
260290
* You can browse to the one allowed FQDN, but not to any others.
261291
* You can resolve DNS names using the configured external DNS server.
262292

0 commit comments

Comments
 (0)