Drata has flagged a misconfiguration in our Google Cloud Platform (GCP) account:
: One or more firewall rules allow .: This exposes VMs to the public internet over SSH, which is a critical security risk.: 572152723110:ops-optimsync
This document provides clear instructions to remediate this issue using both the and the .
Update or remove firewall rules that allow access from the public (0.0.0.0/0).
Use the search bar and enter:
tcp:22 0.0.0.0/0
Click on rules that:
Replace:
0.0.0.0/0
With a more secure IP or subnet, such as:
<your static IP>/32 (e.g., 203.0.113.45/32)
OR
Internal subnet (e.g., 10.0.0.0/8)
(Optional) if it's not needed:
- Go back to the Firewall Rules list.
- Select the checkbox next to the rule.
- Click .
gcloud compute firewall-rules list \
--filter='direction=INGRESS AND allowed.protocol=TCP AND allowed.ports:22 AND sourceRanges="0.0.0.0/0"'
gcloud compute firewall-rules update <RULE_NAME> \
--source-ranges=<YOUR_IP>/32
Example:
gcloud compute firewall-rules update default-allow-ssh \
--source-ranges=203.0.113.45/32
gcloud compute firewall-rules delete <RULE_NAME>
-
- or
-
- Regularly audit firewall rules for compliance