Skip to content
Permalink
Browse files
1.7.2
  • Loading branch information
MaKyOtOx committed Nov 9, 2021
1 parent 5199074 commit 0eac0e567bab6320b51709c9ef8b58d8302d5687
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
@@ -1,6 +1,6 @@
FROM python:3.7-slim
MAINTAINER Patrowl.io "getsupport@patrowl.io"
LABEL Name="PatrowlManager" Version="1.7.1"
LABEL Name="PatrowlManager" Version="1.7.2"

ENV PYTHONUNBUFFERED 1
ARG arg_http_proxy
@@ -1 +1 @@
1.7.1 // Community Edition
1.7.2 // Community Edition
@@ -1 +1,2 @@
# -*- coding: utf-8 -*-
ASSET_DETECTION_RULES = {}
@@ -675,6 +675,12 @@ def _create_asset_on_import(asset_value, scan, asset_type='unknown', parent=None
}
asset = Asset(**asset_args)
asset.save()

# Add teams related to scan
for team in scan.scan_definition.teams.all():
asset.teams.add(team)

# Add the asset to the scan
scan.assets.add(asset)

# Then add the asset to every related asset groups
@@ -190,11 +190,9 @@ def save(self, apply_overrides=False, *args, **kwargs):
def rawfinding_create_update_log(sender, **kwargs):
from events.models import Event
if kwargs['created']:
Event.objects.create(message="[RawFinding] New raw finding created (id={}): {}".format(kwargs['instance'].id, kwargs['instance']),
type="CREATE", severity="DEBUG")
Event.objects.create(message="[RawFinding] New raw finding created (id={}): {}".format(kwargs['instance'].id, kwargs['instance']), type="CREATE", severity="DEBUG")
else:
Event.objects.create(message="[RawFinding] Raw finding '{}' modified (id={})".format(kwargs['instance'], kwargs['instance'].id),
type="UPDATE", severity="DEBUG")
Event.objects.create(message="[RawFinding] Raw finding '{}' modified (id={})".format(kwargs['instance'], kwargs['instance'].id), type="UPDATE", severity="DEBUG")


@receiver(post_delete, sender=RawFinding)
@@ -275,6 +273,14 @@ def save(self, apply_overrides=False, *args, **kwargs):
self.updated_at = timezone.now()
return super(Finding, self).save(*args, **kwargs)

def evaluate_assets(self):
"""Create assets by analysing results."""
# print("evaluate_assets", settings.ASSET_DETECTION_RULES)
new_assets = []
rules = settings.ASSET_DETECTION_RULES
for rule in rules:
print(rule)
return new_assets

def evaluate_alert_rules(self, trigger='all'):
if trigger == "all":
@@ -29,14 +29,6 @@
('periodic', 'periodic'),
('scheduled', 'scheduled'),
)
#
# SCAN_STATUS = (
# ('created', 'Created'),
# ('enqueued', 'Enqueued'),
# ('started', 'Started'),
# ('finished', 'Finished'),
# ('error', 'Error'),
# )

SCAN_JOB_STATUS = (
('started', 'Started'),

0 comments on commit 0eac0e5

Please sign in to comment.