All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.waf.model.XssMatchTuple Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS WAF Service module holds the client classes that are used for communicating with AWS WAF Service

There is a newer version: 2.29.15
Show newest version
/*
 * 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.
 */

package software.amazon.awssdk.services.waf.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 
 * 

* This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the * developer guide. *

*

* For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the * latest version, AWS WAF has a single set of endpoints for regional and global use. *

*
*

* Specifies the part of a web request that you want AWS WAF to inspect for cross-site scripting attacks and, if you * want AWS WAF to inspect a header, the name of the header. *

*/ @Generated("software.amazon.awssdk:codegen") public final class XssMatchTuple implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField FIELD_TO_MATCH_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("FieldToMatch").getter(getter(XssMatchTuple::fieldToMatch)).setter(setter(Builder::fieldToMatch)) .constructor(FieldToMatch::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FieldToMatch").build()).build(); private static final SdkField TEXT_TRANSFORMATION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TextTransformation").getter(getter(XssMatchTuple::textTransformationAsString)) .setter(setter(Builder::textTransformation)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TextTransformation").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FIELD_TO_MATCH_FIELD, TEXT_TRANSFORMATION_FIELD)); private static final long serialVersionUID = 1L; private final FieldToMatch fieldToMatch; private final String textTransformation; private XssMatchTuple(BuilderImpl builder) { this.fieldToMatch = builder.fieldToMatch; this.textTransformation = builder.textTransformation; } /** *

* Specifies where in a web request to look for cross-site scripting attacks. *

* * @return Specifies where in a web request to look for cross-site scripting attacks. */ public final FieldToMatch fieldToMatch() { return fieldToMatch; } /** *

* Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to * bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on FieldToMatch * before inspecting it for a match. *

*

* You can only specify a single type of TextTransformation. *

*

* CMD_LINE *

*

* When you're concerned that attackers are injecting an operating system command line command and using unusual * formatting to disguise some or all of the command, use this option to perform the following transformations: *

*
    *
  • *

    * Delete the following characters: \ " ' ^ *

    *
  • *
  • *

    * Delete spaces before the following characters: / ( *

    *
  • *
  • *

    * Replace the following characters with a space: , ; *

    *
  • *
  • *

    * Replace multiple spaces with one space *

    *
  • *
  • *

    * Convert uppercase letters (A-Z) to lowercase (a-z) *

    *
  • *
*

* COMPRESS_WHITE_SPACE *

*

* Use this option to replace the following characters with a space character (decimal 32): *

*
    *
  • *

    * \f, formfeed, decimal 12 *

    *
  • *
  • *

    * \t, tab, decimal 9 *

    *
  • *
  • *

    * \n, newline, decimal 10 *

    *
  • *
  • *

    * \r, carriage return, decimal 13 *

    *
  • *
  • *

    * \v, vertical tab, decimal 11 *

    *
  • *
  • *

    * non-breaking space, decimal 160 *

    *
  • *
*

* COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. *

*

* HTML_ENTITY_DECODE *

*

* Use this option to replace HTML-encoded characters with unencoded characters. HTML_ENTITY_DECODE * performs the following operations: *

*
    *
  • *

    * Replaces (ampersand)quot; with " *

    *
  • *
  • *

    * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 *

    *
  • *
  • *

    * Replaces (ampersand)lt; with a "less than" symbol *

    *
  • *
  • *

    * Replaces (ampersand)gt; with > *

    *
  • *
  • *

    * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, with the * corresponding characters *

    *
  • *
  • *

    * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, with the * corresponding characters *

    *
  • *
*

* LOWERCASE *

*

* Use this option to convert uppercase letters (A-Z) to lowercase (a-z). *

*

* URL_DECODE *

*

* Use this option to decode a URL-encoded value. *

*

* NONE *

*

* Specify NONE if you don't want to perform any text transformations. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #textTransformation} will return {@link TextTransformation#UNKNOWN_TO_SDK_VERSION}. The raw value returned * by the service is available from {@link #textTransformationAsString}. *

* * @return Text transformations eliminate some of the unusual formatting that attackers use in web requests in an * effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on * FieldToMatch before inspecting it for a match.

*

* You can only specify a single type of TextTransformation. *

*

* CMD_LINE *

*

* When you're concerned that attackers are injecting an operating system command line command and using * unusual formatting to disguise some or all of the command, use this option to perform the following * transformations: *

*
    *
  • *

    * Delete the following characters: \ " ' ^ *

    *
  • *
  • *

    * Delete spaces before the following characters: / ( *

    *
  • *
  • *

    * Replace the following characters with a space: , ; *

    *
  • *
  • *

    * Replace multiple spaces with one space *

    *
  • *
  • *

    * Convert uppercase letters (A-Z) to lowercase (a-z) *

    *
  • *
*

* COMPRESS_WHITE_SPACE *

*

* Use this option to replace the following characters with a space character (decimal 32): *

*
    *
  • *

    * \f, formfeed, decimal 12 *

    *
  • *
  • *

    * \t, tab, decimal 9 *

    *
  • *
  • *

    * \n, newline, decimal 10 *

    *
  • *
  • *

    * \r, carriage return, decimal 13 *

    *
  • *
  • *

    * \v, vertical tab, decimal 11 *

    *
  • *
  • *

    * non-breaking space, decimal 160 *

    *
  • *
*

* COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. *

*

* HTML_ENTITY_DECODE *

*

* Use this option to replace HTML-encoded characters with unencoded characters. * HTML_ENTITY_DECODE performs the following operations: *

*
    *
  • *

    * Replaces (ampersand)quot; with " *

    *
  • *
  • *

    * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 *

    *
  • *
  • *

    * Replaces (ampersand)lt; with a "less than" symbol *

    *
  • *
  • *

    * Replaces (ampersand)gt; with > *

    *
  • *
  • *

    * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, with the * corresponding characters *

    *
  • *
  • *

    * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, with the * corresponding characters *

    *
  • *
*

* LOWERCASE *

*

* Use this option to convert uppercase letters (A-Z) to lowercase (a-z). *

*

* URL_DECODE *

*

* Use this option to decode a URL-encoded value. *

*

* NONE *

*

* Specify NONE if you don't want to perform any text transformations. * @see TextTransformation */ public final TextTransformation textTransformation() { return TextTransformation.fromValue(textTransformation); } /** *

* Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to * bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on FieldToMatch * before inspecting it for a match. *

*

* You can only specify a single type of TextTransformation. *

*

* CMD_LINE *

*

* When you're concerned that attackers are injecting an operating system command line command and using unusual * formatting to disguise some or all of the command, use this option to perform the following transformations: *

*
    *
  • *

    * Delete the following characters: \ " ' ^ *

    *
  • *
  • *

    * Delete spaces before the following characters: / ( *

    *
  • *
  • *

    * Replace the following characters with a space: , ; *

    *
  • *
  • *

    * Replace multiple spaces with one space *

    *
  • *
  • *

    * Convert uppercase letters (A-Z) to lowercase (a-z) *

    *
  • *
*

* COMPRESS_WHITE_SPACE *

*

* Use this option to replace the following characters with a space character (decimal 32): *

*
    *
  • *

    * \f, formfeed, decimal 12 *

    *
  • *
  • *

    * \t, tab, decimal 9 *

    *
  • *
  • *

    * \n, newline, decimal 10 *

    *
  • *
  • *

    * \r, carriage return, decimal 13 *

    *
  • *
  • *

    * \v, vertical tab, decimal 11 *

    *
  • *
  • *

    * non-breaking space, decimal 160 *

    *
  • *
*

* COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. *

*

* HTML_ENTITY_DECODE *

*

* Use this option to replace HTML-encoded characters with unencoded characters. HTML_ENTITY_DECODE * performs the following operations: *

*
    *
  • *

    * Replaces (ampersand)quot; with " *

    *
  • *
  • *

    * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 *

    *
  • *
  • *

    * Replaces (ampersand)lt; with a "less than" symbol *

    *
  • *
  • *

    * Replaces (ampersand)gt; with > *

    *
  • *
  • *

    * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, with the * corresponding characters *

    *
  • *
  • *

    * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, with the * corresponding characters *

    *
  • *
*

* LOWERCASE *

*

* Use this option to convert uppercase letters (A-Z) to lowercase (a-z). *

*

* URL_DECODE *

*

* Use this option to decode a URL-encoded value. *

*

* NONE *

*

* Specify NONE if you don't want to perform any text transformations. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #textTransformation} will return {@link TextTransformation#UNKNOWN_TO_SDK_VERSION}. The raw value returned * by the service is available from {@link #textTransformationAsString}. *

* * @return Text transformations eliminate some of the unusual formatting that attackers use in web requests in an * effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on * FieldToMatch before inspecting it for a match.

*

* You can only specify a single type of TextTransformation. *

*

* CMD_LINE *

*

* When you're concerned that attackers are injecting an operating system command line command and using * unusual formatting to disguise some or all of the command, use this option to perform the following * transformations: *

*
    *
  • *

    * Delete the following characters: \ " ' ^ *

    *
  • *
  • *

    * Delete spaces before the following characters: / ( *

    *
  • *
  • *

    * Replace the following characters with a space: , ; *

    *
  • *
  • *

    * Replace multiple spaces with one space *

    *
  • *
  • *

    * Convert uppercase letters (A-Z) to lowercase (a-z) *

    *
  • *
*

* COMPRESS_WHITE_SPACE *

*

* Use this option to replace the following characters with a space character (decimal 32): *

*
    *
  • *

    * \f, formfeed, decimal 12 *

    *
  • *
  • *

    * \t, tab, decimal 9 *

    *
  • *
  • *

    * \n, newline, decimal 10 *

    *
  • *
  • *

    * \r, carriage return, decimal 13 *

    *
  • *
  • *

    * \v, vertical tab, decimal 11 *

    *
  • *
  • *

    * non-breaking space, decimal 160 *

    *
  • *
*

* COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. *

*

* HTML_ENTITY_DECODE *

*

* Use this option to replace HTML-encoded characters with unencoded characters. * HTML_ENTITY_DECODE performs the following operations: *

*
    *
  • *

    * Replaces (ampersand)quot; with " *

    *
  • *
  • *

    * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 *

    *
  • *
  • *

    * Replaces (ampersand)lt; with a "less than" symbol *

    *
  • *
  • *

    * Replaces (ampersand)gt; with > *

    *
  • *
  • *

    * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, with the * corresponding characters *

    *
  • *
  • *

    * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, with the * corresponding characters *

    *
  • *
*

* LOWERCASE *

*

* Use this option to convert uppercase letters (A-Z) to lowercase (a-z). *

*

* URL_DECODE *

*

* Use this option to decode a URL-encoded value. *

*

* NONE *

*

* Specify NONE if you don't want to perform any text transformations. * @see TextTransformation */ public final String textTransformationAsString() { return textTransformation; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(fieldToMatch()); hashCode = 31 * hashCode + Objects.hashCode(textTransformationAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof XssMatchTuple)) { return false; } XssMatchTuple other = (XssMatchTuple) obj; return Objects.equals(fieldToMatch(), other.fieldToMatch()) && Objects.equals(textTransformationAsString(), other.textTransformationAsString()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("XssMatchTuple").add("FieldToMatch", fieldToMatch()) .add("TextTransformation", textTransformationAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "FieldToMatch": return Optional.ofNullable(clazz.cast(fieldToMatch())); case "TextTransformation": return Optional.ofNullable(clazz.cast(textTransformationAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((XssMatchTuple) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Specifies where in a web request to look for cross-site scripting attacks. *

* * @param fieldToMatch * Specifies where in a web request to look for cross-site scripting attacks. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fieldToMatch(FieldToMatch fieldToMatch); /** *

* Specifies where in a web request to look for cross-site scripting attacks. *

* This is a convenience method that creates an instance of the {@link FieldToMatch.Builder} avoiding the need * to create one manually via {@link FieldToMatch#builder()}. * *

* When the {@link Consumer} completes, {@link FieldToMatch.Builder#build()} is called immediately and its * result is passed to {@link #fieldToMatch(FieldToMatch)}. * * @param fieldToMatch * a consumer that will call methods on {@link FieldToMatch.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #fieldToMatch(FieldToMatch) */ default Builder fieldToMatch(Consumer fieldToMatch) { return fieldToMatch(FieldToMatch.builder().applyMutation(fieldToMatch).build()); } /** *

* Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort * to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on * FieldToMatch before inspecting it for a match. *

*

* You can only specify a single type of TextTransformation. *

*

* CMD_LINE *

*

* When you're concerned that attackers are injecting an operating system command line command and using unusual * formatting to disguise some or all of the command, use this option to perform the following transformations: *

*
    *
  • *

    * Delete the following characters: \ " ' ^ *

    *
  • *
  • *

    * Delete spaces before the following characters: / ( *

    *
  • *
  • *

    * Replace the following characters with a space: , ; *

    *
  • *
  • *

    * Replace multiple spaces with one space *

    *
  • *
  • *

    * Convert uppercase letters (A-Z) to lowercase (a-z) *

    *
  • *
*

* COMPRESS_WHITE_SPACE *

*

* Use this option to replace the following characters with a space character (decimal 32): *

*
    *
  • *

    * \f, formfeed, decimal 12 *

    *
  • *
  • *

    * \t, tab, decimal 9 *

    *
  • *
  • *

    * \n, newline, decimal 10 *

    *
  • *
  • *

    * \r, carriage return, decimal 13 *

    *
  • *
  • *

    * \v, vertical tab, decimal 11 *

    *
  • *
  • *

    * non-breaking space, decimal 160 *

    *
  • *
*

* COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. *

*

* HTML_ENTITY_DECODE *

*

* Use this option to replace HTML-encoded characters with unencoded characters. HTML_ENTITY_DECODE * performs the following operations: *

*
    *
  • *

    * Replaces (ampersand)quot; with " *

    *
  • *
  • *

    * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 *

    *
  • *
  • *

    * Replaces (ampersand)lt; with a "less than" symbol *

    *
  • *
  • *

    * Replaces (ampersand)gt; with > *

    *
  • *
  • *

    * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, with the * corresponding characters *

    *
  • *
  • *

    * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, with the * corresponding characters *

    *
  • *
*

* LOWERCASE *

*

* Use this option to convert uppercase letters (A-Z) to lowercase (a-z). *

*

* URL_DECODE *

*

* Use this option to decode a URL-encoded value. *

*

* NONE *

*

* Specify NONE if you don't want to perform any text transformations. *

* * @param textTransformation * Text transformations eliminate some of the unusual formatting that attackers use in web requests in an * effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on * FieldToMatch before inspecting it for a match.

*

* You can only specify a single type of TextTransformation. *

*

* CMD_LINE *

*

* When you're concerned that attackers are injecting an operating system command line command and using * unusual formatting to disguise some or all of the command, use this option to perform the following * transformations: *

*
    *
  • *

    * Delete the following characters: \ " ' ^ *

    *
  • *
  • *

    * Delete spaces before the following characters: / ( *

    *
  • *
  • *

    * Replace the following characters with a space: , ; *

    *
  • *
  • *

    * Replace multiple spaces with one space *

    *
  • *
  • *

    * Convert uppercase letters (A-Z) to lowercase (a-z) *

    *
  • *
*

* COMPRESS_WHITE_SPACE *

*

* Use this option to replace the following characters with a space character (decimal 32): *

*
    *
  • *

    * \f, formfeed, decimal 12 *

    *
  • *
  • *

    * \t, tab, decimal 9 *

    *
  • *
  • *

    * \n, newline, decimal 10 *

    *
  • *
  • *

    * \r, carriage return, decimal 13 *

    *
  • *
  • *

    * \v, vertical tab, decimal 11 *

    *
  • *
  • *

    * non-breaking space, decimal 160 *

    *
  • *
*

* COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. *

*

* HTML_ENTITY_DECODE *

*

* Use this option to replace HTML-encoded characters with unencoded characters. * HTML_ENTITY_DECODE performs the following operations: *

*
    *
  • *

    * Replaces (ampersand)quot; with " *

    *
  • *
  • *

    * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 *

    *
  • *
  • *

    * Replaces (ampersand)lt; with a "less than" symbol *

    *
  • *
  • *

    * Replaces (ampersand)gt; with > *

    *
  • *
  • *

    * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, with * the corresponding characters *

    *
  • *
  • *

    * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, with the * corresponding characters *

    *
  • *
*

* LOWERCASE *

*

* Use this option to convert uppercase letters (A-Z) to lowercase (a-z). *

*

* URL_DECODE *

*

* Use this option to decode a URL-encoded value. *

*

* NONE *

*

* Specify NONE if you don't want to perform any text transformations. * @see TextTransformation * @return Returns a reference to this object so that method calls can be chained together. * @see TextTransformation */ Builder textTransformation(String textTransformation); /** *

* Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort * to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on * FieldToMatch before inspecting it for a match. *

*

* You can only specify a single type of TextTransformation. *

*

* CMD_LINE *

*

* When you're concerned that attackers are injecting an operating system command line command and using unusual * formatting to disguise some or all of the command, use this option to perform the following transformations: *

*
    *
  • *

    * Delete the following characters: \ " ' ^ *

    *
  • *
  • *

    * Delete spaces before the following characters: / ( *

    *
  • *
  • *

    * Replace the following characters with a space: , ; *

    *
  • *
  • *

    * Replace multiple spaces with one space *

    *
  • *
  • *

    * Convert uppercase letters (A-Z) to lowercase (a-z) *

    *
  • *
*

* COMPRESS_WHITE_SPACE *

*

* Use this option to replace the following characters with a space character (decimal 32): *

*
    *
  • *

    * \f, formfeed, decimal 12 *

    *
  • *
  • *

    * \t, tab, decimal 9 *

    *
  • *
  • *

    * \n, newline, decimal 10 *

    *
  • *
  • *

    * \r, carriage return, decimal 13 *

    *
  • *
  • *

    * \v, vertical tab, decimal 11 *

    *
  • *
  • *

    * non-breaking space, decimal 160 *

    *
  • *
*

* COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. *

*

* HTML_ENTITY_DECODE *

*

* Use this option to replace HTML-encoded characters with unencoded characters. HTML_ENTITY_DECODE * performs the following operations: *

*
    *
  • *

    * Replaces (ampersand)quot; with " *

    *
  • *
  • *

    * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 *

    *
  • *
  • *

    * Replaces (ampersand)lt; with a "less than" symbol *

    *
  • *
  • *

    * Replaces (ampersand)gt; with > *

    *
  • *
  • *

    * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, with the * corresponding characters *

    *
  • *
  • *

    * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, with the * corresponding characters *

    *
  • *
*

* LOWERCASE *

*

* Use this option to convert uppercase letters (A-Z) to lowercase (a-z). *

*

* URL_DECODE *

*

* Use this option to decode a URL-encoded value. *

*

* NONE *

*

* Specify NONE if you don't want to perform any text transformations. *

* * @param textTransformation * Text transformations eliminate some of the unusual formatting that attackers use in web requests in an * effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on * FieldToMatch before inspecting it for a match.

*

* You can only specify a single type of TextTransformation. *

*

* CMD_LINE *

*

* When you're concerned that attackers are injecting an operating system command line command and using * unusual formatting to disguise some or all of the command, use this option to perform the following * transformations: *

*
    *
  • *

    * Delete the following characters: \ " ' ^ *

    *
  • *
  • *

    * Delete spaces before the following characters: / ( *

    *
  • *
  • *

    * Replace the following characters with a space: , ; *

    *
  • *
  • *

    * Replace multiple spaces with one space *

    *
  • *
  • *

    * Convert uppercase letters (A-Z) to lowercase (a-z) *

    *
  • *
*

* COMPRESS_WHITE_SPACE *

*

* Use this option to replace the following characters with a space character (decimal 32): *

*
    *
  • *

    * \f, formfeed, decimal 12 *

    *
  • *
  • *

    * \t, tab, decimal 9 *

    *
  • *
  • *

    * \n, newline, decimal 10 *

    *
  • *
  • *

    * \r, carriage return, decimal 13 *

    *
  • *
  • *

    * \v, vertical tab, decimal 11 *

    *
  • *
  • *

    * non-breaking space, decimal 160 *

    *
  • *
*

* COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. *

*

* HTML_ENTITY_DECODE *

*

* Use this option to replace HTML-encoded characters with unencoded characters. * HTML_ENTITY_DECODE performs the following operations: *

*
    *
  • *

    * Replaces (ampersand)quot; with " *

    *
  • *
  • *

    * Replaces (ampersand)nbsp; with a non-breaking space, decimal 160 *

    *
  • *
  • *

    * Replaces (ampersand)lt; with a "less than" symbol *

    *
  • *
  • *

    * Replaces (ampersand)gt; with > *

    *
  • *
  • *

    * Replaces characters that are represented in hexadecimal format, (ampersand)#xhhhh;, with * the corresponding characters *

    *
  • *
  • *

    * Replaces characters that are represented in decimal format, (ampersand)#nnnn;, with the * corresponding characters *

    *
  • *
*

* LOWERCASE *

*

* Use this option to convert uppercase letters (A-Z) to lowercase (a-z). *

*

* URL_DECODE *

*

* Use this option to decode a URL-encoded value. *

*

* NONE *

*

* Specify NONE if you don't want to perform any text transformations. * @see TextTransformation * @return Returns a reference to this object so that method calls can be chained together. * @see TextTransformation */ Builder textTransformation(TextTransformation textTransformation); } static final class BuilderImpl implements Builder { private FieldToMatch fieldToMatch; private String textTransformation; private BuilderImpl() { } private BuilderImpl(XssMatchTuple model) { fieldToMatch(model.fieldToMatch); textTransformation(model.textTransformation); } public final FieldToMatch.Builder getFieldToMatch() { return fieldToMatch != null ? fieldToMatch.toBuilder() : null; } public final void setFieldToMatch(FieldToMatch.BuilderImpl fieldToMatch) { this.fieldToMatch = fieldToMatch != null ? fieldToMatch.build() : null; } @Override public final Builder fieldToMatch(FieldToMatch fieldToMatch) { this.fieldToMatch = fieldToMatch; return this; } public final String getTextTransformation() { return textTransformation; } public final void setTextTransformation(String textTransformation) { this.textTransformation = textTransformation; } @Override public final Builder textTransformation(String textTransformation) { this.textTransformation = textTransformation; return this; } @Override public final Builder textTransformation(TextTransformation textTransformation) { this.textTransformation(textTransformation == null ? null : textTransformation.toString()); return this; } @Override public XssMatchTuple build() { return new XssMatchTuple(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy