Skip to content

Commit

Permalink
update: automatically switch status from new to notified#
Browse files Browse the repository at this point in the history
  • Loading branch information
kaykhan committed Nov 15, 2024
1 parent 47efa94 commit eb26ec4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/notify_slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def format_aws_security_hub(message: Dict[str, Any], region: str) -> Dict[str, A
# Switch Status From New To Notified To Prevent Repeated Messages
try:
compliance_status = finding["Compliance"].get("Status", "UNKNOWN")
if compliance_status == "FAILED":
workflow_status = finding["Workflow"].get("Status", "UNKNOWN")
if compliance_status == "FAILED" and workflow_status == "NEW":
notified = SECURITY_HUB_CLIENT.batch_update_findings(
FindingIdentifiers=[{
'Id': finding.get('Id'),
Expand Down

0 comments on commit eb26ec4

Please sign in to comment.