prowler: Cannot mute failed checks based on AWS tags using 4.3.0
Steps to Reproduce
- Create tagged AWS resources (tested with EC2 instances, IAM roles)
- Add tag-based mute list entry matching those resources
- Run prowler with the mutelist
Expected behavior
Findings related to the muted checks are reported as muted for the tagged resources.
Actual Result with Screenshots or Logs
Related findings are not muted, causing prowler to exit with a non-zero exit code. Additionally, no findings are muted for checks in the mutelist containing both specific resources as well as tags. Meaning not only do tag-based mutelist entries not work, they seem to break the entire mutelist entry for the relevant check.
Note: When the mutelist contains an empty array of tags for a check, the resource-based exclusions still work. Adding an empty string value also has no negative impact. But even adding one of the examples (environment=dev) breaks the resource-based muting.
How did you install Prowler?
From pip package (pip install prowler)
Environment Resource
Workstation/GitHub Actions
OS used
ubuntu-latest (GitHub Actions)/Fedora 40 Workstation
Prowler version
4.3.0
Pip version
24.2
Context
No warnings/errors are logged regarding our mutelist. When reverting back to 4.2.4, all findings are muted as expected using the exact same mutelist.
I could not find any obvious (to me) reason for the tags breaking while quickly looking through the mutelist code. My best guess is that this issue was somehow introduced by #4413 (just looking for changes to the mutelist added with 4.3.0).
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (22 by maintainers)
@jfagoagas, Sorry for being late to reply. I confirmed that the tag that works is listed first when querying for tags using the AWS CLI. I also confirmed, since the PR fixing this was merged, that the
masterbranch does fix the issue I’m having.Thank you for getting this done quickly, I’m looking forward to seeing this released.
It’s totally fine, now it is me who is late since I was OOO.
I get your use case and we’ll try to give it a thought to see if something can be made to improve it but I think is something not too common.
Regarding a way to use the resource UUID instead of the name is something that is in our roadmap to start thinking about it and see if it worths the change.
That’s exactly what I saw in some tests I did 🤔 Let me add some unit tests and see …
Thanks for the information @cetteup !
We have identified the issue and working now on a fix.
About your question, the mutelist acts as an OR.