Skip to content

Commit

Permalink
Merge pull request #68 from certego/develop
Browse files Browse the repository at this point in the history
1.2.1
  • Loading branch information
eugenioseveri authored Sep 25, 2023
2 parents c4f333d + e68585d commit 879c995
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 1.2.x
### 1.2.1
#### Bugfix
* Fixed Elasticsearch environment variable
* Renamed shared tasks
### 1.2.0
#### Features
* Implemented Certego shared CI 1.3.5
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Or download the application directly from the [Docker Hub](https://hub.docker.co

After that, there are two ways of running BuffaLogs, depending on your system configurations:
* if you already have an elastic cluster:
* set the address of the host into the `CERTEGO_BUFFALOGS_ELASTICSEARCH` variable in the `buffalogs.env` file
* set the address of the host into the `CERTEGO_ELASTICSEARCH` variable in the `buffalogs.env` file
* launch ` docker-compose up -d` to run the containers
* if you have no hosts with Elasticsearch installed on it, you can run it directly with Buffalogs:
* run `docker-compose -f docker-compose.yaml -f docker-compose.elastic.yaml up -d` in order to execute all the containers, included Elasticsearch and Kibana
Expand Down
4 changes: 2 additions & 2 deletions buffalogs/buffalogs/settings/certego.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

if CERTEGO_BUFFALOGS_ENVIRONMENT == ENVIRONMENT_DOCKER:

CERTEGO_BUFFALOGS_ELASTICSEARCH = os.environ.get("CERTEGO_BUFFALOGS_ELASTICSEARCH", "http://elasticsearch:9200/")
CERTEGO_ELASTICSEARCH = os.environ.get("CERTEGO_ELASTICSEARCH", "http://elasticsearch:9200/")
CERTEGO_BUFFALOGS_DB_HOSTNAME = "postgres"
CERTEGO_DEBUG = False
CERTEGO_BUFFALOGS_STATIC_ROOT = "/var/www/static/"
Expand All @@ -27,7 +27,7 @@
CERTEGO_BUFFALOGS_RABBITMQ_URI = f"amqp://guest:guest@{CERTEGO_BUFFALOGS_RABBITMQ_HOST}/"

elif CERTEGO_BUFFALOGS_ENVIRONMENT == ENVIRONMENT_DEBUG:
CERTEGO_BUFFALOGS_ELASTICSEARCH = os.environ.get("CERTEGO_BUFFALOGS_ELASTICSEARCH", "http://localhost:9200/")
CERTEGO_ELASTICSEARCH = os.environ.get("CERTEGO_ELASTICSEARCH", "http://localhost:9200/")
CERTEGO_BUFFALOGS_DB_HOSTNAME = "localhost"
CERTEGO_DEBUG = True
CERTEGO_BUFFALOGS_STATIC_ROOT = "impossible_travel/static/"
Expand Down
4 changes: 2 additions & 2 deletions buffalogs/impossible_travel/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def clear_models_periodically():
UsersIP.objects.filter(updated__lte=delete_ip_time).delete()


@shared_task(name="UpdateRiskLevelTask")
@shared_task(name="BuffalogsUpdateRiskLevelTask")
def update_risk_level():
"""Update users risk level depending on how many alerts were triggered"""
clear_models_periodically()
Expand Down Expand Up @@ -218,7 +218,7 @@ def exec_process_logs(start_date, end_date):
"""
logger.info(f"Starting at:{start_date} Finishing at:{end_date}")
config, op_result = Config.objects.get_or_create()
connections.create_connection(hosts=settings.CERTEGO_BUFFALOGS_ELASTICSEARCH, timeout=90, verify_certs=False)
connections.create_connection(hosts=settings.CERTEGO_ELASTICSEARCH, timeout=90, verify_certs=False)
s = (
Search(index=settings.CERTEGO_BUFFALOGS_ELASTIC_INDEX)
.filter("range", **{"@timestamp": {"gte": start_date, "lt": end_date}})
Expand Down
2 changes: 1 addition & 1 deletion buffalogs/impossible_travel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def get_users(request):
def get_all_logins(request, pk_user):
context = []
count = 0
connections.create_connection(hosts=[settings.CERTEGO_BUFFALOGS_ELASTICSEARCH], timeout=90)
connections.create_connection(hosts=[settings.CERTEGO_ELASTICSEARCH], timeout=90)
end_date = timezone.now()
start_date = end_date + timedelta(days=-365)
user_obj = User.objects.filter(id=pk_user)
Expand Down
2 changes: 1 addition & 1 deletion django-buffalogs/buffalogs.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: buffalogs
Version: 1.1.1
Version: 1.2.1
Summary: A Django app to detect anomaly logins.
Home-page: UNKNOWN
Author: Lorena Goldoni
Expand Down
2 changes: 1 addition & 1 deletion django-buffalogs/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = buffalogs
version = 1.2.0
version = 1.2.1
description = A Django app to detect anomaly logins.
long_description = file: README.rst
author = Lorena Goldoni
Expand Down

0 comments on commit 879c995

Please sign in to comment.