Forum Discussion
NickAD
Apr 13, 2017Cirrus
iRule to block string in header and display blocking page
I am wondering if I can create an iRule to block a request if a certain string appears anywhere in the header.
For example, it would be something like...
when HTTP_REQUEST {
if { [HTTP::header ...
Snl
Apr 14, 2017Cirrostratus
Try below
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: User-Agent: [string tolower [HTTP::header "User-Agent"]] requested [HTTP::host][HTTP::uri]"
if { [string tolower [HTTP::header "User-Agent"]] contains "test1234"} {
log local0. "[IP::client_addr]:[TCP::client_port]: Rejected request"
reject }}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects