Forum Discussion
Net_Admin_24240
Nimbostratus
Jul 27, 2006block public access allow private
I want to block access to URL's from any public address but allow access if the client initiates the connection using a private address.
For example: block access to http://mycompany.com/Debug or http://mycompany.com/admin but allow access if client has a private IP address.
Also, would it be more efficient to check the client address first or the URL, or is there another way to do this? Thanks.
10 Replies
- hoolio
Cirrostratus
If you have separate VLANs for internal clients versus external clients, you could just create a VIP enabled on the VLAN the internal clients access the VIP over.class internal_hosts_networks_class { network 10.0.0.0 mask 255.0.0.0 host 192.168.0.100 }
class my_protected_uris { "/path1/" "/path2/" }
when HTTP_REQUEST { if { [matchclass [HTTP::uri] starts_with $::my_protected_uris] and (not [matchclass [IP::remote_addr] equals $::internal_hosts_networks_class]) } { log local0. "client: [IP::remote_addr] requested [HTTP::host][HTTP::uri] and was dropped" discard } }
- hoolio
Cirrostratus
A couple of quick, related notes: - Net_Admin_24240
Nimbostratus
I am running BIG-IP 9.1.2 Build 40.6. Do I need to reference the datagroups in the rule besides in the "if" statement? I have not been able to discard traffic using the following: - Deb_Allen_18Historic F5 AccountHostname is not part of the URI, so try this for your class entry instead:
If you need to check the hostname as well, you'll need to add another condition using [HTTP::host].class AdminDebugURI { "/Debug/Debug/ecv.jsp" }
- hoolio
Cirrostratus
Hi,when HTTP_REQUEST { if { [string tolower [HTTP::uri]] contains "debug" ] and [IP::addr [IP::remote_addr] equals 10.10.10.10 ]) } { log local0. "client: [IP::remote_addr] requested [HTTP::host][HTTP::uri] and was dropped" discard } }
- Net_Admin_24240
Nimbostratus
I want to check against all private address space but was using 10.10.10.10 since there were earlier posts indicating that datagroups may not work with version 9.1.2. - hoolio
Cirrostratus
Hi,when HTTP_REQUEST { if { [matchclass [IP::remote_addr] equals $::internal_hosts_networks_class]) } { log local0. "client: [IP::remote_addr] requested [HTTP::host][HTTP::uri] and was dropped" discard } }
when HTTP_REQUEST { if { [matchclass [HTTP::uri] contains $::my_protected_uris] } { log local0. "client: [IP::remote_addr] requested [HTTP::host][HTTP::uri] and was dropped" discard } }
when HTTP_REQUEST { if { [matchclass [HTTP::uri] starts_with $::my_protected_uris] and (not [matchclass [IP::remote_addr] equals $::internal_hosts_networks_class]) } { log local0. "client: [IP::remote_addr] requested [HTTP::host][HTTP::uri] and was dropped" discard } }
- hoolio
Cirrostratus
Actually, the TMM restart is noted in CR49375. The trigger for the failure is using a string instead of a class for a matchclass comparison. To avoid the issue make sure to use matchclass correctly:if { [matchclass $A_STRING contains $::A_CLASS] } { ... }
- Net_Admin_24240
Nimbostratus
Thanks, I was able to get the rule working with datagroups. - hoolio
Cirrostratus
I would imagine you could modify the ldap rule to authenticate against an AD server when clients request a specific URI.
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