Skip to main content

insights

Creates, updates, deletes, gets or lists an insights resource.

Overview

Nameinsights
TypeResource
Idaws.securityhub.insights

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
filtersobjectA collection of filters that are applied to all active findings aggregated by Security Hub CSPM. You can filter by up to ten finding attributes. For each attribute, you can provide up to 20 filter values.
group_by_attributestringThe grouping attribute for the insight's findings. Indicates how to group the matching findings, and 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. (pattern: <code>.\S.</code>)
insight_arnstringThe ARN of a Security Hub CSPM insight. (pattern: <code>.\S.</code>)
namestringThe name of a Security Hub CSPM insight. (pattern: <code>.\S.</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_insightsselectregionLists and describes insights for the specified insight ARNs.
create_insightinsertregion, GroupByAttributeCreates 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.
update_insightupdateinsight_arn, regionUpdates the Security Hub CSPM insight identified by the specified insight ARN.
delete_insightdeleteinsight_arn, regionDeletes the insight specified by the InsightArn.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
insight_arnstringThe ARN of the insight to delete.
regionstringAWS region (default: us-east-1)

SELECT examples

Lists and describes insights for the specified insight ARNs.

SELECT
filters,
group_by_attribute,
insight_arn,
name
FROM aws.securityhub.insights
WHERE region = '{{ region }}' -- required
;

INSERT examples

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.

INSERT INTO aws.securityhub.insights (
Name,
Filters,
GroupByAttribute,
region
)
SELECT
'{{ Name }}',
'{{ Filters }}',
'{{ GroupByAttribute }}' /* required */,
'{{ region }}'
RETURNING
insight_arn
;

UPDATE examples

Updates the Security Hub CSPM insight identified by the specified insight ARN.

UPDATE aws.securityhub.insights
SET
Name = '{{ Name }}',
Filters = '{{ Filters }}',
GroupByAttribute = '{{ GroupByAttribute }}'
WHERE
insight_arn = '{{ insight_arn }}' --required
AND region = '{{ region }}' --required;

DELETE examples

Deletes the insight specified by the InsightArn.

DELETE FROM aws.securityhub.insights
WHERE insight_arn = '{{ insight_arn }}' --required
AND region = '{{ region }}' --required
;