prowler: Cannot mute failed checks based on AWS tags using 4.3.0

Steps to Reproduce

  1. Create tagged AWS resources (tested with EC2 instances, IAM roles)
  2. Add tag-based mute list entry matching those resources
  3. 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)

Most upvoted comments

@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 master branch does fix the issue I’m having.

Thank you for getting this done quickly, I’m looking forward to seeing this released.

Hello @cetteup , could you please share with me some examples to help you craft a valid Mutelist for your use case? Something like the following:

  • Account/s
  • Check/s
  • Resource/s and their tag/s

Sorry for the late reply @jfagoagas.

We ended up just having to use the default name used by CDK for the mutelist, since it was an IAM inline policy - which ofc does not have any tags (only the role itself does). I originally wanted to avoid having to add something as generic as default to the mutelist, but there was no way around it. For this scenario, tags don’t matter. Though it would be nice to be able to mute findings by resource id, since that is more specific than muting any resource called default.

The idea regarding ORing resources and tags based on the following scenario: Given an account with two IAM roles. Role OrgRole is managed by the organisation admins and has no tags (which we cannot change, as it’s managed by them). Role LocalRole is managed by my team, so we can add whatever tags we like. The OrgRole forces us to mute IAM roles by name, as it does not have any tags. That’s fine given just our LocalRole, which is just one additional entry. But as soon as we start adding a bunch more local roles we need to mute the check for, our mutelist grows accordingly.

Having an option to mute OrgRole by name but still being able to mute manageable roles via tags would be great for this kind of scenario. Though, admittedly, I don’t know how common this is.

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.