Forum Discussion
hooleylist
Jan 31, 2008Cirrostratus
Actually, I think I missed part of what you're trying to do. Do you want to allow the request if the requested URI is not in the blocked URI class or if the client IP is in the allowed IP's class; and drop all other requests?
If so, I think this should work and be slightly clearer:
when HTTP_REQUEST {
log local0 "requested [HTTP::uri]"
if {not ([matchclass [string tolower [HTTP::uri]] contains $::uri_block]) or [matchclass [IP::client_addr] equals $::allowed]} {
log local0. "Valid Packet: [IP::client_addr] - [HTTP::uri] forwarding traffic"
} else {
log local0. "Invalid Packet: [IP::client_addr] - [HTTP::uri] discarding"
discard
}
}
Aaron