Forum Discussion
bezeqint
Dec 05, 2011Nimbostratus
security irule per domain
hello,
i have a server that serves two domains.
lets say that the domain names are DomainA.com and DomainB.com
i want to build a security irule so that:
1. admins from certain...
Michael_Yates
Dec 05, 2011Nimbostratus
Hi bezeqint,
One way to do it would be to use Data Groups (Classes). Something like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"*domaina.com" {
if { [match class [IP::client_addr]] equals allowedipaddresses } {
return
}
elseif { [HTTP::uri] contains "/database*" } {
HTTP::redirect "/"
}
}
"domainb.com" {
if { [match class [IP::client_addr]] equals allowedipaddresses } {
return
}
else {
reject
}
}
}
}
Create a Data Group that contains the allowed IP Addresses (or Subnets / Networks).
Hope this helps.
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