Skip to main content

automation_rules

Creates, updates, deletes or gets an automation_rule resource or lists automation_rules in a region

Overview

Nameautomation_rules
TypeResource
DescriptionThe AWS::SecurityHub::AutomationRule resource specifies an automation rule based on input parameters. For more information, see [Automation rules](https://docs.aws.amazon.com/securityhub/latest/userguide/automation-rules.html) in the *User Guide*.
Idaws.securityhub.automation_rules

Fields

NameDatatypeDescription
rule_arnstring
rule_statusstringWhether the rule is active after it is created. If this parameter is equal to ENABLED, ASH applies the rule to findings and finding updates after the rule is created.
rule_orderinteger
descriptionstring
rule_namestring
created_atstringThe date and time, in UTC and ISO 8601 format.
updated_atstringThe date and time, in UTC and ISO 8601 format.
created_bystring
is_terminalboolean
actionsarray
criteriaobjectA set of [Security Finding Format (ASFF)](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html) finding field attributes and corresponding expected values that ASH uses to filter findings. If a rule is enabled and a finding matches the criteria specified in this parameter, ASH applies the rule action to the finding.
tagsobjectA key-value pair to associate with a resource.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all automation_rules in a region.

SELECT
region,
rule_arn,
rule_status,
rule_order,
description,
rule_name,
created_at,
updated_at,
created_by,
is_terminal,
actions,
criteria,
tags
FROM aws.securityhub.automation_rules
WHERE region = 'us-east-1';

Gets all properties from an individual automation_rule.

SELECT
region,
rule_arn,
rule_status,
rule_order,
description,
rule_name,
created_at,
updated_at,
created_by,
is_terminal,
actions,
criteria,
tags
FROM aws.securityhub.automation_rules
WHERE region = 'us-east-1' AND data__Identifier = '<RuleArn>';

INSERT example

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

/*+ create */
INSERT INTO aws.securityhub.automation_rules (
RuleStatus,
RuleOrder,
Description,
RuleName,
IsTerminal,
Actions,
Criteria,
Tags,
region
)
SELECT
'{{ RuleStatus }}',
'{{ RuleOrder }}',
'{{ Description }}',
'{{ RuleName }}',
'{{ IsTerminal }}',
'{{ Actions }}',
'{{ Criteria }}',
'{{ Tags }}',
'{{ region }}';

DELETE example

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

Permissions

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

Create

securityhub:CreateAutomationRule,
securityhub:TagResource,
securityhub:ListTagsForResource

Read

securityhub:ListAutomationRules,
securityhub:BatchGetAutomationRules,
securityhub:ListTagsForResource

Update

securityhub:BatchUpdateAutomationRules,
securityhub:TagResource,
securityhub:UntagResource,
securityhub:ListTagsForResource

Delete

securityhub:BatchDeleteAutomationRules,
securityhub:BatchGetAutomationRules

List

securityhub:ListAutomationRules,
securityhub:ListTagsForResource