diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b83cfa..e6bdf9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## 1.2.x +### 1.2.3 +#### Bugfix +* Fixed KeyError('ip') in process_user function ### 1.2.2 #### Bugfix * Updated setup_config management command in order to overwrite the configs diff --git a/buffalogs/impossible_travel/tasks.py b/buffalogs/impossible_travel/tasks.py index 75d9408..1c8bf28 100644 --- a/buffalogs/impossible_travel/tasks.py +++ b/buffalogs/impossible_travel/tasks.py @@ -138,6 +138,7 @@ def process_user(db_user, start_date, end_date): .query("match", **{"user.name": db_user.username}) .query("match", **{"event.outcome": "success"}) .query("match", **{"event.type": "start"}) + .query("exists", field="source.ip") .source( includes=[ "user.name", @@ -225,6 +226,7 @@ def exec_process_logs(start_date, end_date): .query("match", **{"event.category": "authentication"}) .query("match", **{"event.outcome": "success"}) .query("match", **{"event.type": "start"}) + .query("exists", field="user.name") .exclude("terms", **{"user.name": config.ignored_users}) .exclude("terms", **{"source.ip": config.ignored_ips}) ) diff --git a/django-buffalogs/buffalogs.egg-info/PKG-INFO b/django-buffalogs/buffalogs.egg-info/PKG-INFO index b28ac82..7377fdf 100644 --- a/django-buffalogs/buffalogs.egg-info/PKG-INFO +++ b/django-buffalogs/buffalogs.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: buffalogs -Version: 1.2.2 +Version: 1.2.3 Summary: A Django app to detect anomaly logins. Home-page: UNKNOWN Author: Lorena Goldoni diff --git a/django-buffalogs/buffalogs.egg-info/SOURCES.txt b/django-buffalogs/buffalogs.egg-info/SOURCES.txt index e235210..281575b 100644 --- a/django-buffalogs/buffalogs.egg-info/SOURCES.txt +++ b/django-buffalogs/buffalogs.egg-info/SOURCES.txt @@ -4,7 +4,6 @@ README.rst pyproject.toml setup.cfg setup.py -../docs/static/cover_buffalogs.png buffalogs.egg-info/PKG-INFO buffalogs.egg-info/SOURCES.txt buffalogs.egg-info/dependency_links.txt diff --git a/django-buffalogs/setup.cfg b/django-buffalogs/setup.cfg index 5fc601a..ab14d01 100644 --- a/django-buffalogs/setup.cfg +++ b/django-buffalogs/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = buffalogs -version = 1.2.2 +version = 1.2.3 description = A Django app to detect anomaly logins. long_description = file: README.rst author = Lorena Goldoni