From 374874642d29c2e858e3ec6aa79dce82bee7dccf Mon Sep 17 00:00:00 2001 From: Costas Tyfoxylos Date: Sat, 6 Jan 2024 15:45:43 +0100 Subject: [PATCH] Add logging for rule matches. --- awsfindingsmanagerlib/awsfindingsmanagerlib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awsfindingsmanagerlib/awsfindingsmanagerlib.py b/awsfindingsmanagerlib/awsfindingsmanagerlib.py index 12b9c29..c791420 100755 --- a/awsfindingsmanagerlib/awsfindingsmanagerlib.py +++ b/awsfindingsmanagerlib/awsfindingsmanagerlib.py @@ -570,6 +570,8 @@ def get_findings(self): if resource_ids_patterns: matching_findings = [finding for finding in findings if finding.is_matching_resource_ids(resource_ids_patterns)] + self._logger.debug(f'Following findings matched with rule with note: "{rule.note}", ' + f'{[finding.id for finding in matching_findings]}') else: self._logger.debug('No resource id patterns are provided in the rule, all findings used.') matching_findings = findings