Skip to content

Commit d0dcb6c

Browse files
committed
update: automatically switch status from new to notified
1 parent ec51114 commit d0dcb6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

functions/notify_slack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ def format_aws_security_hub(message: Dict[str, Any], region: str) -> Dict[str, A
138138

139139
# Switch Status From New To Notified To Prevent Repeated Messages
140140
try:
141-
severity = finding["Severity"].get("Label", "INFORMATIONAL")
142-
if severity == "FAILED":
141+
compliance_status = finding["Compliance"].get("Status", "UNKNOWN")
142+
if compliance_status == "FAILED":
143143
notified = SECURITY_HUB_CLIENT.batch_update_findings(
144144
FindingIdentifiers=[{
145145
'Id': finding.get('Id'),

0 commit comments

Comments
 (0)