From 29cec00013cbd6c0d55607c15dc96672f0afa0c6 Mon Sep 17 00:00:00 2001 From: jack1902 <39212456+jack1902@users.noreply.github.com> Date: Wed, 17 Apr 2019 12:34:58 +0100 Subject: [PATCH 1/2] return False if property not in deep_security_event --- send_deep_security_events_to_aws_security_hub.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/send_deep_security_events_to_aws_security_hub.py b/send_deep_security_events_to_aws_security_hub.py index 395a478..41acaa6 100644 --- a/send_deep_security_events_to_aws_security_hub.py +++ b/send_deep_security_events_to_aws_security_hub.py @@ -85,7 +85,6 @@ def verify_required_properties(deep_security_event): Verify if the specified Deep Security event contains the required properties to be convert to an Amazon Finding Format finding """ - result = False required_properties = [ 'HostOwnerID', @@ -104,10 +103,10 @@ def verify_required_properties(deep_security_event): ] for prop in required_properties: - if prop in deep_security_event: - result = True + if prop not in deep_security_event: + return False - return result + return True def convert_deep_security_event_to_aff(deep_security_event): """ From de47c623f1c01016d2df9da44d41f745d6fb562f Mon Sep 17 00:00:00 2001 From: jack1902 <39212456+jack1902@users.noreply.github.com> Date: Wed, 17 Apr 2019 12:35:23 +0100 Subject: [PATCH 2/2] updated comment, convert -> converted --- send_deep_security_events_to_aws_security_hub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/send_deep_security_events_to_aws_security_hub.py b/send_deep_security_events_to_aws_security_hub.py index 41acaa6..e21d4be 100644 --- a/send_deep_security_events_to_aws_security_hub.py +++ b/send_deep_security_events_to_aws_security_hub.py @@ -83,7 +83,7 @@ def generate_finding_title(title): def verify_required_properties(deep_security_event): """ Verify if the specified Deep Security event contains the required properties to - be convert to an Amazon Finding Format finding + be converted to an Amazon Finding Format finding """ required_properties = [