| 1 | # Generated by default/object.tt | ||
| 2 | package Paws::WAFV2::TextTransformation; | ||
| 3 | use Moose; | ||
| 4 | has Priority => (is => 'ro', isa => 'Int', required => 1); | ||
| 5 | has Type => (is => 'ro', isa => 'Str', required => 1); | ||
| 6 | |||
| 7 | 1; | ||
| 8 | |||
| 9 | ### main pod documentation begin ### | ||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | Paws::WAFV2::TextTransformation | ||
| 14 | |||
| 15 | =head1 USAGE | ||
| 16 | |||
| 17 | This class represents one of two things: | ||
| 18 | |||
| 19 | =head3 Arguments in a call to a service | ||
| 20 | |||
| 21 | Use the attributes of this class as arguments to methods. You shouldn't make instances of this class. | ||
| 22 | Each attribute should be used as a named argument in the calls that expect this type of object. | ||
| 23 | |||
| 24 | As an example, if Att1 is expected to be a Paws::WAFV2::TextTransformation object: | ||
| 25 | |||
| 26 | $service_obj->Method(Att1 => { Priority => $value, ..., Type => $value }); | ||
| 27 | |||
| 28 | =head3 Results returned from an API call | ||
| 29 | |||
| 30 | Use accessors for each attribute. If Att1 is expected to be an Paws::WAFV2::TextTransformation object: | ||
| 31 | |||
| 32 | $result = $service_obj->Method(...); | ||
| 33 | $result->Att1->Priority | ||
| 34 | |||
| 35 | =head1 DESCRIPTION | ||
| 36 | |||
| 37 | Text transformations eliminate some of the unusual formatting that | ||
| 38 | attackers use in web requests in an effort to bypass detection. | ||
| 39 | |||
| 40 | =head1 ATTRIBUTES | ||
| 41 | |||
| 42 | |||
| 43 | =head2 B<REQUIRED> Priority => Int | ||
| 44 | |||
| 45 | Sets the relative processing order for multiple transformations that | ||
| 46 | are defined for a rule statement. WAF processes all transformations, | ||
| 47 | from lowest priority to highest, before inspecting the transformed | ||
| 48 | content. The priorities don't need to be consecutive, but they must all | ||
| 49 | be different. | ||
| 50 | |||
| 51 | |||
| 52 | =head2 B<REQUIRED> Type => Str | ||
| 53 | |||
| 54 | You can specify the following transformation types: | ||
| 55 | |||
| 56 | B<BASE64_DECODE> - Decode a C<Base64>-encoded string. | ||
| 57 | |||
| 58 | B<BASE64_DECODE_EXT> - Decode a C<Base64>-encoded string, but use a | ||
| 59 | forgiving implementation that ignores characters that aren't valid. | ||
| 60 | |||
| 61 | B<CMD_LINE> - Command-line transformations. These are helpful in | ||
| 62 | reducing effectiveness of attackers who inject an operating system | ||
| 63 | command-line command and use unusual formatting to disguise some or all | ||
| 64 | of the command. | ||
| 65 | |||
| 66 | =over | ||
| 67 | |||
| 68 | =item * | ||
| 69 | |||
| 70 | Delete the following characters: C<\ " ' ^> | ||
| 71 | |||
| 72 | =item * | ||
| 73 | |||
| 74 | Delete spaces before the following characters: C</ (> | ||
| 75 | |||
| 76 | =item * | ||
| 77 | |||
| 78 | Replace the following characters with a space: C<, ;> | ||
| 79 | |||
| 80 | =item * | ||
| 81 | |||
| 82 | Replace multiple spaces with one space | ||
| 83 | |||
| 84 | =item * | ||
| 85 | |||
| 86 | Convert uppercase letters (A-Z) to lowercase (a-z) | ||
| 87 | |||
| 88 | =back | ||
| 89 | |||
| 90 | B<COMPRESS_WHITE_SPACE> - Replace these characters with a space | ||
| 91 | character (decimal 32): | ||
| 92 | |||
| 93 | =over | ||
| 94 | |||
| 95 | =item * | ||
| 96 | |||
| 97 | C<\f>, formfeed, decimal 12 | ||
| 98 | |||
| 99 | =item * | ||
| 100 | |||
| 101 | C<\t>, tab, decimal 9 | ||
| 102 | |||
| 103 | =item * | ||
| 104 | |||
| 105 | C<\n>, newline, decimal 10 | ||
| 106 | |||
| 107 | =item * | ||
| 108 | |||
| 109 | C<\r>, carriage return, decimal 13 | ||
| 110 | |||
| 111 | =item * | ||
| 112 | |||
| 113 | C<\v>, vertical tab, decimal 11 | ||
| 114 | |||
| 115 | =item * | ||
| 116 | |||
| 117 | Non-breaking space, decimal 160 | ||
| 118 | |||
| 119 | =back | ||
| 120 | |||
| 121 | C<COMPRESS_WHITE_SPACE> also replaces multiple spaces with one space. | ||
| 122 | |||
| 123 | B<CSS_DECODE> - Decode characters that were encoded using CSS 2.x | ||
| 124 | escape rules C<syndata.html#characters>. This function uses up to two | ||
| 125 | bytes in the decoding process, so it can help to uncover ASCII | ||
| 126 | characters that were encoded using CSS encoding that wouldnE<rsquo>t | ||
| 127 | typically be encoded. It's also useful in countering evasion, which is | ||
| 128 | a combination of a backslash and non-hexadecimal characters. For | ||
| 129 | example, C<ja\vascript> for javascript. | ||
| 130 | |||
| 131 | B<ESCAPE_SEQ_DECODE> - Decode the following ANSI C escape sequences: | ||
| 132 | C<\a>, C<\b>, C<\f>, C<\n>, C<\r>, C<\t>, C<\v>, C<\\>, C<\?>, C<\'>, | ||
| 133 | C<\">, C<\xHH> (hexadecimal), C<\0OOO> (octal). Encodings that aren't | ||
| 134 | valid remain in the output. | ||
| 135 | |||
| 136 | B<HEX_DECODE> - Decode a string of hexadecimal characters into a | ||
| 137 | binary. | ||
| 138 | |||
| 139 | B<HTML_ENTITY_DECODE> - Replace HTML-encoded characters with unencoded | ||
| 140 | characters. C<HTML_ENTITY_DECODE> performs these operations: | ||
| 141 | |||
| 142 | =over | ||
| 143 | |||
| 144 | =item * | ||
| 145 | |||
| 146 | Replaces C<(ampersand)quot;> with C<"> | ||
| 147 | |||
| 148 | =item * | ||
| 149 | |||
| 150 | Replaces C<(ampersand)nbsp;> with a non-breaking space, decimal 160 | ||
| 151 | |||
| 152 | =item * | ||
| 153 | |||
| 154 | Replaces C<(ampersand)lt;> with a "less than" symbol | ||
| 155 | |||
| 156 | =item * | ||
| 157 | |||
| 158 | Replaces C<(ampersand)gt;> with C<E<gt>> | ||
| 159 | |||
| 160 | =item * | ||
| 161 | |||
| 162 | Replaces characters that are represented in hexadecimal format, | ||
| 163 | C<(ampersand)(hash)xhhhh;>, with the corresponding characters | ||
| 164 | |||
| 165 | =item * | ||
| 166 | |||
| 167 | Replaces characters that are represented in decimal format, | ||
| 168 | C<(ampersand)(hash)nnnn;>, with the corresponding characters | ||
| 169 | |||
| 170 | =back | ||
| 171 | |||
| 172 | B<JS_DECODE> - Decode JavaScript escape sequences. If a C<\> C<u> | ||
| 173 | C<HHHH> code is in the full-width ASCII code range of C<FF01-FF5E>, | ||
| 174 | then the higher byte is used to detect and adjust the lower byte. If | ||
| 175 | not, only the lower byte is used and the higher byte is zeroed, causing | ||
| 176 | a possible loss of information. | ||
| 177 | |||
| 178 | B<LOWERCASE> - Convert uppercase letters (A-Z) to lowercase (a-z). | ||
| 179 | |||
| 180 | B<MD5> - Calculate an MD5 hash from the data in the input. The computed | ||
| 181 | hash is in a raw binary form. | ||
| 182 | |||
| 183 | B<NONE> - Specify C<NONE> if you don't want any text transformations. | ||
| 184 | |||
| 185 | B<NORMALIZE_PATH> - Remove multiple slashes, directory self-references, | ||
| 186 | and directory back-references that are not at the beginning of the | ||
| 187 | input from an input string. | ||
| 188 | |||
| 189 | B<NORMALIZE_PATH_WIN> - This is the same as C<NORMALIZE_PATH>, but | ||
| 190 | first converts backslash characters to forward slashes. | ||
| 191 | |||
| 192 | B<REMOVE_NULLS> - Remove all C<NULL> bytes from the input. | ||
| 193 | |||
| 194 | B<REPLACE_COMMENTS> - Replace each occurrence of a C-style comment | ||
| 195 | (C</* ... */>) with a single space. Multiple consecutive occurrences | ||
| 196 | are not compressed. Unterminated comments are also replaced with a | ||
| 197 | space (ASCII 0x20). However, a standalone termination of a comment | ||
| 198 | (C<*/>) is not acted upon. | ||
| 199 | |||
| 200 | B<REPLACE_NULLS> - Replace NULL bytes in the input with space | ||
| 201 | characters (ASCII C<0x20>). | ||
| 202 | |||
| 203 | B<SQL_HEX_DECODE> - Decode the following ANSI C escape sequences: | ||
| 204 | C<\a>, C<\b>, C<\f>, C<\n>, C<\r>, C<\t>, C<\v>, C<\\>, C<\?>, C<\'>, | ||
| 205 | C<\">, C<\xHH> (hexadecimal), C<\0OOO> (octal). Encodings that aren't | ||
| 206 | valid remain in the output. | ||
| 207 | |||
| 208 | B<URL_DECODE> - Decode a URL-encoded value. | ||
| 209 | |||
| 210 | B<URL_DECODE_UNI> - Like C<URL_DECODE>, but with support for | ||
| 211 | Microsoft-specific C<%u> encoding. If the code is in the full-width | ||
| 212 | ASCII code range of C<FF01-FF5E>, the higher byte is used to detect and | ||
| 213 | adjust the lower byte. Otherwise, only the lower byte is used and the | ||
| 214 | higher byte is zeroed. | ||
| 215 | |||
| 216 | B<UTF8_TO_UNICODE> - Convert all UTF-8 character sequences to Unicode. | ||
| 217 | This helps input normalization, and minimizing false-positives and | ||
| 218 | false-negatives for non-English languages. | ||
| 219 | |||
| 220 | |||
| 221 | |||
| 222 | =head1 SEE ALSO | ||
| 223 | |||
| 224 | This class forms part of L<Paws>, describing an object used in L<Paws::WAFV2> | ||
| 225 | |||
| 226 | =head1 BUGS and CONTRIBUTIONS | ||
| 227 | |||
| 228 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 229 | |||
| 230 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 231 | |||
| 232 | =cut | ||
| 233 |