Forum Discussion

Nuruddin_Ahmed_'s avatar
Nuruddin_Ahmed_
Icon for Cirrostratus rankCirrostratus
Jun 12, 2016

URL Restriction Best Way

Hi,

 

I have hosted one URL for our company on F5 - xyz.com, due to security audits, i have been asked to allow only specific paths, like -

 

xyz.com/ucc/xyz/mnn xyz.com/abc/nuu/ooo xyz.com/abc/nuu/dsf xyz.com/abc/nuu/wer xyz.com/abc/nuu/sd xyz.com/abc/nuu/df

 

The list of path is big (around 20). What would be the best way to achieve it. I know it is possible by irule but it would be a big irule and may not be best approach.

 

Thanks in advance.

 

1 Reply

  • when HTTP_REQUEST {
    set URI [string tolower[HTTP::uri]]
    if { not ([class match $URI eq CLASS_ALLOWED_URI]) } {
    discard
    }
    }
    

    You would have to create a data-group and name it as CLASS_ALLOWED_URI (or anything else you want). The data-group will contain the list of allowed URI. The iRule uses reverse-logic and drops all requests that doesn't match the allowed URI list.