Forum Discussion

iRule's avatar
iRule
Icon for Cirrus rankCirrus
Dec 29, 2021
Solved

Block admin URLs for internet users only

Dear Community, I need to block few admin URLs and its subdirectories from internet only. The URLs should be accessible from internal private IPs of organization.   Following needs to be blocked...
  • Enes_Afsin_Al's avatar
    Dec 29, 2021

    Hi,

    Create an address data group and add private IPs to the data group.

    iRule (Change the datagroupname):

    when HTTP_REQUEST {
    	switch -glob [string tolower [HTTP::uri -normalized]] {
    		"/admin/*" -
    		"/login/*" -
    		"/manage/*" -
    		"/account/*" { 
    			if { not [class match [IP::client_addr] equals datagroupname] } {
    				drop
    				return
    			}
    		}
    	}
    }