# Amazon GuardDuty

[<mark style="color:blue;">Amazon GuardDuty</mark>](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_settingup.html) is a continuous security monitoring service that analyzes and processes data sources, such as AWS CloudTrail data events for Amazon S3 logs, CloudTrail management event logs, DNS logs, Amazon EBS volume data, Amazon EKS audit logs, and Amazon VPC flow logs.

### How to integrate Amazon GuardDuty with Squadcast

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4fbd74e7ca0b30173c47a1d58ed6a0804a0465aa%2FAlert_Sources.png?alt=media&#x26;token=aaca6610-9d18-4dd4-9cf5-320042f326f1" alt="Integration of Amazon GuardDuty with Squadcast" width="563"><figcaption></figcaption></figure>

2\. Select **Amazon GuardDuty**. Copy the displayed **Webhook URL** to [<mark style="color:blue;">configure</mark>](#in-aws-configure-sns-endpoint) it within **Amazon GuardDuty**. Finish by clicking **Add Alert Source** -> **Done**.

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-bcd545141ac82ab636c577846f8cbd364e0df18f%2Fguardduty_000.png?alt=media" alt="Webhook URL configuration within Amazon GuardDuty" width="563"><figcaption></figcaption></figure>

{% hint style="warning" %} <mark style="color:orange;">**Important**</mark>**:**

When an alert source turns <mark style="color:green;">Active</mark>, it’ll show up under Configured Alert Sources, you can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source.

An Alert Source is <mark style="color:green;">active</mark> if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

### In AWS: Configure SNS Endpoint

1. Log in to your AWS account and proceed to **SNS**
2. Click on **Create topic**
3. Within the dialog box, fill in the details as per your requirements and then click on **Create topic**

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4541ecbbf40e83f6469f4eae260d8c147dbdcd89%2Fevent_rules_2.png?alt=media&#x26;token=f5f3f381-e201-4c79-866a-e6ecc39c53ed" alt="Configure SNS Endpoint In AWS - Create Topic" width="563"><figcaption></figcaption></figure>

4. Inside the topic, click on **Create Subscription**

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-0ddd1a57bb31506f76fc6efdf03e5a1b99b20394%2Fevent_rules_3.png?alt=media&#x26;token=12279a7e-b525-4aee-9fcb-a47407dcd2fc" alt="Create subscription inside the topic to Configure SNS Endpoint in AWS" width="563"><figcaption></figcaption></figure>

5. Select the protocol as **HTTPS** and in the endpoint enter the URL you obtained from the previous step.
6. Finally, click on **Create Subscription** to create the subscription

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-ccd8add4633cddda8e48c25513e7692a44d95d6c%2Fguardduty_1.png?alt=media" alt="Select the protocol as HTTPS and in the endpoint to configuration" width="563"><figcaption></figcaption></figure>

{% hint style="warning" %} <mark style="color:orange;">**Important**</mark>**:**

The **Subscription ID** for the subscription should immediately change to **Confirmed** from **PendingConfirmation**. Click on the refresh button to verify the same.
{% endhint %}

### In AWS: Configure GuardDuty

1. If you have not enabled **GuardDuty**, please [follow Amazon’s documentation](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_settingup.html#guardduty_enable-gd).

Or, if you have already enabled **GuardDuty**, skip to step 2

2. Once you have enabled **GuardDuty**, you can begin building EventBridge Rules to send alerts to **Squadcast**. Search and select EventBridge from the Services search bar
3. Select Rules from the left menu, then click **Create Rule**. One or more rules can be created to send specific events to **Squadcast** when a **GuardDuty finding** is opened

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-514a3e5d29e4328cefe2da51012c11446879ab93%2Fguardduty_2.png?alt=media" alt="Configure GuardDuty in AWS - Create rules" width="303"><figcaption></figcaption></figure>

4. On the next page, perform the following:

* **Name**: Enter a **name** that can be easily identified
* **Description** (optional): Enter a **description** of the rule, pattern, and target(s)
* **Event Bus**: Select **Default**
* **Enable the rule on the selected event bus**: Toggle to the **on** position
* **Rule with an event pattern**: This will automatically be preselected
* Click **Next** to continue

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-6aaf8fc48d9eb177a2cacecf045c27043ce66961%2Fguardduty_3.png?alt=media" alt="select AWS event source as AWS events or EventBridge partner events" width="563"><figcaption></figcaption></figure>

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-08959680f43771e5ccc6281882ea86d2c157cdc5%2Fguardduty_4.png?alt=media&#x26;token=558d9b9d-4915-46f9-96b8-92674bfd7e51" alt="Selection of AWS event in sample event" width="563"><figcaption></figcaption></figure>

5. On the next page, perform the following:

* **Event source**: Select **AWS events or EventBridge partner events**
* **Sample event** (optional): If you would like to view sample events, you may do so in this section
* **Event Source**: Select **AWS services**
* **AWS Service**: Select **GuardDuty**
* **Event type**: Select **GuardDuty Finding**
* Click **Next** to continue

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-e11f511f6b7ad03c0674cc69de2b0c35dea2728a%2Fguardduty_5.png?alt=media" alt="Event Pattern: Event source: AWS service, AWS service: GuardDuty Event type: GuardDuty finding" width="563"><figcaption></figcaption></figure>

6. On the next page, perform the following:

* **Target types**: Select **AWS service**
* **Select a target**: Search and select **SNS topic**
* **Topic**: Search and select the topic created in previous steps
* Configure other additional settings to your preference
* Click **Next** to continue

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-70fb711202851b65d312415fd8563ef2780e579c%2Fguardduty_6.png?alt=media" alt="Selection of Target type: AWS service, target: SNS topic, Topic: Squadcast delivery to complete guardDuty integration" width="563"><figcaption></figcaption></figure>

7. On the next page, optionally add tags to your preference. Click **Next** to continue
8. On the final page, review your settings and click **Create Rule**. If you would like to create more rules, repeat steps 3-7

That's it, you are good to go!

* Your Amazon GuardDuty integration is complete. Now, whenever an event is triggered that matches your Event Rules, an incident will be created in Squadcast for it.

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*
