Skip to content

Commit

Permalink
Merge pull request #175 from intelowlproject/develop
Browse files Browse the repository at this point in the history
fix runtime_configuration bug for file scan, Bump to v1.5.1
  • Loading branch information
eshaan7 committed Aug 28, 2020
2 parents 07ac4e9 + f816775 commit 7df1c7a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### the COMPOSE_FILE variable each separated with ':'. If you are on windows, replace all ':' with ';'.
### Reference to Docker's official Docs: https://docs.docker.com/compose/reference/envvars/#compose_file#compose_file

INTELOWL_TAG_VERSION=v1.5.0
INTELOWL_TAG_VERSION=v1.5.1

###### Default (Production) ######

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV DJANGO_SETTINGS_MODULE intel_owl.settings
ENV PYTHONPATH /opt/deploy/intel_owl
ENV LOG_PATH /var/log/intel_owl
ENV ELASTICSEARCH_DSL_VERSION 7.1.4
ENV watch_logs_cmd "watch -n1 tail -n10 /var/log/intel_owl/django/api_app.log"

RUN mkdir -p ${LOG_PATH} \
${LOG_PATH}/django ${LOG_PATH}/uwsgi \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile_nginx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Get build artifacts from intelowl-ng
FROM intelowlproject/intelowl_ng:v1.5.0 AS angular-prod-build
FROM intelowlproject/intelowl_ng:v1.5.1 AS angular-prod-build

# Stage 2: Inject the build artifacts into nginx container
FROM library/nginx:1.16.1-alpine
Expand Down
10 changes: 1 addition & 9 deletions api_app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,6 @@ def send_analysis_request(request):
{"error": "813"}, status=status.HTTP_400_BAD_REQUEST
)

runtime_conf = data_received.get("runtime_configuration", None)
if runtime_conf:
if not isinstance(runtime_conf, dict):
return Response(
{"error": "817"}, status=status.HTTP_400_BAD_REQUEST
)
params["runtime_configuration"] = runtime_conf

# we need to clean the list of requested analyzers,
# ... based on configuration data
analyzers_config = helpers.get_analyzer_config()
Expand Down Expand Up @@ -274,7 +266,7 @@ def send_analysis_request(request):
general.start_analyzers(
params["analyzers_to_execute"],
analyzers_config,
runtime_conf,
serialized_data["runtime_configuration"],
job_id,
md5,
is_sample,
Expand Down
10 changes: 10 additions & 0 deletions api_app/serializers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json

from django.contrib.auth.models import Group
from rest_framework import serializers
from rest_framework_guardian.serializers import ObjectPermissionsAssignmentMixin
Expand Down Expand Up @@ -99,6 +101,14 @@ def get_permissions_map(self, created):
"view_job": [*grps],
}

def validate(self, data):
# check and validate runtime_configuration
runtime_conf = data.get("runtime_configuration", {})
if runtime_conf and isinstance(runtime_conf, list):
runtime_conf = json.loads(runtime_conf[0])
data["runtime_configuration"] = runtime_conf
return data

def create(self, validated_data):
tags = validated_data.pop("tags_id", None)
job = Job.objects.create(**validated_data)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = "Matteo Lodi"

# The full version, including alpha/beta/rc tags
release = "1.5.0"
release = "1.5.1"


# -- General configuration ---------------------------------------------------
Expand Down

0 comments on commit 7df1c7a

Please sign in to comment.