diff --git a/auth_brute_force/README.rst b/auth_brute_force/README.rst index 9b639574e..79ed0057e 100644 --- a/auth_brute_force/README.rst +++ b/auth_brute_force/README.rst @@ -39,9 +39,14 @@ of attempts allowed before the user was banned. You can also add a ir.config_parameter value for the key 'auth_brute_force.environ_log' which allows to log also specific request -environment variables. The format comma-delimited list of varible names +environment variables. + +The format is a comma-delimited list of variable names example: REMOTE_ADDR,REMOTE_PORT +or you can just use the jocker '*' for log or discover all variables, +the variable names depends of the reverse-proxy configuration. + Usage ----- diff --git a/auth_brute_force/controllers/controllers.py b/auth_brute_force/controllers/controllers.py index 14fa09e0f..acee0f3c6 100644 --- a/auth_brute_force/controllers/controllers.py +++ b/auth_brute_force/controllers/controllers.py @@ -76,10 +76,10 @@ class LoginController(Home): environ = '' if environ_log: - value = environ_log[0]['value'] - log_keys = [k.strip() for k in value.split(',')] + filter_value = environ_log[0]['value'] + filter_keys = [k.strip() for k in filter_value.split(',')] for key, value in request.httprequest.environ.items(): - if key in log_keys: + if key in filter_keys or filter_value == '*': environ += '%s=%s\n' % (key, value) attempt_obj.create(cursor, SUPERUSER_ID, {