Forum Discussion
MaxMedov
Cirrostratus
Apr 18, 2023Block specific Client IP if request contains XYZ
Hi, I need help creating the fastest solution (LTM Policy / iRule / other) to do this: If client IP = X.X.X.X and request contains = XYZ Drop the client / or block by WAF message Thank you! ...
CA_Valli
MVP
Apr 18, 2023I'd just advise to avoid using "string tolower" on HTTP uri instruction, since path is case sensitive.
MaxMedov
Cirrostratus
Apr 18, 2023So what is better?
- CA_ValliApr 18, 2023
MVP
[HTTP::path] or [HTTP::query] should work just fine for exact matches on path/query parts of the uri
- Apr 18, 2023
If you are using a mixture of upper and lowercase letters in your URI and you need an exact match on this, then remove the [string tolower]
when HTTP_REQUEST { if { ( ( [IP::addr [IP::client_addr] equals X.X.X.X] ) && ( [HTTP::uri] contains "XYZ" ) ) } { drop } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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