Study guide

5.5 Secure RDP Access, Remote Desktop Gateway & Azure Bastion

Administering Windows Server Hybrid Core Infrastructure AZ-800

Track your progress as you read

Finished sections get a check mark.

1 Introduction & Exam Overview

About Exam AZ-800: Format, Scoring & the September 2026 Retirement

2 Chapter 1: Active Directory Domain Services Architecture & Deployment

1.1 Deploying & Managing Domain Controllers On-Premises 1.2 Domain Controllers in Azure IaaS & Virtualized DC Cloning 1.3 Read-Only Domain Controllers (RODCs) & Password Replication Policies 1.4 Flexible Single Master Operation (FSMO) Roles & Troubleshooting 1.5 Active Directory Sites, Subnets & Site Link Topology 1.6 AD DS Replication: Topology Generation, Convergence & Diagnostics 1.7 Forest and Domain Trust Relationships

3 Chapter 2: AD DS Security Principals, Service Accounts & Domain Join

2.1 Managing Users, Groups & Objects in Multi-Domain and Multi-Forest Environments 2.2 Service Account Types & Group Managed Service Accounts (gMSA) 2.3 Joining Windows Server to AD DS, Microsoft Entra Domain Services & Microsoft Entra ID 2.4 Creating & Managing Users, Groups and Organizational Units at Scale

4 Chapter 3: Hybrid Identity & Microsoft Entra Integration

3.1 Microsoft Entra Connect Sync Architecture, Installation & Filtering 3.2 SourceAnchor, Synchronization Rules & Microsoft Entra Connect Health 3.3 Microsoft Entra Cloud Sync & Disconnected Multi-Forest Topologies 3.4 Hybrid Authentication Methods & Staged Rollout 3.5 Microsoft Entra Domain Services 3.6 Integrating Microsoft Entra ID, AD DS & Entra Domain Services: Choosing an Architecture

5 Chapter 4: Group Policy in AD DS and Hybrid Environments

4.1 Group Policy Architecture & Processing Order (LSDOU) 4.2 Group Policy Filtering, Loopback Processing & Client-Side Extensions 4.3 Group Policy Preferences, Item-Level Targeting & Central Store 4.4 Group Policy in Microsoft Entra Domain Services & Fine-Grained Password Policies

6 Chapter 5: Remote Server Management in Hybrid Environments

5.1 Windows Admin Center (WAC) Deployment On-Premises and in Azure 5.2 PowerShell Remoting, WinRM & the Kerberos Double-Hop Problem 5.3 Just Enough Administration (JEA) for Constrained PowerShell Endpoints 5.4 OpenSSH on Windows Server & PowerShell Remoting over SSH 5.5 Secure RDP Access, Remote Desktop Gateway & Azure Bastion

7 Chapter 6: Hybrid Management with Azure Arc and Azure Services

6.1 Azure Arc-Enabled Servers Architecture & Onboarding 6.2 Azure Machine Configuration & VM Extensions on Arc Servers 6.3 Azure Update Manager: Assessment, Maintenance Configurations & Dynamic Scoping 6.4 Azure Automation for Hybrid Workloads: Runbooks & Hybrid Runbook Workers

8 Chapter 7: Hyper-V Virtualization & Virtual Machine Configuration

7.1 Hyper-V Type 1 Architecture, Installation & Hardware Prerequisites 7.2 VM Generations, Secure Boot, vTPM, Enhanced Session Mode & Direct VM Access 7.3 Compute, Dynamic Memory & Hardware Acceleration 7.4 VM Resource Controls, CPU Groups & Host Compute Partitioning 7.5 Hyper-V Virtual Hard Disks & Checkpoint Management 7.6 Hyper-V Virtual Switches, NIC Teaming & Switch Embedded Teaming (SET) 7.7 Integration Services, Guest Components & Time Synchronization

9 Chapter 8: Hyper-V High Availability, Security & Containers

8.1 Hyper-V Failover Clustering & Cluster Shared Volumes (CSV) 8.2 Hyper-V Replica & Azure Site Recovery (ASR) 8.3 Guarded Fabric & Shielded Virtual Machines 8.4 Windows Server Container Hosts, Isolation Models & Images 8.5 Managing Container Instances & Linux Containers with WSL 8.6 Windows Container Networking & AKS Enabled by Azure Arc 8.7 Managing Container Images, Tags & Azure Container Registry

10 Chapter 9: Azure IaaS Virtual Machine Administration

9.1 Azure VM Sizing, Series Selection & Managed Disk Tiers 9.2 Azure VM Host Caching, Disk Bursting, Ephemeral OS Disks & Disk Operations 9.3 Azure VM High Availability: Availability Sets, Zones & Proximity Placement Groups 9.4 Virtual Machine Scale Sets, Autoscale & Azure Dedicated Hosts 9.5 Azure VM Networking, NSGs & Connectivity

11 Chapter 10: Hybrid DNS Infrastructure & Name Resolution

10.1 Active Directory-Integrated DNS Architecture, Dynamic Updates & Zone Types 10.2 DNS Records, Aging & Scavenging and the GlobalNames Zone 10.3 DNS Forwarding, Conditional Forwarding & Azure DNS Zone Integration 10.4 Hybrid Name Resolution with Azure DNS Private Resolver 10.5 Windows Server DNS Policies & DNSSEC

12 Chapter 11: IP Addressing, DHCP & IPAM Management

11.1 DHCP Server Role, the DORA Lifecycle & Active Directory Authorization 11.2 DHCP Scopes, Option Hierarchy, Reservations & Relay Agents 11.3 DHCP High Availability & Failover Configurations 11.4 IP Address Management (IPAM) Deployment & Auditing 11.5 Resolving IP Address Issues in Hybrid Environments

13 Chapter 12: Hybrid Network Connectivity, Remote Access & Private Access

12.1 Remote Access Role, VPN Protocols & Site-to-Site VPN to Azure 12.2 Network Policy and Access Services (NPAS), RADIUS & Policy Processing 12.3 Azure Network Adapter & Azure Extended Network 12.4 Web Application Proxy & Microsoft Entra Application Proxy 12.5 Microsoft Entra Private Access & Global Secure Access 12.6 Azure Relay & Hybrid Connections

14 Chapter 13: File Services, DFS, SMB & Azure File Sync

13.1 Windows Server File Share Access, NTFS Permissions & Access-Based Enumeration 13.2 File Server Resource Manager: Quotas, File Screens & Storage Reports 13.3 DFS Namespaces (DFS-N) & DFS Replication (DFS-R) 13.4 BranchCache: Distributed Cache and Hosted Cache Modes 13.5 Modern SMB Protocols, SMB Multichannel & SMB over QUIC 13.6 Azure File Shares, Tiers & Hybrid Permissions 13.7 Azure File Sync, Cloud Tiering & Monitoring 13.8 Migrating DFS Namespaces & DFS Replication to Azure File Sync

15 Chapter 14: Windows Server Storage Infrastructure & High Availability

14.1 Disk Partitioning, Volumes & Enterprise File Systems (NTFS vs ReFS) 14.2 Data Deduplication Architecture, Usage Types & Management 14.3 Storage Spaces & Storage Spaces Direct (S2D) 14.4 Storage Replica & Storage Quality of Service 14.5 iSCSI Target Server, IQNs, CHAP Authentication & Multipath I/O

5.5 Secure RDP Access, Remote Desktop Gateway & Azure Bastion

Key Takeaways Explain This Topic AI

Standard Remote Desktop Protocol (RDP) on TCP 3389 should never be exposed directly to the public internet; Network Level Authentication (NLA) enforces CredSSP pre-authentication before allocating server resources to prevent denial-of-service and unauthorized session hijacking.

Remote Desktop Gateway (RD Gateway) encapsulates RDP within secure HTTPS tunnels (TCP 443 and UDP 3391), enforcing fine-grained perimeter control through RD Connection Authorization Policies (RD CAPs: identity/auth) and RD Resource Authorization Policies (RD RAPs: target computers).

Azure Bastion provides a fully managed Platform-as-a-Service (PaaS) bastion proxy inside a dedicated AzureBastionSubnet (/26 minimum recommended), delivering agentless, browser-based HTML5 RDP and SSH over TLS 443 without requiring public IP addresses on target Azure VMs.

Azure Bastion Standard and Premium SKUs unlock critical enterprise management capabilities: host scaling up to 50 units, native client connectivity via Azure CLI (az network bastion rdp), Bastion Shareable Links, and IP-based connection to on-premises hybrid resources over ExpressRoute/VPN.

Just-in-Time (JIT) VM Access via Microsoft Defender for Cloud locks down management ports (3389, 22) in Network Security Groups (NSGs) by default and dynamically injects time-limited (default 3 hours), source IP-restricted allow rules upon authorized administrative request.

Last updated: August 2026

Secure RDP Access, Remote Desktop Gateway & Azure Bastion

Interactive graphical management remains an essential requirement for Windows Server administration, specialized application maintenance, and emergency troubleshooting. However, exposing the standard Remote Desktop Protocol (RDP) directly across untrusted networks or the public internet represents one of the most severe attack vectors in enterprise IT, frequently leading to credential brute-forcing, ransomware deployment, and remote code execution exploits.

Securing hybrid enterprise access demands a layered defense-in-depth architecture incorporating Network Level Authentication (NLA) , perimeter Remote Desktop Gateway (RD Gateway) servers, fully managed Azure Bastion PaaS proxies, and automated Just-in-Time (JIT) VM Access orchestrated by Microsoft Defender for Cloud.

1. RDP Security Baseline & Network Level Authentication (NLA)

Standard RDP operates over TCP port 3389 (with optional UDP 3389 for RemoteFX streaming optimizations). In legacy implementations, a server accepted the TCP connection and initialized the full graphical subsystem (Winlogon desktop) before prompting the connecting client for credentials, exposing the server to severe memory exhaustion and pre-authentication exploits. +-----------------------------------------------------------------------------------------+

  • | NETWORK LEVEL AUTHENTICATION (NLA) WORKFLOW |
  • | |
  • | [RDP Client] [Target Windows Server] |
  • | | | |
  • | | 1. Initiates CredSSP Handshake (TCP 3389) | |
  • | |---------------------------------------------------------------->| |
  • | | | |
  • | | 2. Client authenticates via Kerberos / TLS (Pre-Auth) | |
  • | |<===============================================================>| |
  • | | | |
  • | | [Authentication Evaluated BEFORE Spawning RDP Session / RAM] | |
  • | | | |
  • | | 3. Successful Auth -> Spawns Winlogon / Desktop Session | |
  • | |<----------------------------------------------------------------| |
  • | | (If Auth Fails: Connection Terminated with ZERO OS Overhead) | |
  • +-----------------------------------------------------------------------------------------+

Network Level Authentication (NLA) Mechanics:

CredSSP Pre-Authentication: NLA utilizes the Credential Security Support Provider (CredSSP) protocol to authenticate user credentials before the server establishes a full Remote Desktop session or renders the Windows logon screen.

Resource Protection: Because unauthenticated requests are rejected during the initial cryptographic handshake, the host server consumes negligible CPU and RAM, mitigating RDP Denial-of-Service (DoS) and automated port-scanning attacks.

Enforcing NLA via Group Policy:

Path: Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Security

Setting: Require user authentication for remote connections by using Network Level Authentication -> Enabled . # Enforce Network Level Authentication via PowerShell Registry Modification

  • Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' `
  • Name "UserAuthentication" -Value 1 -Force
  • # Enable Remote Desktop in Windows Defender Firewall
  • Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
  • 2. Remote Desktop Gateway (RD Gateway) Architecture

For on-premises data centers and private cloud environments, Remote Desktop Gateway (RD Gateway) provides secure perimeter RDP encapsulation, allowing external remote administrators to connect securely to internal network servers without establishing a full virtual private network (VPN) tunnel. +-----------------------------------------------------------------------------------------+

  • | RD GATEWAY PERIMETER TUNNELING TOPOLOGY |
  • | |
  • | [External Remote Admin] |
  • | - Runs: mstsc.exe |
  • | | |
  • | | HTTPS Tunnel: TCP 443 (Control) & UDP 3391 (Data) |
  • | | Encrypted with Public CA SSL/TLS Certificate |
  • | v |
  • | +-----------------------------------------------------------------------------------+ |
  • | | PERIMETER DMZ: RD GATEWAY SERVER | |
  • | | | |
  • | | +-----------------------------------------------------------------------------+ | |
  • | | | [1. RD Connection Authorization Policy (RD CAP)] | | |
  • | | | - WHO can connect? (e.g., CORP\RemoteAdmins Group) | | |
  • | | | - Auth Method: Password + Smart Card / RADIUS MFA (NPS Extension) | | |
  • | | +-----------------------------------------------------------------------------+ | |
  • | | | | |
  • | | v Passes CAP Validation | |
  • | | +-----------------------------------------------------------------------------+ | |
  • | | | [2. RD Resource Authorization Policy (RD RAP)] | | |
  • | | | - WHAT computers can be targeted? (e.g., CORP\Tier1-Servers Computer Group) | | |
  • | | | - Allowed Ports: Port 3389 Only | | |
  • | | +-----------------------------------------------------------------------------+ | |
  • | +-----------------------------------------------------------------------------------+ |
  • | | |
  • | | Standard Internal RDP (TCP 3389) |
  • | v |
  • | [Internal Datacenter Servers (Private LAN)] |
  • +-----------------------------------------------------------------------------------------+
  • RD CAP vs. RD RAP Policies

