/* * 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 compares a number of bytes against the size of a request component, /// using a comparison operator, such as greater than (>) or less than (<). For /// example, you can use a size constraint statement to look for query strings that are /// longer than 100 bytes. /// /// /// /// If you configure WAF to inspect the request body, WAF inspects only the number of /// bytes of the body up to the limit for the web ACL. By default, for regional web ACLs, /// this limit is 8 KB (8,192 kilobytes) and for CloudFront web ACLs, this limit is 16 /// KB (16,384 kilobytes). For CloudFront web ACLs, you can increase the limit in the /// web ACL AssociationConfig, for additional fees. If you know that the /// request body for your web requests should never exceed the inspection limit, you could /// use a size constraint statement to block requests that have a larger request body /// size. /// /// /// /// If you choose URI for the value of Part of the request to filter on, the slash (/) /// in the URI counts as one character. For example, the URI /logo.jpg is /// nine characters long. /// /// public partial class SizeConstraintStatement { private ComparisonOperator _comparisonOperator; private FieldToMatch _fieldToMatch; private long? _size; private List _textTransformations = new List(); /// /// Gets and sets the property ComparisonOperator. /// /// The operator to use to compare the request part to the size setting. /// /// [AWSProperty(Required=true)] public ComparisonOperator ComparisonOperator { get { return this._comparisonOperator; } set { this._comparisonOperator = value; } } // Check to see if ComparisonOperator property is set internal bool IsSetComparisonOperator() { return this._comparisonOperator != null; } /// /// Gets and sets the property FieldToMatch. /// /// The part of the web request that you want WAF to inspect. /// /// [AWSProperty(Required=true)] public FieldToMatch FieldToMatch { get { return this._fieldToMatch; } set { this._fieldToMatch = value; } } // Check to see if FieldToMatch property is set internal bool IsSetFieldToMatch() { return this._fieldToMatch != null; } /// /// Gets and sets the property Size. /// /// The size, in byte, to compare to the request part, after any transformations. /// /// [AWSProperty(Required=true, Min=0, Max=21474836480)] public long Size { get { return this._size.GetValueOrDefault(); } set { this._size = value; } } // Check to see if Size property is set internal bool IsSetSize() { return this._size.HasValue; } /// /// Gets and sets the property TextTransformations. /// /// Text transformations eliminate some of the unusual formatting that attackers use in /// web requests in an effort to bypass detection. Text transformations are used in rule /// match statements, to transform the FieldToMatch request component before /// inspecting it, and they're used in rate-based rule statements, to transform request /// components before using them as custom aggregation keys. If you specify one or more /// transformations to apply, WAF performs all transformations on the specified content, /// starting from the lowest priority setting, and then uses the component contents. /// /// [AWSProperty(Required=true, Min=1)] public List TextTransformations { get { return this._textTransformations; } set { this._textTransformations = value; } } // Check to see if TextTransformations property is set internal bool IsSetTextTransformations() { return this._textTransformations != null && this._textTransformations.Count > 0; } } }