The Cybermatic Signal · Fix-it Guides · Cloud · Google Cloud
← All guides · Time to fix: 20 minutes once, per project · Google Cloud
A Google Cloud VPC firewall rule that allows 0.0.0.0/0 on port 22 or 3389 means every VM it covers is reachable by anyone on the internet for brute-force login attempts. This affects any project that was set up quickly, inherited a default rule, or had a rule added for temporary access that was never removed. The fix takes about 20 minutes once you have confirmed IAP is working.
The fix, verified
RDP or SSH open to the internet in a VPC firewall rule
| Severity | critical · Google Cloud |
| Where to click | Google Cloud console → VPC network → Firewall → the rule → Edit: replace 0.0.0.0/0 with your office range, or delete the rule and use IAP TCP forwarding (Identity-Aware Proxy) for SSH/RDP. |
| Or run | gcloud compute firewall-rules delete RULE-NAME |
| Before you do | Enable IAP TCP forwarding and test a connection before deleting the rule. |
| Maps to | CIS GCP 3.6-3.7SOC2 CC6.6 |
VPC firewall rules control which traffic can reach your Compute Engine VMs. A rule with source range 0.0.0.0/0 on TCP port 22 (SSH) or 3389 (RDP) means the rule matches traffic from every IP address on the internet, not just your office. Automated scanners find open ports like these within minutes of a VM starting. A realistic outcome: a developer spins up a VM for a quick test, leaves the default-allow-ssh rule in place, uses a weak password or a key that was previously compromised, and an attacker gets a foothold in your project before the developer circles back to clean up.
Open the Google Cloud console, go to VPC network, then Firewall. Sort or scan the list for rules with Source IP ranges of 0.0.0.0/0 and Protocols/ports that include tcp:22 or tcp:3389. Pay attention to the Targets column — a rule targeting all instances in the network is the most common and most dangerous pattern. You can also run a quick audit from the command line to list every rule that matches:
Review the output for any row showing tcp:22 or tcp:3389 in the allowed column.
The preferred fix is to replace direct internet access with Identity-Aware Proxy (IAP) TCP forwarding, which routes SSH and RDP through Google's infrastructure and enforces your Google Workspace or Cloud Identity access policies. Do this in order:
To delete the rule from the command line once you have confirmed IAP access works:
gcloud compute firewall-rules delete RULE-NAME
If you delete the open rule before confirming IAP works, you can lock yourself out of your VMs. The caution here is not theoretical — serial console access or OS Login recovery takes time and requires additional permissions. Always verify an IAP tunnel connects successfully to at least one VM in the affected target group before removing the old rule. Also check whether any automated deployment pipelines, monitoring agents, or third-party tools connect to your VMs over SSH from external IPs; those will need to be rerouted through IAP or a VPN before you remove the rule. If you have VMs in multiple projects, repeat this check in each project — firewall rules are not shared across projects.
Use an Organization Policy constraint to prevent any project in your org from creating firewall rules with 0.0.0.0/0 on sensitive ports. The constraint compute.restrictCloudArmor does not cover this directly, but you can enforce it with a custom Organization Policy or by running periodic audits with Security Command Center, which flags open firewall rules as a finding under CIS GCP benchmarks 3.6 and 3.7. Set a calendar reminder to re-run the gcloud firewall-rules list filter command monthly, or add it to your change-management checklist so any new rule gets reviewed before it reaches production.
Yes. Projects created with the default network include a rule called default-allow-ssh that permits 0.0.0.0/0 on tcp:22. It is enabled by default and applies to all instances in the network unless you have removed it.
Restricting to a known IP range is better than 0.0.0.0/0 and is a valid short-term fix. IAP is preferred for most teams because it removes the need to update the rule every time your office IP changes and adds an authentication layer on top of the network control.
Yes. You can tunnel RDP through IAP using gcloud compute start-iap-tunnel to forward a local port, then connect your RDP client to localhost on that port. The Google Cloud console also provides a browser-based RDP option for Windows VMs.
Is this open in your environment?
Cybermatic checks for "RDP or SSH open to the internet in a VPC firewall rule" automatically — on every connected account, every day — and shows you the exact fix above next to each one it finds. The free scan takes about ten minutes and needs no credit card.
Run the free scan All guides →Part of The Cybermatic Signal. Written by the Cybermatic editorial agent from the configuration check Cybermatic runs for this setting (ID gcp-open-admin-port) and reviewed before publication. The click path, command and caution in the fix card are the vendor's documented procedure as of 2026-10-28. Found an error? Write to info@cybermatic.ai.
BriefingIssuesFlashGuidesInsurance checkDomain checkSubscribe
Cybermatic.ai by Ironhawk Group · 9330 Lyndon B Johnson Fwy, Suite 900 · Dallas, TX 75243 · Privacy · cybermatic.ai