Policy Type Full Name Primary Evaluation Scope Key Configuration Parameters

RD CAP RD Connection Authorization Policy WHO is connecting? - User group membership (e.g., CORP\SecOps-Admins ); - Authentication method (Password, Smart Card); - Device redirection policies (clipboard, drives, printers); - Session timeout limits

RD RAP RD Resource Authorization Policy WHAT can they access? - Target computer group membership (e.g., CORP\Domain-Controllers ); - Allowed destination ports (default TCP 3389 or custom ports)

Important

The CAP + RAP Two-Key Rule: To establish an RDP session through an RD Gateway, a connecting client must satisfy BOTH an RD CAP and an RD RAP. If the user passes the RD CAP (valid identity and MFA) but requests a server not authorized in any matching RD RAP, the gateway immediately terminates the connection.

3. Azure Bastion: Architecture, Sizing & SKU Tiers

Azure Bastion is a fully managed Platform-as-a-Service (PaaS) service deployed directly inside an Azure Virtual Network (VNet). It delivers secure, seamless RDP and SSH connectivity to Azure virtual machines directly through the Azure Portal via an HTML5 browser session or via native client tooling over TLS port 443 .

Loading diagram... Azure Bastion Hybrid Network Architecture & VNet Peering

Azure Bastion SKU Capability Matrix

  • Feature Dimension Developer SKU Basic SKU Standard SKU Premium SKU
  • Deployment Model Shared multi-tenant pool Dedicated PaaS host Dedicated PaaS host Dedicated PaaS host

Dedicated Subnet Required No ( AzureBastionSubnet not needed) Yes ( AzureBastionSubnet min /26 ) Yes ( AzureBastionSubnet min /26 ) Yes ( AzureBastionSubnet min /26 )

Supported Protocols Browser RDP / SSH Browser RDP / SSH Browser RDP / SSH Browser RDP / SSH

Host Unit Scaling Fixed (1 instance) Fixed (2 instances) Manual / Auto-scale (2 to 50 units) Manual / Auto-scale (2 to 50 units)

  • Native Client Support ( az ) No No Yes ( az network bastion rdp/ssh ) Yes ( az network bastion rdp/ssh )
  • Bastion Shareable Links No No Yes (Direct URL without portal login) Yes
  • IP-Based Hybrid Connection No No Yes (Manage on-premises/cross-cloud VMs) Yes
  • Session Recording No No No Yes (Audits all graphical sessions)

VNet Peering Support Single VNet only Hub-and-Spoke Peered VNets Hub-and-Spoke Peered VNets Hub-and-Spoke Peered VNets

Subnet & Network Security Group (NSG) Rules for Azure Bastion:

Subnet Naming: The dedicated subnet MUST be named exactly AzureBastionSubnet .

Subnet Sizing: Microsoft recommends a subnet prefix of /26 or larger ( /25 , /24 ) to accommodate host autoscaling (each host unit provisions internal proxy VMs).

Mandatory Inbound NSG Rules on AzureBastionSubnet :

  • Port 443 Inbound from Internet (Target: * , Protocol: TCP )
  • Port 443 Inbound from GatewayManager service tag
  • Port 443 / 4443 Inbound from VirtualNetwork service tag (Internal data plane)

Mandatory Outbound NSG Rules on AzureBastionSubnet :

  • Port 3389 / 22 Outbound to VirtualNetwork (Target VMs)
  • Port 443 Outbound to AzureCloud service tag

Native Client Connectivity via Azure CLI:

With Azure Bastion Standard or Premium SKU , administrators can bypass the web browser and launch native local client applications ( mstsc.exe for RDP or native SSH) tunneled securely through Bastion over port 443: # Log in to Azure and tunnel native RDP session through Azure Bastion

  • az login
  • az network bastion rdp \
  • -name "vnet-hub-bastion" \
  • -resource-group "rg-networking-prod" \

--target-resource-id "/subscriptions/.../resourceGroups/rg-compute/providers/Microsoft.Compute/virtualMachines/AZ-DC01"

4. Just-in-Time (JIT) VM Access with Microsoft Defender for Cloud

Just-in-Time (JIT) VM Access is a cloud security feature provided by Microsoft Defender for Cloud (Defender for Servers Plan 2) that eliminates persistent management port exposure on Azure IaaS virtual machines. +-----------------------------------------------------------------------------------------+

  • | JUST-IN-TIME (JIT) ACCESS LIFECYCLE |
  • | |
  • | [BASELINE: All Management Ports LOCKED] |
  • | - NSG Rule Priority 4096: DenyAllInbound (Ports 3389, 22, 5985, 5986 Closed) |
  • | | |
  • | v |
  • | [STEP 1: REQUEST] Admin requests JIT access via Azure Portal / Azure CLI / PowerShell |
  • | - Target VM: AZ-APP01 | Port: 3389 | Duration: 3 Hours | Source IP: My IP (Caller) |
  • | | |
  • | v Evaluates Azure RBAC Permissions |
  • | [STEP 2: NSG ELEVATION] Microsoft Defender for Cloud Injects High-Priority NSG Rule |
  • | - Rule Priority 100: AllowInbound RDP 3389 from Caller Public IP ONLY |
  • | | |
  • | v Administrator connects via RDP |
  • | [STEP 3: AUTO-EXPIRATION] Time Window Closes (3 Hours Elapsed) |
  • | - Defender for Cloud automatically purges Priority 100 NSG rule |
  • | - Inbound port 3389 returns to blocked state |
  • +-----------------------------------------------------------------------------------------+

Core Mechanics of JIT VM Access:

Management Port Lockdown: When JIT is activated on a virtual machine, Defender for Cloud inspects the VM's Network Security Group (NSG) and creates an explicit Deny rule for inbound management ports (TCP 3389 for RDP, TCP 22 for SSH, TCP 5985/5986 for WinRM).

On-Demand Rule Injection: When an authorized user requests access, Defender for Cloud evaluates their Azure RBAC permissions (requiring Microsoft.Security/locations/jitNetworkAccessPolicies/initiate/action ). Upon approval, Defender for Cloud dynamically provisions an Allow NSG rule with a high priority (e.g., Priority 100) that permits traffic:

Only to the requested port.

Only from the requester's specific source IP address (or specified CIDR range).

Only for the approved duration (default 3 hours , configurable between 1 and 24 hours).

Automatic Revocation: Once the approved duration expires, Defender for Cloud automatically deletes the temporary Allow NSG rule, returning the VM to a locked state without requiring manual intervention.

Requesting JIT Access via Azure PowerShell: # Request on-demand RDP JIT access for 3 hours restricted to the current caller public IP

  • $JITParams = @{
  • ResourceGroupName = 'rg-compute-prod'
  • Location = 'eastus'
  • VMName = 'AZ-SQL-01'
  • Port = '3389'
  • Duration = 'PT3H'
  • AllowedSourceAddressPrefix = '198.51.100.25/32'
  • }

Start-AzJitNetworkAccessPolicy -ResourceId "/subscriptions/.../providers/Microsoft.Security/locations/eastus/jitNetworkAccessPolicies/default" `

  • VirtualMachine $JITParams
  • 5. Hybrid Remote Access Architectural Decision Matrix

Selecting the appropriate remote management technology depends on network topology, security compliance mandates, and operational tooling requirements.

Operational Requirement Primary Solution Key Architectural Justification

Managing Azure VMs without public IPs or client VPNs Azure Bastion Fully managed PaaS proxy running in AzureBastionSubnet ; browser HTML5 or native CLI over port 443.

Managing on-premises servers across perimeter firewalls RD Gateway Encapsulates RDP inside HTTPS (443/3391); enforces granular identity/device policies via RD CAPs and RD RAPs.

Automated, time-bounded access to public/hybrid VMs JIT VM Access Defender for Cloud dynamically opens NSG ports for approved source IPs with auto-revocation.

GUI management of headless Server Core / Azure Stack HCI Windows Admin Center Agentless browser-based portal over WinRM; integrates natively with Azure Arc and Entra ID RBAC.

Non-admin delegated single-task operations Just Enough Admin (JEA) Enforces No-Language mode, command whitelisting (.psrc), and local Virtual Account elevation (.pssc).