# Nginx WAF Maps Definitions
# Automatically generated from OWASP rules.
http {
map $request_uri $waf_block_initialization {
default 0;
"~*@eq\ 100" 1;
"~*\^\[a\-f\]\*\(\[0\-9\]\)\[a\-f\]\*\(\[0\-9\]\)" 1;
"~*\^\.\*\$" 1;
"~*@eq\ 1" 1;
"~*@eq\ 0" 1;
"~*!@rx\ \(\?:URLENCODED\|MULTIPART\|XML\|JSON\)" 1;
}
map $request_uri $waf_block_attack {
default 0;
"~*\(\?:bhttp/d\|<\(\?:html\|meta\)b\)" 1;
"~*content\-transfer\-encoding:\(\.\*\)" 1;
"~*\(\?:get\|post\|head\|options\|connect\|put\|delete\|trace\|track\|patch\|propfind\|propatch\|mkcol\|copy\|move\|lock\|unlock\)s\+\[\^s\]\+s\+http/d" 1;
"~*@gt\ 0" 1;
"~*TX:paramcounter_\(\.\*\)" 1;
"~*\[rn\]W\*\?\(\?:content\-\(\?:type\|length\)\|set\-cookie\|location\):s\*w" 1;
"~*\[nr\]" 1;
"~*\[nr\]\+\(\?:s\|location\|refresh\|\(\?:set\-\)\?cookie\|\(\?:x\-\)\?\(\?:forwarded\-\(\?:for\|host\|server\)\|host\|via\|remote\-ip\|remote\-addr\|originating\-IP\)\)s\*:" 1;
"~*\^\[\^sv,;\]\+\[sv,;\]\.\*\?\(\?:application/\(\?:\.\+\+\)\?json\|\(\?:application/\(\?:soap\+\)\?\|text/\)xml\)" 1;
"~*\^content\-types\*:s\*\(\.\*\)\$" 1;
"~*\." 1;
"~*unix:\[\^\|\]\*\|" 1;
"~*\^\[\^sv,;\]\+\[sv,;\]\.\*\?b\(\?:\(\(\?:tex\|multipar\)t\|application\)\|\(\(\?:audi\|vide\)o\|image\|cs\[sv\]\|\(\?:vn\|relate\)d\|p\(\?:df\|lain\)\|json\|\(\?:soa\|cs\)p\|x\(\?:ml\|\-www\-form\-urlencoded\)\|form\-data\|x\-amf\|\(\?:octe\|repor\)t\|stream\)\|\(\[\+/\]\)\)b" 1;
"~*@gt\ 1" 1;
}
map $request_uri $waf_block_fixation {
default 0;
"~*\^\(\?:jsessionid\|aspsessionid\|asp\.net_sessionid\|phpsession\|phpsessid\|weblogicsession\|session_id\|session\-id\|cfid\|cftoken\|cfsid\|jservsession\|jwsession\)\$" 1;
"~*\(\?i:\.cookieb\.\*\?;W\*\?\(\?:expires\|domain\)W\*\?=\|bhttp\-equivW\+set\-cookieb\)" 1;
"~*@eq\ 0" 1;
"~*!@endsWith\ %\{request_headers\.host\}" 1;
"~*\^\(\?:ht\|f\)tps\?://\(\.\*\?\)/" 1;
}
map $request_uri $waf_block_rfi {
default 0;
"~*\^\(\?i:file\|ftps\?\|https\?\)://\(\?:d\{1,3\}\.d\{1,3\}\.d\{1,3\}\.d\{1,3\}\)" 1;
"~*!@endsWith\ \.%\{request_headers\.host\}" 1;
}
map $request_uri $waf_block_lfi {
default 0;
"~*\(\?:\(\?:\^\|\[x5c/;\]\)\.\{2,3\}\[x5c/;\]\|\[x5c/;\]\.\{2,3\}\(\?:\[x5c/;\]\|\$\)\)" 1;
}
map $request_uri $waf_block_generic {
default 0;
"~*\[s\*constructors\*\]" 1;
"~*@\{\.\*\}" 1;
"~*while\[sv\]\*\(\[sv\(\]\*\(\?:!\+\(\?:false\|null\|undefined\|NaN\|\[\+\-\]\?0\|\"\{2\}\|'\{2\}\|`\{2\}\)\|\(\?:!!\)\*\(\?:\(\?:t\(\?:rue\|his\)\|\[\+\-\]\?\(\?:Infinity\|\[1\-9\]\[0\-9\]\*\)\|new\ \[A\-Za\-z\]\[0\-9A\-Z_a\-z\]\*\|window\|String\|\(\?:Boolea\|Functio\)n\|Object\|Array\)b\|\{\.\*\}\|\[\.\*\]\|\"\[\^\"\]\+\"\|'\[\^'\]\+'\|`\[\^`\]\+`\)\)\.\*\)" 1;
}
map $request_uri $waf_block_evaluation {
default 0;
"~*@ge\ 2" 1;
"~*@ge\ 3" 1;
"~*@ge\ %\{tx\.inbound_anomaly_score_threshold\}" 1;
"~*@eq\ 1" 1;
"~*@ge\ %\{tx\.outbound_anomaly_score_threshold\}" 1;
"~*@ge\ 4" 1;
"~*@ge\ 1" 1;
}
map $request_uri $waf_block_sql {
default 0;
"~*\(\?i:SQL\ error\.\*POS\[0\-9\]\+\.\*\|Warning\.\*maxdb\.\*\)" 1;
"~*\(\?i\)\(\?:Warning\.\*sqlite_\.\*\|Warning\.\*SQLite3::\|SQLite/JDBCDriver\|SQLite\.Exception\|System\.Data\.SQLite\.SQLiteException\)" 1;
"~*\(\?i:An\ illegal\ character\ has\ been\ found\ in\ the\ statement\|com\.informix\.jdbc\|Exception\.\*Informix\)" 1;
"~*\(\?i:JET\ Database\ Engine\|Access\ Database\ Engine\|\[Microsoft\]\[ODBC\ Microsoft\ Access\ Driver\]\)" 1;
"~*\(\?i:ORA\-\[0\-9\]\[0\-9\]\[0\-9\]\[0\-9\]\|java\.sql\.SQLException\|Oracle\ error\|Oracle\.\*Driver\|Warning\.\*oci_\.\*\|Warning\.\*ora_\.\*\)" 1;
"~*\(\?i\)org\.hsqldb\.jdbc" 1;
"~*\(\?i:\[DM_QUERY_E_SYNTAX\]\|has\ occurred\ in\ the\ vicinity\ of:\)" 1;
"~*\(\?i:Warning\.\*ingres_\|Ingres\ SQLSTATE\|IngresW\.\*Driver\)" 1;
"~*\(\?i\)\(\?:Sybase\ message:\|Warning\.\{2,20\}sybase\|Sybase\.\*Server\ message\.\*\)" 1;
"~*\(\?i\)Exception\ \(\?:condition\ \)\?d\+\.\ Transaction\ rollback\." 1;
"~*\(\?i\)\(\?:System\.Data\.OleDb\.OleDbException\|\[Microsoft\]\[ODBC\ SQL\ Server\ Driver\]\|\[Macromedia\]\[SQLServer\ JDBC\ Driver\]\|\[SqlException\|System\.Data\.SqlClient\.SqlException\|Unclosed\ quotation\ mark\ after\ the\ character\ string\|'80040e14'\|mssql_query\(\)\|Microsoft\ OLE\ DB\ Provider\ for\ ODBC\ Drivers\|Microsoft\ OLE\ DB\ Provider\ for\ SQL\ Server\|Incorrect\ syntax\ near\|Sintaxis\ incorrecta\ cerca\ de\|Syntax\ error\ in\ string\ in\ query\ expression\|Procedure\ or\ function\ \.\*\ expects\ parameter\|Unclosed\ quotation\ mark\ before\ the\ character\ string\|Syntax\ error\ \.\*\ in\ query\ expression\|Data\ type\ mismatch\ in\ criteria\ expression\.\|ADODB\.Field\ \(0x800A0BCD\)\|the\ used\ select\ statements\ have\ different\ number\ of\ columns\|OLE\ DB\.\*SQL\ Server\|Warning\.\*mssql_\.\*\|Driver\.\*SQL\[\ _\-\]\*Server\|SQL\ Server\.\*Driver\|SQL\ Server\.\*\[0\-9a\-fA\-F\]\{8\}\|Exception\.\*WSystem\.Data\.SqlClient\.\|Conversion\ failed\ when\ converting\ the\ varchar\ value\ \.\*\?\ to\ data\ type\ int\.\)" 1;
"~*\(\?i:Warning:\ ibase_\|Unexpected\ end\ of\ command\ in\ statement\)" 1;
"~*\(\?i\)Dynamic\ SQL\ Error" 1;
}
map $request_uri $waf_block_enforcement {
default 0;
"~*@gt\ %\{tx\.combined_file_sizes\}" 1;
"~*@gt\ 0" 1;
"~*!@rx\ \^\(\?:OPTIONS\|CONNECT\)\$" 1;
"~*\(\?i\)x5cu\[0\-9a\-f\]\{4\}" 1;
"~*@endsWith\ \.pdf" 1;
"~*%u\[fF\]\{2\}\[0\-9a\-fA\-F\]\{2\}" 1;
"~*@gt\ %\{tx\.arg_name_length\}" 1;
"~*@eq\ 0" 1;
"~*@gt\ %\{tx\.total_arg_length\}" 1;
"~*@contains\ \#" 1;
"~*@gt\ %\{tx\.max_num_args\}" 1;
"~*@gt\ 50" 1;
"~*!@endsWith\ \.pdf" 1;
"~*!@streq\ JSON" 1;
"~*!@pm\ AppleWebKit\ Android" 1;
"~*@streq\ POST" 1;
"~*\^\.\*\$" 1;
"~*\['\";=\]" 1;
"~*x25" 1;
"~*@validateByteRange\ 38,44\-46,48\-58,61,65\-90,95,97\-122" 1;
"~*!@rx\ \^\(\?:\(\?:max\-age=\[0\-9\]\+\|min\-fresh=\[0\-9\]\+\|no\-cache\|no\-store\|no\-transform\|only\-if\-cached\|max\-stale\(\?:=\[0\-9\]\+\)\?\)\(\?:s\*,s\*\|\$\)\)\{1,7\}\$" 1;
"~*!@rx\ \^d\+\$" 1;
"~*@eq\ 1" 1;
"~*@gt\ %\{tx\.max_file_size\}" 1;
"~*@gt\ %\{tx\.arg_length\}" 1;
"~*\^\[\^;s\]\+" 1;
"~*!@rx\ \^\[w/\.\+\*\-\]\+\(\?:s\?;s\?\(\?:action\|boundary\|charset\|component\|start\(\?:\-info\)\?\|type\|version\)s\?=s\?\['\"w\.\(\)\+,/:=\?<>@\#\*\-\]\+\)\*\$" 1;
"~*\^bytes=\(\?:\(\?:d\+\)\?\-\(\?:d\+\)\?s\*,\?s\*\)\{63\}" 1;
"~*charset\.\*\?charset" 1;
"~*@validateUrlEncoding" 1;
"~*@validateByteRange\ 32\-36,38\-126" 1;
"~*charsets\*=s\*\[\"'\]\?\(\[\^;\"'s\]\+\)" 1;
"~*@within\ %\{tx\.restricted_headers_extended\}" 1;
"~*!@rx\ \^0\?\$" 1;
"~*\(d\+\)\-\(d\+\)" 1;
"~*!@rx\ \^OPTIONS\$" 1;
"~*@validateByteRange\ 9,10,13,32\-126,128\-255" 1;
"~*b\(\?:keep\-alive\|close\),s\?\(\?:keep\-alive\|close\)b" 1;
"~*\^\$" 1;
"~*%\[0\-9a\-fA\-F\]\{2\}" 1;
"~*\^bytes=\(\?:\(\?:d\+\)\?\-\(\?:d\+\)\?s\*,\?s\*\)\{6\}" 1;
"~*!@pm\ AppleWebKit\ Android\ Business\ Enterprise\ Entreprise" 1;
"~*\.\(\[\^\.\]\+\)\$" 1;
"~*@within\ %\{tx\.restricted_extensions\}" 1;
"~*@ge\ 1" 1;
"~*\(\?:\^\(\[d\.\]\+\|\[\[da\-f:\]\+\]\|\[da\-f:\]\+\)\(:\[d\]\+\)\?\$\)" 1;
"~*\^\(\?:GET\|HEAD\)\$" 1;
"~*@validateUtf8Encoding" 1;
"~*@validateByteRange\ 1\-255" 1;
"~*\(\?:\^\|\[\^x5c\]\)x5c\[cdeghijklmpqwxyz123456789\]" 1;
"~*\.\[\^\.\~\]\+\~\(\?:/\.\*\|\)\$" 1;
"~*@within\ %\{tx\.restricted_headers_basic\}" 1;
"~*@validateByteRange\ 32,34,38,42\-59,61,65\-90,95,97\-122" 1;
"~*!@rx\ \^0\$" 1;
"~*@gt\ 1" 1;
}
map $request_uri $waf_block_exceptions {
default 0;
"~*@endsWith\ \(internal\ dummy\ connection\)" 1;
"~*@ipMatch\ 127\.0\.0\.1,::1" 1;
"~*\^\(\?:GET\ /\|OPTIONS\ \*\)\ HTTP/\[12\]\.\[01\]\$" 1;
"~*@streq\ GET\ /" 1;
}
map $request_uri $waf_block_xss {
default 0;
"~*\(\?i\)