# AWS Security Hub Integration

[AWS Security Hub](https://aws.amazon.com/security-hub/) is a security service that provides a comprehensive view of security alerts and compliance status across AWS accounts by aggregating findings from various AWS services and third-party tools. When used with ilert, Security Hub’s alerts are instantly routed to the right team members through multi-channel notifications and escalation policies, ensuring rapid response to security threats.

## How this integration works <a href="#create-alert-source" id="create-alert-source"></a>

AWS Security Hub generates finding events that are relayed by AWS EventBridge. If AWS EventBridge rules match, notifications will be published to specific Amazon Simple Notification Service (SNS) topics; the events will be sent to ilert.

## Architecture <a href="#create-alert-source" id="create-alert-source"></a>

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fbl4ZWLRQWgJJMkJRhFqk%2Fimage.png?alt=media&#x26;token=4f80eb15-7022-4ed8-aa10-16de6870ff64" alt=""><figcaption></figcaption></figure>

## In ilert: Create an Amazon SNS alert source <a href="#create-alert-source" id="create-alert-source"></a>

1. Go to **Alert sources** -> **Alert sources** and click on **Create new alert source**<br>

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FjX0cS4q7woTXKajZmc1W%2FScreenshot%202023-08-28%20at%2010.21.10.png?alt=media&#x26;token=8ef3666b-84eb-4b51-abee-f07303313941" alt=""><figcaption></figcaption></figure>
2. Search for **Amazon SNS** in the search field, click on the Amazon SNS tile and click on **Next**. <br>

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FlXzQlJpaTFSR49AZk0xA%2FScreenshot%202023-08-28%20at%2010.24.23.png?alt=media&#x26;token=cffeacb4-57b9-47d4-827d-b0f6b1afd914" alt=""><figcaption></figcaption></figure>
3. Give your alert source a name, optionally assign teams and click **Next**.
4. Select an **escalation policy** by creating a new one or assigning an existing one.<br>

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FNnuZqONaIhbOf6fn4OkZ%2FScreenshot%202023-08-28%20at%2011.37.47.png?alt=media&#x26;token=8a74f7b5-5bd2-4eea-97fa-1c1dbb041333" alt=""><figcaption></figcaption></figure>
5. Select you [Alert grouping](https://docs.ilert.com/alerting/configure-alerting/alert-sources#alert-grouping) preference and click **Continue setup**. You may click **Do not group alerts** for now and change it later. <br>

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FueugN4JgHn1c90ggFA6u%2FScreenshot%202023-08-28%20at%2011.38.24.png?alt=media&#x26;token=b8009daf-3ca8-4264-a6fa-e42ef7333205" alt=""><figcaption></figcaption></figure>
6. The next page show additional settings such as customer alert templates or notification prioritiy. Click on **Finish setup** for now.
7. On the final page, an API key and / or webhook URL will be generated that you will need later in this guide.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fq8AY87k6gfWEvNXuyKx5%2Fil-1.png?alt=media&#x26;token=2a93f17d-fb37-4a50-a9ac-acd877b06582" alt="" width="563"><figcaption></figcaption></figure>

## In AWS Security Hub: Create a Custom action <a href="#create-topic" id="create-topic"></a>

1. On the sidebar click on **Custom actions**.
2. Click on **Create custom action**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2F5PtWTbepZOM9s5aZbU8c%2F1.png?alt=media&#x26;token=bcb12734-6f64-467c-8599-91e088119019" alt="" width="563"><figcaption></figcaption></figure>

3. Enter a **Action name**, **Description** and a **Custom action ID**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FToJrQoejB8LxboHuPtCs%2F2.png?alt=media&#x26;token=b62ceeef-6556-4bb2-9bb0-f34174d03d45" alt="" width="563"><figcaption></figcaption></figure>

## In AWS SNS: Create a topic and a Subscription <a href="#create-topic" id="create-topic"></a>

1. On the sidebar navigate to **Topics** and click on **Create topic**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2F1F7Of4ejP7LvrPap4AVk%2F3-2.png?alt=media&#x26;token=91acc68f-1400-4d50-a1c4-e0d514e16b57" alt="" width="563"><figcaption></figcaption></figure>

2. Select **Standard** and enter a **Name**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FNhaJ7Zo0CKwoECYIihRd%2F4.png?alt=media&#x26;token=0437a322-bb93-4f8f-a9af-ea969306ce0f" alt="" width="563"><figcaption></figcaption></figure>

3. Save the topic.
4. Now create a new Subscription for this topic.
5. Select HTTPS as **Protocol** and Enter the in ilert previously generated alert source url as **Endpoint**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FVMR8l6ayPNvl09EcBV3t%2F5-3.png?alt=media&#x26;token=39aa03e3-4269-42a3-9592-4dafa0c7c558" alt="" width="563"><figcaption></figcaption></figure>

3. Click on **Create subscription**.

## In AWS EventBridge: Create an Event bus Rule <a href="#create-topic" id="create-topic"></a>

1. On the sidebar click on **Event buses** and then on **Create rule**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FZTgX3SfURZ1xEFaNOEUV%2F6-2.png?alt=media&#x26;token=dad9222e-eb0e-48ef-8845-fba7d937da63" alt="" width="563"><figcaption></figcaption></figure>

2. Enter a Name for the rule.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FYqmfkBon8ZwmLX7oUXbB%2F7.png?alt=media&#x26;token=83852342-7a37-4699-aa10-e3a39a72dca7" alt="" width="563"><figcaption></figcaption></figure>

3. Enter following Event pattern and click on **Next**:

```
{
    "source": [
        "aws.securityhub"
    ],
    "resources": [
        "< ARN OF THE CUSTOM ACTION CREATED IN SECURITY HUB >"
    ]
}
```

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FDOtNQNFpaXhA2ywdLmHb%2F8-2.png?alt=media&#x26;token=217ab978-544b-4e24-9e18-f4e0efe9fe34" alt="" width="563"><figcaption></figcaption></figure>

4. Select the previous created topic as target.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FHryxmYqRAmX4TSWV8y63%2F9.png?alt=media&#x26;token=94812946-cb47-4366-bf72-88ac815bbafb" alt="" width="563"><figcaption></figcaption></figure>

5. Click on **Create rule** to finish the setup.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2F9QVmMBdLALLSNG4x4iIl%2F10-2.png?alt=media&#x26;token=6a89be9a-4764-4430-b687-d2d5ff24dc42" alt="" width="563"><figcaption></figcaption></figure>

## FAQ <a href="#faq" id="faq"></a>

**Will alerts in ilert be resolved automatically?**

No, but you can use the **eventType** custom attribute to resolve an incident in specified **incidentKey**.
