2

is there a way to geo block China from connecting my GCP VMs?

I see this item in my billing:

Network Internet Egress from Americas to China

Can I block the whole lot?

Is there a way to investigate what kind of IPs are connecting? (I know you can add logging rules to the GCP firewall but I am fuzzy on the details)..

If none of the above possible - is there a public list of rules for Linux firewalls (CentOS 8) to block IPs by countries?

3 Answers3

1

You can use Cloud Armor Network Security ($$$), or opt to download all the IP addresses/rages for China (using a country IP database range provider (many on the internet)) and deny all the source IP ranges using a GCP VPC firewall rule or policy (FREE). Both options are very simple to do.

1

You can now do this with a firewall rule in the firewall policies that were introduced with the release of GCP Next Generation Firewall (NGFW). No need to manually maintain ip lists.

firewall rule by geolocation