geo Match Statement
Parameters
A rule statement that labels web requests by country and region and that matches against web requests based on country code. A geo match rule labels every request that it inspects regardless of whether it finds a match.
To manage requests only by country, you can use this statement by itself and specify the countries that you want to match against in the
CountryCodes
array.Otherwise, configure your geo match rule with Count action so that it only labels requests. Then, add one or more label match rules to run after the geo match rule and configure them to match against the geographic labels and handle the requests as needed. AWS WAF labels requests using the alpha-2 country and region codes from the International Organization for Standardization (ISO) 3166 standard. AWS WAF determines the codes using either the IP address in the web request origin or, if you specify it, the address in the geo match
ForwardedIPConfig
. If you use the web request origin, the label formats areawswaf:clientip:geo:region:<ISO country code>-<ISO region code>
andawswaf:clientip:geo:country:<ISO country code>
. If you use a forwarded IP address, the label formats areawswaf:forwardedip:geo:region:<ISO country code>-<ISO region code>
andawswaf:forwardedip:geo:country:<ISO country code>
. For additional details, see Geographic match rule statement in the AWS WAF Developer Guide .
Parameters
A rule statement that labels web requests by country and region and that matches against web requests based on country code. A geo match rule labels every request that it inspects regardless of whether it finds a match.
To manage requests only by country, you can use this statement by itself and specify the countries that you want to match against in the
CountryCodes
array.Otherwise, configure your geo match rule with Count action so that it only labels requests. Then, add one or more label match rules to run after the geo match rule and configure them to match against the geographic labels and handle the requests as needed. AWS WAF labels requests using the alpha-2 country and region codes from the International Organization for Standardization (ISO) 3166 standard. AWS WAF determines the codes using either the IP address in the web request origin or, if you specify it, the address in the geo match
ForwardedIPConfig
. If you use the web request origin, the label formats areawswaf:clientip:geo:region:<ISO country code>-<ISO region code>
andawswaf:clientip:geo:country:<ISO country code>
. If you use a forwarded IP address, the label formats areawswaf:forwardedip:geo:region:<ISO country code>-<ISO region code>
andawswaf:forwardedip:geo:country:<ISO country code>
. For additional details, see Geographic match rule statement in the AWS WAF Developer Guide .