Forum Discussion
P_Shepherd_1790
Nimbostratus
Sep 11, 2018iRule to block access to folders within IIS
Hi
I have an issue with an iRule working in a Virtual LAB environment but when applied to the live environment it behaves differently. The difference between the Virtual LAB and the live is the I...
Lee_Sutcliffe
Nacreous
Sep 12, 2018You could do this more simply using datagroups. Define your folders in one datagroup 'folder_dg' and your internal ip addresses in another 'internal_ips'
The iRule will check if the URI contains anything in the datagroup 'folder_dg', if the IP is not internal (not in the internal_ip) datagroup. The connection will be rejected. You do not need to define the NAT IPs as you want to block all other IPs anyway
For example:
ltm data-group internal folder_dg {
records {
_vti_bin {}
_layouts {}
_windows {}
}
type string
}
ltm data-group internal internal_ips {
records {
10.10.200.0/24 {}
10.10.201.0/24 {}
}
type ip
}
when HTTP_REQUEST {
if {[class match [HTTP::uri] contains folder_dg]} {
if {!([class match [IP::addr [IP::client_addr]] equals internal_ips])} {
reject
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
