/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the wafv2-2019-07-29.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.WAFV2.Model
{
///
/// 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.
///
///
///
/// WAF labels requests using the alpha-2 country and region codes from the International
/// Organization for Standardization (ISO) 3166 standard. 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 are awswaf:clientip:geo:region:<ISO
/// country code>-<ISO region code>
and awswaf:clientip:geo:country:<ISO
/// country code>
.
///
///
///
/// If you use a forwarded IP address, the label formats are awswaf:forwardedip:geo:region:<ISO
/// country code>-<ISO region code>
and awswaf:forwardedip:geo:country:<ISO
/// country code>
.
///
///
///
/// For additional details, see Geographic
/// match rule statement in the WAF
/// Developer Guide.
///
///
public partial class GeoMatchStatement
{
private List _countryCodes = new List();
private ForwardedIPConfig _forwardedIPConfig;
///
/// Gets and sets the property CountryCodes.
///
/// An array of two-character country codes that you want to match against, for example,
/// [ "US", "CN" ]
, from the alpha-2 country ISO codes of the ISO 3166 international
/// standard.
///
///
///
/// When you use a geo match statement just for the region and country labels that it
/// adds to requests, you still have to supply a country code for the rule to evaluate.
/// In this case, you configure the rule to only count matching requests, but it will
/// still generate logging and count metrics for any matches. You can reduce the logging
/// and metrics that the rule produces by specifying a country that's unlikely to be a
/// source of traffic to your site.
///
///
[AWSProperty(Min=1)]
public List CountryCodes
{
get { return this._countryCodes; }
set { this._countryCodes = value; }
}
// Check to see if CountryCodes property is set
internal bool IsSetCountryCodes()
{
return this._countryCodes != null && this._countryCodes.Count > 0;
}
///
/// Gets and sets the property ForwardedIPConfig.
///
/// The configuration for inspecting IP addresses in an HTTP header that you specify,
/// instead of using the IP address that's reported by the web request origin. Commonly,
/// this is the X-Forwarded-For (XFF) header, but you can specify any header name.
///
///
///
/// If the specified header isn't present in the request, WAF doesn't apply the rule to
/// the web request at all.
///
///
///
public ForwardedIPConfig ForwardedIPConfig
{
get { return this._forwardedIPConfig; }
set { this._forwardedIPConfig = value; }
}
// Check to see if ForwardedIPConfig property is set
internal bool IsSetForwardedIPConfig()
{
return this._forwardedIPConfig != null;
}
}
}