I am confused by the iRule, where and when is hs_count initialised ?
Trying the rule on my 11.2.1 807 box I get the following:
Nov 26 16:41:34 tmm err tmm[10885]: 01220001:3: TCL error: /b2c/vuln_ssl_renegotiation_dos - can’t read “hs_count”: no such variable (reading value of variable to increment) invoked from within “incr hs_count”
Nov 26 16:41:34 tmm err tmm[10885]: 01220001:3: TCL error: /b2c/vuln_ssl_renegotiation_dos - can’t read “hs_count”: no such variable while executing “for { set i 1 } { $i <= $hs_count } { incr i } { table delete -subtable “hs_rate:$flow” “[TCP::client_port]:$i” }”
i think hs_count should be initialized in CLIENT_ACCEPTED.
11.2.1
[root@ve11a:Active:Changes Pending] config tmsh show sys version
Sys::Version
Main Package
Product BIG-IP
Version 11.2.1
Build 797.0
Edition Final
Date Thu Sep 20 09:35:47 PDT 2012
[root@ve11a:Active:Changes Pending] config tail -f /var/log/ltm
Nov 26 13:36:08 tmm err tmm[6316]: 01220001:3: TCL error: /Common/myrule - can't read "hs_count": no such variable (reading value of variable to increment) invoked from within "incr hs_count"
Nov 26 13:36:08 tmm err tmm[6316]: 01220001:3: TCL error: /Common/myrule - can't read "hs_count": no such variable while executing "for { set i 1 } { $i <= $hs_count } { incr i } { table delete -subtable "hs_rate:$flow" "[TCP::client_port]:$i" }"
10.2.4
[root@ve10:Active] config b version|grep -iA 1 version
BIG-IP Version 10.2.4 655.0
Hotfix HF4 Edition
[root@ve10:Active] config tail -f /var/log/ltm
Nov 26 13:41:59 local/tmm err tmm[7926]: 01220001:3: TCL error: myrule - can't read "hs_count": no such variable (reading value of variable to increment) invoked from within "incr hs_count"
Nov 26 13:41:59 local/tmm err tmm[7926]: 01220001:3: TCL error: myrule - can't read "hs_count": no such variable while executing "for { set i 1 } { $i <= $hs_count } { incr i } { table delete -subtable "hs_rate:$flow" "[TCP::client_port]:$i" }"
Nice catch. I updated the Codeshare example to set hs_count to 0 in CLIENT_ACCEPTED.
J, the reason you’d want to use this iRule is if you needed to support renegotiation (secure or insecure) but want to limit how many times a client can attempt to renegotiate the session ID to mitigate a DoS attack.