Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: Created custom insight with account name filter #40848

Open
tndrs opened this issue Jan 9, 2025 · 1 comment
Open

[Enhancement]: Created custom insight with account name filter #40848

tndrs opened this issue Jan 9, 2025 · 1 comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/securityhub Issues and PRs that pertain to the securityhub service.

Comments

@tndrs
Copy link

tndrs commented Jan 9, 2025

Description

We are currently using manually created CustomInsights that show findings over all environments, which are filtered by Account name prefixes:

Sample output from aws cli

aws securityhub get-insights --query "Insights[?Name=='MyCustomInsight']" --output json

          "AwsAccountName": [
                {
                    "Value": "myaccounts",
                    "Comparison": "PREFIX"
                }
            ]

the actual accounts are named myaccounts-dev, myaccounts-int, myaccounts-prod

It seems currently not possible to recreate this within resource aws_securityhub_insight since the option to filter by account name is not existing.
Putting the account IDs to filter conditions instead is only a workaround.

Could this filter condition be implemented as well?

Affected Resource(s) and/or Data Source(s)

resource aws_securityhub_insight

Potential Terraform Configuration

resource "aws_securityhub_insight" "custom_insight" {
  name               = "MyCustomTFInsight"
  group_by_attribute = "ProductName"

  filters {
    account_name {
      comparison = "PREFIX"
      value      = "myaccounts"
    }
}

References

https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_CreateInsight.html

Would you like to implement a fix?

No

@tndrs tndrs added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 9, 2025
@github-actions github-actions bot added service/securityhub Issues and PRs that pertain to the securityhub service. needs-triage Waiting for first response or review from a maintainer. labels Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@justinretzolk justinretzolk added good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/securityhub Issues and PRs that pertain to the securityhub service.
Projects
None yet
Development

No branches or pull requests

2 participants