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

feat(findings): add /findings/metadata to retrieve dynamic filters information #6503

Conversation

vicferpoy
Copy link
Member

Description

In order to improve the UI dynamic filters and add more information, we have developed a new endpoint GET /findings/metadata and deprecated GET /findings/findings_services_regions.

The response of this new endpoint includes resource tags and types:

{
    "data": {
        "type": "findings-metadata",
        "id": null,
        "attributes": {
            "services": [
                "accessanalyzer",
                "bedrock",
                "cloudformation",
                "cloudtrail",
                "cloudwatch",
                "config",
                "drs",
                "ec2",
                "emr",
                "eventbridge",
                "glue",
                "guardduty",
                "iam",
                "inspector2",
                "lightsail",
                "macie",
                "organizations",
                "resourceexplorer2",
                "s3",
                "securityhub",
                "support",
                "vpc"
            ],
            "regions": [
                "ap-northeast-1",
                "ap-northeast-2",
                "ap-northeast-3",
                "ap-south-1",
                "ap-southeast-1",
                "ap-southeast-2",
                "ca-central-1",
                "eu-central-1",
                "eu-north-1",
                "eu-south-2",
                "eu-west-1",
                "eu-west-2",
                "eu-west-3",
                "sa-east-1",
                "us-east-1",
                "us-east-2",
                "us-west-1",
                "us-west-2"
            ],
            "resource_types": [
                "AwsAccount",
                "AwsCloudFormationStack",
                "AwsCloudTrailTrail",
                "AwsEc2SecurityGroup",
                "AwsEc2Vpc",
                "AwsEc2VpcEndpointService",
                "AwsEventSchemasRegistry",
                "AwsEventsEventbus",
                "AwsGlueDataCatalog",
                "AwsGuardDutyDetector",
                "AwsIamPolicy",
                "AwsIamRole",
                "AwsIamUser",
                "AwsS3AccountPublicAccessBlock",
                "AwsS3Bucket",
                "Other"
            ],
            "tags": {
                "CloudFormation": "true",
                "Name": "ProwlerProSaaSScanRole",
                "Service": "https://prowler.pro",
                "Support": "[email protected]",
                "Version": "1.0.1"
            }
        }
    }
}

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@vicferpoy vicferpoy requested a review from a team as a code owner January 14, 2025 14:22
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 95.74468% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.67%. Comparing base (ab844ee) to head (ffbcb02).
Report is 64 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6503      +/-   ##
==========================================
- Coverage   93.78%   93.67%   -0.12%     
==========================================
  Files          65       65              
  Lines        6244     6304      +60     
==========================================
+ Hits         5856     5905      +49     
- Misses        388      399      +11     
Flag Coverage Δ
api 93.67% <95.74%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
prowler ∅ <ø> (∅)
api 93.67% <95.74%> (-0.12%) ⬇️

@vicferpoy vicferpoy merged commit 1846535 into master Jan 14, 2025
11 of 12 checks passed
@vicferpoy vicferpoy deleted the PRWLR-5936-refactor-findings-dynamic-filter-endpoints-to-include-tags-and-resource-types branch January 14, 2025 14:30
@jfagoagas
Copy link
Member

We need to backport this PR to v5.1 since this feature was backported there and requires the code present here #6524

@jfagoagas jfagoagas added the backport-to-v5.1 Backport PR to the v5.1 branch label Jan 17, 2025
@prowler-bot prowler-bot added the was-backported The PR was successfully backported to the target branch label Jan 17, 2025
@prowler-bot
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
v5.1

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@jfagoagas jfagoagas added backport-to-v5.1 Backport PR to the v5.1 branch and removed backport-to-v5.1 Backport PR to the v5.1 branch labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-v5.1 Backport PR to the v5.1 branch component/api was-backported The PR was successfully backported to the target branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants