ltm rule command ASM captcha age
iRule(1) BIG-IP TMSH Manual iRule(1)
ASM::captcha_age
Returns the age of the CAPTCHA challenge in seconds.
SYNOPSIS
ASM::captcha_age
DESCRIPTION
Returns the age of the CAPTCHA challenge in seconds. This is only relevant if the value of ASM::captcha_status
is "correct"; otherwise, -1 is returned.
Syntax
ASM::captcha_age
RETURN VALUE
Returns the age of the CAPTCHA challenge in seconds, or -1 if not applicable.
VALID DURING
ASM_REQUEST_DONE, ASM_REQUEST_VIOLATION
EXAMPLES
# EXAMPLE: Send CAPTCHA challenge and validate the response, but to avoid
# blocking requests to which CAPTCHA challenge cannot be sent (non-HTML pages),
# send the CAPTCHA challenge on HTML pages after 30 seconds of aging, which is
# before the expiration of the answer.
when ASM_REQUEST_DONE {
if {[ASM::captcha_status] eq "correct"} {
if {[ASM::captcha_age] >= 30} {
ASM::captcha
}
} else {
if {[ASM::captcha] ne "ok"} {
log local0. "cannot send captcha_challenge: \"$res\""
}
}
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-11.5.0
--First introduced the command.
BIG-IP 2020-06-23 iRule(1)