Skip to content

✨ Add support for global filtering by AWS tags.#6258

Merged
VasilSirakov merged 3 commits intomainfrom
vasil/aws-global-filtering
Dec 4, 2025
Merged

✨ Add support for global filtering by AWS tags.#6258
VasilSirakov merged 3 commits intomainfrom
vasil/aws-global-filtering

Conversation

@VasilSirakov
Copy link
Copy Markdown
Contributor

@VasilSirakov VasilSirakov commented Dec 4, 2025

In this PR:

  • Added support for global filtering by tags.
  • Removed the EC2-specific tags filters as a result.
  • Added helpers to reuse matching and AWS filter creation logic more easily.
  • Added unit tests.
  • Used resource name LR constants in a bunch of places.

There are way more AWS resources to apply this to, but this can happen in multiple subsequent PRs.

Examples:

No filters (everything is matched):
image

Exclude Created By: Mondoo tag (nothing is matched):
image

Include Created By: NotMondoo tag server-side (nothing is matched):
image

Include Created By: Mondoo tag server-side (all are matched):
image

return res, nil
}

func (a *mqlAwsEc2) getEc2Instances(ctx context.Context, svc *ec2.Client, filters connection.DiscoveryFilters) ([]ec2types.Reservation, error) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason to return a list of Reservation objects here because we only care about the underlying instances. Returning a list of Instance directly here simplifies things and allows us to enforce the client-side filters in the same function.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 4, 2025

Test Results

4 670 tests  +15   4 666 ✅ +15   2m 13s ⏱️ -7s
  415 suites ± 0       4 💤 ± 0 
   31 files   ± 0       0 ❌ ± 0 

Results for commit 1e2d913. ± Comparison against base commit 2dbc07f.

♻️ This comment has been updated with latest results.

@VasilSirakov VasilSirakov marked this pull request as ready for review December 4, 2025 09:43
Signed-off-by: Vasil Sirakov <sirakov97@gmail.com>
Signed-off-by: Vasil Sirakov <sirakov97@gmail.com>
Signed-off-by: Vasil Sirakov <sirakov97@gmail.com>
@VasilSirakov VasilSirakov force-pushed the vasil/aws-global-filtering branch from 116d809 to 1e2d913 Compare December 4, 2025 13:27
@VasilSirakov VasilSirakov merged commit 33ad462 into main Dec 4, 2025
24 of 25 checks passed
@VasilSirakov VasilSirakov deleted the vasil/aws-global-filtering branch December 4, 2025 16:09
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants