request limiting
1 TopiciRule to store cookie in table
Hi, I am really iRule novice and so any advice, pointing in right direction will be of great help for me. I am short on time and have to create iRule with following logic: Service behind F5 is doing kind of authentication If user succeed cookie is created iRule should monitor HTTP_RESPONSE for presence of this cookie for specific URI When detected in Set-Cookie header entry in session table should be created (with set lifetime like 2400s - counter updates should not extend lifetime of this entry) storing cookie value HTTP_REQUEST should be monitored for presence of above cookie When detected lookup in table should be performed (using cookie value?) If found: Entry should be checked if it is first occurrence of given cookie value (so this value is detected for first time) If yes - values from few headers should be added - like User-Agent, first IP from X-Forwarded-For (the one that should be real user IP that initiated connection from Internet), maybe some more, counter should be set to 1 If not just counter should be incremented If not found lookup in separate subtable (like false_cookie, indefinite lifetime) should be performed If entry found counter should be incremented If not found new entry should be created using cookie value as a key? Connection should be dropped. Optionally sorry page displayed Well, that is my idea but maybe I am missing something or there is better way. Main goal is to drop all HTTP request (POST operation using specific URI) that do not contain valid cookie. Plus collecting stats about how many illegitimate attempts to perform POST to this UIR were issued. Hope it makes sense, will appreciate a lot any help, Piotr499Views0likes6Comments