Skip to content

Commit 7df1c7a

Browse files
authored
Merge pull request #175 from intelowlproject/develop
fix runtime_configuration bug for file scan, Bump to v1.5.1
2 parents 07ac4e9 + f816775 commit 7df1c7a

File tree

6 files changed

+15
-12
lines changed

6 files changed

+15
-12
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### the COMPOSE_FILE variable each separated with ':'. If you are on windows, replace all ':' with ';'.
66
### Reference to Docker's official Docs: https://docs.docker.com/compose/reference/envvars/#compose_file#compose_file
77

8-
INTELOWL_TAG_VERSION=v1.5.0
8+
INTELOWL_TAG_VERSION=v1.5.1
99

1010
###### Default (Production) ######
1111

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ENV DJANGO_SETTINGS_MODULE intel_owl.settings
55
ENV PYTHONPATH /opt/deploy/intel_owl
66
ENV LOG_PATH /var/log/intel_owl
77
ENV ELASTICSEARCH_DSL_VERSION 7.1.4
8+
ENV watch_logs_cmd "watch -n1 tail -n10 /var/log/intel_owl/django/api_app.log"
89

910
RUN mkdir -p ${LOG_PATH} \
1011
${LOG_PATH}/django ${LOG_PATH}/uwsgi \

Dockerfile_nginx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1: Get build artifacts from intelowl-ng
2-
FROM intelowlproject/intelowl_ng:v1.5.0 AS angular-prod-build
2+
FROM intelowlproject/intelowl_ng:v1.5.1 AS angular-prod-build
33

44
# Stage 2: Inject the build artifacts into nginx container
55
FROM library/nginx:1.16.1-alpine

api_app/api.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,6 @@ def send_analysis_request(request):
211211
{"error": "813"}, status=status.HTTP_400_BAD_REQUEST
212212
)
213213

214-
runtime_conf = data_received.get("runtime_configuration", None)
215-
if runtime_conf:
216-
if not isinstance(runtime_conf, dict):
217-
return Response(
218-
{"error": "817"}, status=status.HTTP_400_BAD_REQUEST
219-
)
220-
params["runtime_configuration"] = runtime_conf
221-
222214
# we need to clean the list of requested analyzers,
223215
# ... based on configuration data
224216
analyzers_config = helpers.get_analyzer_config()
@@ -274,7 +266,7 @@ def send_analysis_request(request):
274266
general.start_analyzers(
275267
params["analyzers_to_execute"],
276268
analyzers_config,
277-
runtime_conf,
269+
serialized_data["runtime_configuration"],
278270
job_id,
279271
md5,
280272
is_sample,

api_app/serializers.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import json
2+
13
from django.contrib.auth.models import Group
24
from rest_framework import serializers
35
from rest_framework_guardian.serializers import ObjectPermissionsAssignmentMixin
@@ -99,6 +101,14 @@ def get_permissions_map(self, created):
99101
"view_job": [*grps],
100102
}
101103

104+
def validate(self, data):
105+
# check and validate runtime_configuration
106+
runtime_conf = data.get("runtime_configuration", {})
107+
if runtime_conf and isinstance(runtime_conf, list):
108+
runtime_conf = json.loads(runtime_conf[0])
109+
data["runtime_configuration"] = runtime_conf
110+
return data
111+
102112
def create(self, validated_data):
103113
tags = validated_data.pop("tags_id", None)
104114
job = Job.objects.create(**validated_data)

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = "Matteo Lodi"
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = "1.5.0"
25+
release = "1.5.1"
2626

2727

2828
# -- General configuration ---------------------------------------------------

0 commit comments

Comments
 (0)