Skip to content

Commit eb26ec4

Browse files
committed
update: automatically switch status from new to notified#
1 parent 47efa94 commit eb26ec4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

functions/notify_slack.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ def format_aws_security_hub(message: Dict[str, Any], region: str) -> Dict[str, A
139139
# Switch Status From New To Notified To Prevent Repeated Messages
140140
try:
141141
compliance_status = finding["Compliance"].get("Status", "UNKNOWN")
142-
if compliance_status == "FAILED":
142+
workflow_status = finding["Workflow"].get("Status", "UNKNOWN")
143+
if compliance_status == "FAILED" and workflow_status == "NEW":
143144
notified = SECURITY_HUB_CLIENT.batch_update_findings(
144145
FindingIdentifiers=[{
145146
'Id': finding.get('Id'),

0 commit comments

Comments
 (0)