Description
Allowing TCP 3389 from 0.0.0.0/0 or ::/0 lets any IPv4 or IPv6 client with a route attempt an RDP connection. Windows still authenticates the login.
Potential impact
An externally reachable RDP service can receive sign-in attempts from outside the administration network.
Remediation
Test the VPN or administration host first. Allow TCP 3389 from the administrator range to the required VMs, remove broader rules, then test from an approved and an unapproved source.
Examples
Replace 10.20.0.0/24 with the real administrator range. Both rules omit targets and therefore apply to all VMs in the VPC. When editing an existing rule, retain its Terraform resource address. The two addresses shown use the same cloud rule name.
Before
hcl
resource "google_compute_firewall" "rdp_open" {
name = "test-firewall"
network = google_compute_network.default.name
direction = "INGRESS"
allow {
protocol = "tcp"
ports = ["3389"]
}
source_ranges = ["0.0.0.0/0"]
}
After
hcl
resource "google_compute_firewall" "rdp_restricted" {
name = "test-firewall"
network = google_compute_network.default.name
direction = "INGRESS"
allow {
protocol = "tcp"
ports = ["3389"]
}
source_ranges = ["10.20.0.0/24"]
}