Description
This inbound rule allows TCP port 3389 from 0.0.0.0/0 (all IPv4 addresses) or ::/0 (all IPv6 addresses). A matching rule with a lower number takes precedence.
Potential impact
If routing, security groups and the listening service allow access, other sources could also attempt an RDP sign-in.
Remediation
Check the associated subnet’s IPv4 and IPv6 rules. Limit inbound RDP to approved administrator addresses or VPN ranges and allow outbound replies to the required client ports. Test a new connection from an administrator network and verify that a new connection from an unapproved source is blocked.
Examples
The excerpts omit aws_vpc.main, the subnet association and the outbound return rules.
Before
resource "aws_network_acl" "network_acl" {
vpc_id = aws_vpc.main.id
ingress {
protocol = "tcp"
rule_no = 100
action = "allow"
cidr_block = "0.0.0.0/0"
from_port = 3389
to_port = 3389
}
}
Rule 100 allows inbound TCP port 3389 from every IPv4 address.
After
resource "aws_network_acl" "network_acl" {
vpc_id = aws_vpc.main.id
ingress {
protocol = "tcp"
rule_no = 100
action = "allow"
cidr_block = "10.3.0.0/18"
from_port = 3389
to_port = 3389
}
}
Replace the example 10.3.0.0/18 in the ingress block with the range your administrators actually use.