Forum Discussion
Learning mode testing guide
- Mar 21, 2021
Hello, You can use the ASM trusted IP/source option as mentioned in https://devcentral.f5.com/s/question/0D51T00006i7fVR/asm-policy-how-is-the-trusted-ip-list-treated . This way you add your or the developers IP address to the trusted ip/source and with just one session the URL and parametars are learned.
I may also suggest to have a production and pre-production environments and after a change is made on the preproduction environment and learned by using the trusted IP/source then just merge the preproduction policy with the production one and then the developers can also make the change on the production environment as mentioned in https://techdocs.f5.com/kb/en-us/products/big-ip_asm/manuals/product/asm-implementations-12-1-0/33.html .
when HTTP_REQUEST {
if { [matchclass [HTTP::header "subscriberID"] equals $::subscriberID]} {
{pool AA-BB-Pool}
else { HTTP::respond 301 Location "http://XYZ.com" target="_blank" rel="nofollow">http://XYZ.com" )
elseif {[matchclass [IP::client_addr] equals $::GGG]}
log local0. "Valid Source IP: [IP::client_addr] - forwarding traffic"
pool AA-BB-Pool}
else { HTTP::respond 301 Location "http://XYZ.com" target="_blank" rel="nofollow">http://XYZ.com" } log local0. "INVALID Source IP: [IP::client_addr] - dropping traffic"
}
}
However, I don't think you needed the first 'if' statement so I have removed it if {[ HTTP::header exists "subscriberID" ]} although one of the more experienced chaps may be able to guide you better on that. Let us know how you get on.
Recent Discussions
* 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