Improved documentation of create_ir_add_to_existing_finding

This commit is contained in:
Shay Nehmad 2019-09-02 11:00:57 +03:00
parent 9fc2bf886d
commit 107ac73366
1 changed files with 3 additions and 9 deletions

View File

@ -15,15 +15,9 @@ class SegmentationFinding(Finding):
@staticmethod @staticmethod
def create_or_add_to_existing_finding(subnets, status, segmentation_event): def create_or_add_to_existing_finding(subnets, status, segmentation_event):
""" """
If you're trying to add a Failed finding: Creates a segmentation finding. If a segmentation finding with the relevant subnets already exists, adds the
If the finding doesn't exist at all: create failed event to the existing finding, and the "worst" status is chosen (i.e. if the existing one is "Failed" it will
else: remain so).
if pass, turn to fail
add event
If you're trying to add a Passed finding:
If the finding doesn't exist at all: create Passed
else: add event
:param subnets: the 2 subnets of this finding. :param subnets: the 2 subnets of this finding.
:param status: STATUS_PASSED or STATUS_FAILED :param status: STATUS_PASSED or STATUS_FAILED