Description:
Remote Desktop Protocol (RDP) is a commonly used protocol for managing Windows-based servers and virtual machines. However, exposing RDP (port 3389) to the internet can significantly increase the risk of attacks such as brute-force attempts and unauthorized access. Evaluating and restricting RDP access from the internet ensures that only authorized users from trusted sources can access virtual machines (VMs) using RDP.
This can be achieved by configuring Network Security Groups (NSGs), Azure Firewall, and enabling Just-in-Time (JIT) access for RDP, as well as restricting RDP access based on IP addresses, regions, or trusted sources.
Rationale:
RDP access from the internet exposes your VMs to various threats, including brute-force attacks or exploitation of known vulnerabilities. By restricting RDP access to specific IP ranges, trusted users, or using JIT access, you minimize the attack surface and prevent unauthorized access. This approach helps in meeting security best practices and compliance requirements.
Impact:
Enabling RDP access restrictions significantly improves the security of your resources. However, it may cause challenges for legitimate users who need to access VMs remotely. Therefore, access should be carefully configured, ensuring only necessary users and sources can connect. Just-in-Time (JIT) access provides a secure way to temporarily enable RDP access when needed.
Default Value:
By default, RDP access (port 3389) is allowed unless restricted by Network Security Groups (NSGs) or Azure Firewall.
Pre-requisites:
Azure subscription.
Network Security Groups (NSGs) or Azure Firewall configured.
Virtual Machines with RDP enabled.
Just-in-Time (JIT) VM Access should be enabled for better control over RDP access.
Owner, Contributor, or Network Contributor role permissions.
Audit:
Sign in to Azure portal as an Owner, Contributor, or Network Contributor.
Navigate to Network Security Groups (NSGs) or Azure Firewall.
Verify that RDP access is properly evaluated and restricted based on security policies.
Implementation steps:
Sign in to Azure portal:
Use an account with Owner, Contributor, or Network Contributor permissions.
Navigate to Network Security Groups (NSGs):
In the Azure portal, go to Network Security Groups (NSGs).
Review the Inbound security rules for RDP (port 3389) and restrict access to trusted IP addresses only.
Restrict RDP Access Using NSGs:
Create an NSG rule that allows RDP access (port 3389) from only trusted IPs (e.g., specific IP address ranges, subnets, or VPNs).
Deny RDP access from all other sources.
Use Azure Firewall to Restrict RDP Access:
Azure Firewall can be used to enforce RDP access restrictions.
Create a Firewall policy that only allows RDP traffic from trusted IPs or VPN connections.
Enable Just-in-Time (JIT) VM Access for RDP:
JIT VM Access allows you to enable RDP access temporarily and securely.
Navigate to Azure Security Center and enable JIT VM Access for the VMs that require RDP access.
JIT access will automatically modify NSG rules to allow RDP access only for the duration specified.
Monitor RDP Access with Azure Monitor:
Use Azure Monitor and Network Watcher to monitor RDP traffic to your VMs.
Set up alerts to notify administrators when there is an unauthorized attempt to access a VM via RDP.
Automate RDP Access Restriction with Azure Policy:
Use Azure Policy to enforce RDP access restrictions across your Azure environment.
Test and Verify:
After configuring the RDP access restriction, test to ensure that only trusted IP ranges can connect via RDP to your VMs.
Try connecting via RDP from an untrusted IP to confirm that access is denied.
Review and Adjust:
Regularly review NSG rules, Firewall policies, and JIT access configurations to ensure that RDP access is restricted and only authorized users are allowed access.
Backout Plan (Automated):
Sign in to Azure portal:
Use an account with Owner, Contributor, or Network Contributor permissions.
Navigate to NSGs or Azure Firewall:
Go to Network Security Groups (NSGs) or Azure Firewall.
Remove or Revert RDP Access Restrictions:
In NSGs, remove or adjust the rules that restrict RDP access.
In Azure Firewall, remove or revert the RDP rules that restrict traffic.
Revert Just-in-Time (JIT) Access:
If JIT VM Access was used, disable or adjust the JIT settings for the VM.
Verify Reverted Configuration:
Test to ensure that RDP access is no longer restricted and that the access controls are functioning as expected.
Monitor Access Logs:
Use Azure Monitor to ensure that the previous RDP restrictions are not being enforced after the backout.