The App Engine firewall

Perhaps the simplest method to secure App Engine services is through the use of firewall rules. The App Engine Firewall allows developers to define up to 1,000 unique firewall rules over which IP address ranges may or may not access services for a given application. These firewall rules may be configured within the Google Cloud Console under Navigation menu | App Engine | Firewall rules. Each rule definition includes the following components:

  • PriorityA numerical value (1-2,147,483,646) denoting the order in which rules should be applied. Lower values are evaluated first and override any higher-priority rules.
  • Action on matchAllow or deny. An allow action will permit traffic from the specified IP range, while deny actions will block traffic.
  • IP Range: The range of IP addresses this rule should apply to, provided in CIDR notation.
  • DescriptionA simple description to help keep track of firewall rules.

By combining multiple rules, teams may create complex firewall strategies. In the event of conflicting rules, the rule with a lower priority will win. The App Engine Firewall includes a default rule, which is applied after all other rules with a priority of 2,147,483,647. By default, this rule allows all traffic. For teams that want to permit only certain IP ranges, it's a good idea to set this default rule to deny.