

# Viewing automation rules
<a name="view-automation-rules"></a>

An automation rule can be used to automatically update findings in Amazon Security Hub CSPM. For background information about how automation rules work, see [Understanding automation rules in Security Hub CSPM](automation-rules.md).

Choose your preferred method, and follow the steps to view your existing automation rules and the details of each rule.

To view a history of how automation rules have changed your findings, see [Reviewing finding details and history in Security Hub CSPM](securityhub-findings-viewing.md).

------
#### [ Console ]

**To view automation rules (console)**

1. Using the credentials of the Security Hub CSPM administrator, open the Amazon Security Hub CSPM console at [https://console.amazonaws.cn/securityhub/](https://console.amazonaws.cn/securityhub/).

1. In the navigation pane, choose **Automations**.

1. Choose a rule name. Alternatively, select a rule.

1. Choose **Actions** and **View**.

------
#### [ API ]

**To view automation rules (API)**

1. To view the automation rules for your account, run [`ListAutomationRules`](https://docs.amazonaws.cn/securityhub/1.0/APIReference/API_ListAutomationRules.html) from the Security Hub CSPM administrator account. This API returns the rule ARNs and other metadata for your rules. No input parameters are required for this API, but you can optionally provide `MaxResults` to limit the number of results and `NextToken` as a pagination parameter. The initial value of `NextToken` should be `NULL`.

1. For additional rule details, including the criteria and actions for a rule, run [`BatchGetAutomationRules`](https://docs.amazonaws.cn/securityhub/1.0/APIReference/API_BatchGetAutomationRules.html) from the Security Hub CSPM administrator account. Provide the ARNs of the automation rules that you want details for.

   The following example retrieves details for the specified automation rules. This example is formatted for Linux, macOS, or Unix, and it uses the backslash (\\) line-continuation character to improve readability.

   ```
   $ aws securityhub batch-get-automation-rules \
   --automation-rules-arns '["arn:aws-cn:securityhub:{{us-east-1:123456789012}}:automation-rule/{{a1b2c3d4-5678-90ab-cdef-EXAMPLE11111}}", "arn:aws-cn:securityhub:{{us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222}}"]' \
   --region {{us-east-1}}
   ```

------