For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/ansible-gcp-rdp-access-is-not-restricted.md.
A documentation index is available at /llms.txt.
Allowing unrestricted RDP (TCP port 3389) ingress exposes hosts to automated brute-force attacks and unauthorized remote access. This rule inspects Ansible google.cloud.gcp_compute_firewall and gcp_compute_firewall tasks and flags ingress rules whose source_ranges include unrestricted CIDRs (for example 0.0.0.0/0 or ::/0) and whose allowed entries include port 3389 (typically ip_protocol: tcp).
The allowed property must not include port 3389 for rules that permit unrestricted source ranges. Either remove or disable RDP on the firewall, or restrict source_ranges to trusted CIDRs. Consider using a bastion host, VPN, or identity-based access (IAP/SSM) instead of direct RDP. Resources where direction is ingress, source_ranges contains an unrestricted CIDR, and allowed[].ports contains "3389" are flagged.
Secure example that restricts RDP to a corporate CIDR: