You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task 544786: Replace DNAT/RDP with Azure Bastion in secure-cloud-network.md
Changes:
- Added AzureBastionSubnet (10.0.2.0/26) to Spoke-01 virtual network
- Changed both VMs from Windows Server 2019 to Ubuntu 22.04 LTS
- Updated VM authentication to use SSH keys with Azure-generated keys
- Added Nginx installation steps for both servers using Run Command
- Deployed Azure Bastion (Developer SKU) in Spoke-01
- Removed DNAT rule collection entirely
- Updated Network rule from RDP (port 3389) to SSH/HTTP (ports 22,80)
- Changed source/destination in network rule to use CIDR ranges instead of wildcards
- Updated testing section to use Bastion SSH instead of DNAT RDP
- Changed IE/RDP testing to curl/SSH commands for Linux
- Updated ms.date to 01/22/2026
Related to parent work item #545010 (Sprint 2 Bastion updates)
@@ -161,16 +165,20 @@ Now you can peer the hub and spoke virtual networks.
161
165
## Deploy the servers
162
166
163
167
1. On the Azure portal, select **Create a resource**.
164
-
1. Select **Windows Server 2019 Datacenter** in the **Popular** list.
168
+
1. Search for **Ubuntu Server 22.04 LTS** and select it.
169
+
1. Select **Create** > **Virtual machine**.
165
170
1. Enter these values for the virtual machine:
166
171
167
172
|Setting |Value |
168
173
|---------|---------|
169
174
|Resource group |**fw-manager-rg**|
170
175
|Virtual machine name |**Srv-workload-01**|
171
176
|Region |**(US) East US**|
172
-
|Administrator user name |type a user name|
173
-
|Password |type a password|
177
+
|Image |**Ubuntu Server 22.04 LTS - x64 Gen2**|
178
+
|Authentication type |**SSH public key**|
179
+
|Username |**azureuser**|
180
+
|SSH public key source |**Generate new key pair**|
181
+
|Key pair name |**srv-workload-01_key**|
174
182
175
183
1. Under **Inbound port rules**, for **Public inbound ports**, select **None**.
176
184
1. Accept the other defaults and select **Next: Disks**.
@@ -182,8 +190,9 @@ Now you can peer the hub and spoke virtual networks.
182
190
1. Select **Disable** to disable boot diagnostics.
183
191
1. Accept the other defaults and select **Review + create**.
184
192
1. Review the settings on the summary page, and then select **Create**.
193
+
1. When prompted, download and save the private key file (for example, **srv-workload-01_key.pem**).
185
194
186
-
Use the information in the following table to configure another virtual machine named **Srv-Workload-02**. The rest of the configuration is the same as the **Srv-workload-01** virtual machine.
195
+
Use the information in the following table to configure another virtual machine named **Srv-Workload-02**. The rest of the configuration is the same as the **Srv-workload-01** virtual machine, but use a different key pair name such as **srv-workload-02_key**.
187
196
188
197
|Setting |Value |
189
198
|---------|---------|
@@ -192,6 +201,47 @@ Use the information in the following table to configure another virtual machine
192
201
193
202
After the servers are deployed, select a server resource, and in **Networking** note the private IP address for each server.
194
203
204
+
### Install Nginx on the servers
205
+
206
+
After the virtual machines are deployed, install Nginx on both servers to verify web connectivity later.
207
+
208
+
1. In the Azure portal, navigate to the **Srv-workload-01** virtual machine.
Deploy Azure Bastion in the Spoke-01 virtual network to securely connect to the virtual machines.
225
+
226
+
1. In the Azure portal, search for **Bastions** and select it.
227
+
1. Select **Create**.
228
+
1. Configure the Bastion with the following settings:
229
+
230
+
| Setting | Value |
231
+
|------------------------|----------------------|
232
+
| Subscription | Select your subscription |
233
+
| Resource group |**fw-manager-rg**|
234
+
| Name |**Bastion-01**|
235
+
| Region |**East US**|
236
+
| Tier |**Developer**|
237
+
| Virtual network |**Spoke-01**|
238
+
| Subnet |**AzureBastionSubnet (10.0.2.0/26)**|
239
+
240
+
1. Select **Review + create**, then select **Create**.
241
+
242
+
> [!NOTE]
243
+
> Azure Bastion deployment can take approximately 10 minutes to complete.
244
+
195
245
## Create a firewall policy and secure your hub
196
246
197
247
A firewall policy defines collections of rules to direct traffic on one or more Secured virtual hubs. You create your firewall policy and then secure your hub.
@@ -221,44 +271,25 @@ A firewall policy defines collections of rules to direct traffic on one or more
221
271
| Destination |**\*.microsoft.com**|
222
272
223
273
224
-
1. Select **Add**.
225
-
1. Add a **DNAT rule** so you can connect a remote desktop to the **Srv-Workload-01** virtual machine.
226
-
1. Select **Add a rule collection** and enter the following information.
| Destination |The **Srv-Workload-02**private IP address that you noted previously.|
292
+
| Destination |**10.0.0.0/16,10.1.0.0/16**|
262
293
263
294
264
295
1. Select **Add**, then select **Next: IDPS**.
@@ -302,34 +333,64 @@ Now you must ensure that network traffic gets routed through your firewall.
302
333
303
334
## Test the firewall
304
335
305
-
To test the firewall rules, connect a remote desktop using the firewall public IP address, which is NATed to **Srv-Workload-01**. From there, use a browser to test the application rule and connect a remote desktop to **Srv-Workload-02** to test the network rule.
336
+
To test the firewall rules, use Azure Bastion to connect to **Srv-Workload-01** and verify both the application and network rules are working.
306
337
307
338
### Test the application rule
308
339
309
340
Now, test the firewall rules to confirm that it works as expected.
310
341
311
-
1. Connect a remote desktop to firewall public IP address, and sign in.
342
+
1. In the Azure portal, navigate to the **Srv-workload-01** virtual machine.
343
+
1. Select **Connect** > **Connect via Bastion**.
344
+
1. Provide the username **azureuser** and upload the private key `.pem` file that you downloaded when you created the VM.
345
+
1. Select **Connect** to open an SSH session.
346
+
347
+
1. In the SSH session, run the following command to test access to Microsoft:
312
348
313
-
2. Open Internet Explorer and browse to `https://www.microsoft.com`.
314
-
3. Select **OK** > **Close** on the Internet Explorer security alerts.
349
+
```bash
350
+
curl https://www.microsoft.com
351
+
```
315
352
316
-
You should see the Microsoft home page.
353
+
You should see HTML content returned, confirming access is allowed.
317
354
318
-
4. Browse to `https://www.google.com`.
355
+
1. Test access to Google (which should be blocked):
319
356
320
-
The firewall should block this.
357
+
```bash
358
+
curl https://www.google.com
359
+
```
360
+
361
+
The request should timeout or fail, showing the firewall is blocking this site.
321
362
322
363
So now you verified that the firewall application rule is working:
323
364
324
365
* You can browse to the one allowed FQDN, but not to any others.
325
366
326
367
### Test the network rule
327
368
328
-
Now test the network rule.
369
+
Now test the network rule by connecting from **Srv-Workload-01** to **Srv-Workload-02** using SSH and HTTP.
370
+
371
+
1. From the SSH session on **Srv-Workload-01**, note the private IP address of **Srv-Workload-02** (visible in the Azure portal under the VM's networking settings).
372
+
373
+
1. Test SSH connectivity to **Srv-Workload-02**:
374
+
375
+
```bash
376
+
ssh azureuser@<Srv-Workload-02-private-IP>
377
+
```
378
+
379
+
Type `yes` to accept the host key, then enter the connection. You may need to upload the private key for Srv-Workload-02 if using key-based authentication.
380
+
381
+
1. Exit the SSH session to Srv-Workload-02:
382
+
383
+
```bash
384
+
exit
385
+
```
386
+
387
+
1. Test HTTP connectivity to the Nginx web server on **Srv-Workload-02**:
329
388
330
-
- From Srv-Workload-01, open a remote desktop to the Srv-Workload-02 private IP address.
389
+
```bash
390
+
curl http://<Srv-Workload-02-private-IP>
391
+
```
331
392
332
-
A remote desktop should connect to Srv-Workload-02.
393
+
You should see the HTML content `<h1>Srv-workload-02</h1>`, confirming the network rule allows HTTP traffic between spokes.
333
394
334
395
So now you verified that the firewall network rule is working:
335
396
* You can connect a remote desktop to a server located in another virtual network.
0 commit comments