I'm looking into developing a system via Google's App Engine for PHP. I'm now pretty well underway, but realized that I don't know a good way to deny incoming traffic from countries known for their nefarious inhabitants.
On other sites, I just block subnets via .htaccess. However, I'm now beginning to think it's impossible outside of using Google's own PHP request header designating the country code.
See their doc here: https://developers.google.com/appengine/docs/php/
It would be easy to just block it that way, but I'm not sure this would be the optimal way.
Any insight would be appreciated.
In addition to the DOS attack protection mentioned in @rudolph1024's answer it is now possible to enable a fully-featured firewall (still beta, recently released) to protect your GAE application.
From App Engine firewall:
The firewall appears to be intended to replace the DOS protection. From Denial of service (DoS) protection service:
You still need to collect the IP ranges for the country in your particular case, to configure the firewall.
You can use the
dos.yaml
file to blacklist subnets. You create ados.yaml
file in the root directory of your application and then block IPs or entire subnets as specified here. Note that this file is limited to a maximum of 100 entries.Once you have a list of country subnets which you wish to block (which you could obtain from a list like this or this), you can populate the
dos.yaml
file manually. Alternatively, you can use a script like this one to populate the file.