create_insight
¶
create_insight(
*,
config_overrides: Optional[SecurityHubClientConfig] = None,
name: Optional[NonEmptyString] = None,
filters: Optional[AwsSecurityFindingFilters] = None,
group_by_attribute: Optional[NonEmptyString] = None,
) -> CreateInsightResponse
Creates a custom insight in Security Hub CSPM. An insight is a consolidation of findings that relate to a security issue that requires attention or remediation.
To group the related findings in the insight, use the GroupByAttribute.
Parameters:
-
name(Optional[NonEmptyString], default:None) –The name of the custom insight to create.
-
filters(Optional[AwsSecurityFindingFilters], default:None) –One or more attributes used to filter the findings included in the insight. The insight only includes findings that match the criteria defined in the filters.
-
group_by_attribute(Optional[NonEmptyString], default:None) –The attribute used to group the findings for the insight. The grouping attribute identifies the type of item that the insight applies to. For example, if an insight is grouped by resource identifier, then the insight produces a list of resource identifiers.
Raises:
-
InternalException–Internal server error.
-
InvalidAccessException–The account doesn't have permission to perform this action.
-
InvalidInputException–The request was rejected because you supplied an invalid or out-of-range value for an input parameter.
-
LimitExceededException–The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.
-
ResourceConflictException–The resource specified in the request conflicts with an existing resource.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create a custom insight The following example creates a custom insight in Security Hub. An insight is a collection of findings that relate to a security issue.
>>> client.create_insight(name='Critical role findings', filters={'ResourceType': [{'Comparison': 'EQUALS', 'Value': 'AwsIamRole'}], 'SeverityLabel': [{'Comparison': 'EQUALS', 'Value': 'CRITICAL'}]}, group_by_attribute='ResourceId')
Source code in docs_src/capo_securityhub/_services/security_hub.py
2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 | |