Forum Discussion
Differentiate between client-initiated and server-initiated SSL renegotiations
I followed the iRule as described in:
https://devcentral.f5.com/articles/ssl-renegotiation-dos-attack-ndash-an-irule-countermeasure
Except I used the code in the CLIENTSSL_HANDSHAKE event in the CLIENTSSL_CLIENTHELLO event instead. Also instead of using the maxquery variable of 5 I set it to 1 and added an additional flag in the if condition that references that variable that I set when I request renegotiation on the server side. That ensures renegotiation only occurs when initiated by the server.
I tested it using SSLyze --reneg and confirmed it blocked client side renegotiation.
https://github.com/nabla-c0d3/sslyze
when CLIENT_ACCEPTED {
set rand [expr { int(10000000 * rand()) }]
}
when CLIENTSSL_CLIENTHELLO {
set reqno [table incr "reqs$rand"]
table set -subtable "reqrate:$rand" $reqno "ignored" indefinite $static::seconds
if { ![info exists server_renegotiate] and [table keys -count -subtable "reqrate:$rand"] > 1 } {
after 5000
drop
}
}
when CLIENT_CLOSED {
table delete reqs$rand
table delete –subtable reqrate:$rand –all
}
Recent Discussions
Related Content
* 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