sidiov
Aug 23, 2011Nimbostratus
Trouble with a irule using a data group
I am attempting to drop several user agent headers that hit a website consistantly with bad traffic, I wanted to use a data group for a list of agents, but when i use it, it drops all connections.
Here is the data group irule:
when HTTP_REQUEST { if {[matchclass [string tolower [HTTP::header "User-Agent"]] contains $::danger-user-agents] } { drop } }
danger-user-agents group contains 2 strings:
zmeu
black hole
If I manually specify the names it works:
when HTTP_REQUEST { if { [string tolower [HTTP::header "User-Agent"]] contains "zmeu" } {drop} elseif { [string tolower [HTTP::header User-Agent]] contains "black hole" } {drop} }
What am I doing wrong in the data group version?
I do have a similar data group working for another site's irule that drops based on uri strings, and that works fine: