Forum Discussion

Nick_Palmer_f5's avatar
Nick_Palmer_f5
Icon for Nimbostratus rankNimbostratus
May 26, 2017

Selective Access within Application via iRule

Greetings, iRule experts!

 

I'm trying to block access to certain pages within application using data group but can't make it work. The problem is that blocked and accessible pages are located under the same /Application. Example, URI /Application/Administration/Index.aspx must be blocked, whereas URI /Application/PasswordReset/Index.aspx should be accessible. Another difficulty is that every page has multiple page objects (.js, .css, etc.).

 

What would be best solution for this? Many thanks!

 

  • AndOs's avatar
    AndOs
    Icon for Cirrostratus rankCirrostratus

    You could use an irule.

    If everything under say /Application/Administration/ should be blocked and /Application/PasswordReset/ should be allowed then perhaps the irule in this thread might be what you are after.

    https://devcentral.f5.com/questions/block-url-49989

    Just have your datagroup as

    class blockthis {
        "/application/administration/"
        "/application/anotherblocked/"
    }
    

    and change equals to starts_with in the evaluation

    when HTTP_REQUEST {
        if { [class match [string tolower [HTTP::uri]] starts_with blockthis] } {
            drop
       }
    }
    

    /Andreas

    • Nick_Palmer_f5's avatar
      Nick_Palmer_f5
      Icon for Nimbostratus rankNimbostratus

      Hi Andreas, and thanks for your comment! My issue was CaSe SensiTive. I went with data group and string tolower.