18-Jan-2022
08:02
- last edited on
04-Jun-2023
19:13
by
JimmyPackets
Hi,
I'm trying to write an iRule that is triggered during an APM policy (iRule Event) that will check the platform OS and version. If it's lower than a certain value, I want to reject the user but present a message to them indicating that they contact their System Administrator. I have the logic to reject or drop the connection but I'm unable to replace a reject/drop with an iFile or HTTP Redirect. I'm just trying different options. Any ideas?
when ACCESS_POLICY_AGENT_EVENT {
# iRule Event is called "test_me"
if { [ACCESS::policy agent_id] == "test_me"} {
# Variable Section
set min_ios_ver "15.1"
set min_android_ver "12"
set user_platform [ACCESS::session data get "session.client.platform"]
set user_version [ACCESS::session data get "session.client.platform_version"]
# Checks to see if the platform is iOS and version is allowed
if { $user_platform == "iOS" and $user_version < $min_ios_ver } {
reject
if { $static::irule_debug == 1} { log local0. "Does not meet minimum version requirement" }
}
# Checks to see if the platform is iOS and version is allowed
if {$user_platform == "Android" and $user_version < $min_android_ver } {
drop
if { $static::irule_debug == 1} { log local0. "Does not meet minimum version requirement" }
}
}
}
18-Jan-2022 13:16
Bump so it doesn't drown from too many questions on "Can we run curl in tmsh mode".
26-Jan-2022 09:35
Bump...new user experience and all.