Forum Discussion
Bob_10976
Nimbostratus
Apr 16, 2009iRule to Block request with Host Header
I'm needing some help with creating an iRule that will block any request that doesn't have a host header value.
For example if someone was to preform a GET / HTTP/1.1 on one our websites or even assoicated public IP address I want to block that.
Also for the record, I’m not a programmer of any type so I apologize in advance for any newbie/stupid follow up questions..
Thanks,
Bob
- The_Bhattman
Nimbostratus
There are several ways to approach thiswhen HTTP_REQUEST { if { [HTTP::header "Host"] equals " " } { reject } }
class publicaddr { "215.25.25.35" "215.25.25.33" "215.25.25.34" } when CLIENT_ACCEPTED { if { [matchclass [IP::remote_addr] equals $::publicaddr] } { reject } }
- Bob_10976
Nimbostratus
Thanks for the help... - The_Bhattman
Nimbostratus
You can also use either drop or discard. This will cause the current packet or connection to be discarded, but i don't think it will send a reset. Where as reject causes the connection to be rejected, returning a reset as appropriate for the protocol.
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