added: possibility to ban if a session cookie is incorrect (when we are using encoded cookies)

added:   possibility to ban if a client tries to hijack the session cookie
added:   possibility to ban if a client did not send a session cookie
renamed: ezc functions:
         login_cannot_login -> ipban_is_login_allowed_from_this_ip  (and the return value was changed)
         login_when_available_login -> ipban_current_ip_expires_time
added: config options:
       // after how many broken encoded cookie we should ban the current IP
       // default: 2 (value in the range <0 - 65535>)
       size_t broken_encoded_cookie_treshold;

       // after how many incorrect session identifiers (or session indices) we should ban the current IP
       // do not set this value too low, as people connecting from the same IP address (from behind a NAT)
       // would be banned if they have an old session cookie remembered in the browser
       // default: 128 (value in the range <0 - 65535>)
       size_t session_hijacking_treshold;

       // after how many times a client will be banned if it did not send a session cookie
       // default: 1000 (value in the range <0 - 65535>)
       size_t no_session_cookie_treshold;








git-svn-id: svn://ttmath.org/publicrep/winix/trunk@995 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2014-11-24 20:22:30 +00:00
parent 76314aab10
commit c9bf20201b
18 changed files with 368 additions and 136 deletions

View File

@@ -334,15 +334,21 @@ void Templates::CreateFunctions()
/*
ipban
*/
ezc_functions.Insert("ipban_tab", ipban_tab);
ezc_functions.Insert("ipban_tab_id", ipban_tab_id);
ezc_functions.Insert("ipban_tab_ip", ipban_tab_ip);
ezc_functions.Insert("ipban_tab_incorrect_login", ipban_tab_incorrect_login);
ezc_functions.Insert("ipban_tab_ban_level", ipban_tab_ban_level);
ezc_functions.Insert("ipban_tab_has_active_flag", ipban_tab_has_active_flag);
ezc_functions.Insert("ipban_tab_expires", ipban_tab_expires);
ezc_functions.Insert("ipban_tab_last_used", ipban_tab_last_used);
ezc_functions.Insert("ipban_tab_is_logging_allowed", ipban_tab_is_logging_allowed);
ezc_functions.Insert("ipban_is_current_ip_banned", ipban_is_current_ip_banned);
ezc_functions.Insert("ipban_current_ip_expires_time", ipban_current_ip_expires_time);
ezc_functions.Insert("ipban_is_login_allowed_from_this_ip", ipban_is_login_allowed_from_this_ip);
ezc_functions.Insert("ipban_tab", ipban_tab);
ezc_functions.Insert("ipban_tab_id", ipban_tab_id);
ezc_functions.Insert("ipban_tab_ip", ipban_tab_ip);
ezc_functions.Insert("ipban_tab_incorrect_login", ipban_tab_incorrect_login);
ezc_functions.Insert("ipban_tab_broken_encoded_cookie", ipban_tab_broken_encoded_cookie);
ezc_functions.Insert("ipban_tab_session_hijacking", ipban_tab_session_hijacking);
ezc_functions.Insert("ipban_tab_no_session_cookie", ipban_tab_no_session_cookie);
ezc_functions.Insert("ipban_tab_ban_level", ipban_tab_ban_level);
ezc_functions.Insert("ipban_tab_has_active_flag", ipban_tab_has_active_flag);
ezc_functions.Insert("ipban_tab_expires", ipban_tab_expires);
ezc_functions.Insert("ipban_tab_last_used", ipban_tab_last_used);
ezc_functions.Insert("ipban_tab_is_logging_allowed", ipban_tab_is_logging_allowed);
/*
@@ -461,10 +467,8 @@ void Templates::CreateFunctions()
/*
login
*/
ezc_functions.Insert("login_path", login_path);
ezc_functions.Insert("login_cannot_login", login_cannot_login);
ezc_functions.Insert("login_when_available_login", login_when_available_login);
ezc_functions.Insert("login_should_use_captcha", login_should_use_captcha);
ezc_functions.Insert("login_path", login_path);
ezc_functions.Insert("login_should_use_captcha", login_should_use_captcha);
/*