I inherited an Nginx setup in front of an Apache server. Today I found some SQL code hitting the apache access logs: GET /mgrayson/splice%27%29%20AND%20%28SELECT%204520%20FROM%28SELECT%20COUNT%28%2A%29%2CCONCAT%280x716b786b71%2C%28SELECT%20%28ELT...
What's the best way to drop this sort of query in nginx? Is it basically setup a bunch of keywords to trap for and ignore the %xx
separator characters?:
if ($query_string ~ “.*select.*from.*(“) {
set $block_sql_injections 1;
}
Is there some better way of blocking this stuff? Thinking this is likely a long-solved problem with a standard mitigation strategy. Thanks!