getFindings

abstract suspend fun getFindings(input: GetFindingsRequest = GetFindingsRequest { }): GetFindingsResponse

Returns a list of findings that match the specified criteria.

If cross-Region aggregation is enabled, then when you call GetFindings from the home Region, the results include all of the matching findings from both the home Region and linked Regions.

Samples

// The following example returns a filtered and sorted list of Security Hub findings.
val resp = securityHubClient.getFindings {
    filters = AwsSecurityFindingFilters {
        awsAccountId = listOf<StringFilter>(
            StringFilter {
                value = "123456789012"
                comparison = StringFilterComparison.fromValue("PREFIX")
            }                
        )
    }
    maxResults = 1
}