Skip to main content

insights

Creates, updates, deletes or gets an insight resource or lists insights in a region

Overview

Nameinsights
TypeResource
DescriptionThe AWS::SecurityHub::Insight resource represents the AWS Security Hub Insight in your account. An AWS Security Hub insight is a collection of related findings.
Idaws.securityhub.insights

Fields

NameDatatypeDescription
insight_arnstringThe ARN of a Security Hub insight
namestringThe name of a Security Hub insight
filtersobjectOne or more attributes used to filter the findings included in the insight
group_by_attributestringThe grouping attribute for the insight's findings
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTFilters, Name, GroupByAttribute, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all insights in a region.

SELECT
region,
insight_arn,
name,
filters,
group_by_attribute
FROM aws.securityhub.insights
WHERE region = 'us-east-1';

Gets all properties from an individual insight.

SELECT
region,
insight_arn,
name,
filters,
group_by_attribute
FROM aws.securityhub.insights
WHERE region = 'us-east-1' AND data__Identifier = '<InsightArn>';

INSERT example

Use the following StackQL query and manifest file to create a new insight resource, using stack-deploy.

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

DELETE example

/*+ delete */
DELETE FROM aws.securityhub.insights
WHERE data__Identifier = '<InsightArn>'
AND region = 'us-east-1';

Permissions

To operate on the insights resource, the following permissions are required:

Create

securityhub:CreateInsight

Read

securityhub:GetInsights

Update

securityhub:UpdateInsight

Delete

securityhub:GetInsights,
securityhub:DeleteInsight

List

securityhub:GetInsights