Forum Discussion
jokragly
Nov 03, 2010Nimbostratus
iRule for URI ACL
Good afternoon. We are getting desperate trying to find a solution to allow specific URIs and deny all other traffic.
Basically what we are after is to allow access to 5 specific directories and the things within those directories but if someone tries to go to a URI that is not allowed then they get a denied message from the F5 with the URI path that is denied.
mycompany.com/Login/*
mycompany.com/Dealer/*
mycompany.com/Image/*
mycompany.com/User/*
mycompany.com/Help/*
Should this be done in an iRule? If so how? Is it possible to do this as an http class or data group with match only? I can list the URI Strings in a http class and assign that class to the Virtual Server but an invalid page is response is coming from the web server not the F5 deny because it doesn't match our allowed paths in the http class we created.
Any and all help would be greatly appreciated.
Thanks,
Jeff
- hooleylistCirrostratusNote, if that doesn't work for your scenario, try adding logging of the requested URI and then when an "invalid" request is redirected. This should help you identify what's failing.
- Chris_MillerAltostratusAbsolutely agree with Aaron's comment about inefficiency...am somewhat surprised they recommended something like that for such a straight-forward task.
- jokraglyNimbostratusThanks again for the help. I did notice the site was much slower to load.
- Chris_MillerAltostratusYou can use "starts_with", "ends_with", and "eq". Perhaps using a data group for starts_with and just specify the URI "/" for eq.
- hooleylistCirrostratusI think this is what Chris was suggesting:
when HTTP_REQUEST { if { ! ([class match [string tolower [HTTP::uri]] starts_with SplunkTest] or [HTTP::uri] eq "/") } { HTTP::respond 200 content "PERMISSION DENIED TO: [HTTP::uri]" } }
- jokraglyNimbostratusAaron thank you for the correct coding, although the
- Chris_MillerAltostratusPosted By jokragly on 11/08/2010 07:43 AM Aaron thank you for the correct coding, although the
when HTTP_REQUEST { if { ![class match [string tolower [HTTP::uri]] starts_with SplunkTest] or [HTTP::uri] ne "/" } { HTTP::respond 200 content "PERMISSION DENIED TO: [HTTP::uri]" } }
Let me know if that doesn't work.
- jokraglyNimbostratusOk, we finally got it work the way we wanted.
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