From ded01bdfbadec32758ce1a234bf990688c0f831e Mon Sep 17 00:00:00 2001 From: Lorena Goldoni <33703137+Lorygold@users.noreply.github.com> Date: Fri, 29 Sep 2023 10:59:39 +0200 Subject: [PATCH] 1.2.3 (#74) * Setup config (#70) * Updated setup_config mgmt command * Updated CHANGELOG.md * Added cover * Update README.md * Managed values as a list * Refactoring * Removed comments * buffalogs_1_2_2 * 72 exception keyerror ip in process user (#73) * Fixed KeyError('ip') * Updated CHANGELOG.md * Added user.name exists in Elastic query * Version 1.2.3 --- CHANGELOG.md | 3 +++ buffalogs/impossible_travel/tasks.py | 2 ++ django-buffalogs/buffalogs.egg-info/PKG-INFO | 2 +- django-buffalogs/buffalogs.egg-info/SOURCES.txt | 1 - django-buffalogs/setup.cfg | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) 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