|
| 1 | +# Tutorial: Automate Extraction of Observables from Emails |
| 2 | + |
| 3 | +<!-- md:permission `manageConfig` --> <!-- md:license Gold --> <!-- md:license Platinum --> |
| 4 | + |
| 5 | +When an [email intake connector](../administration/email-intake-connector/about-email-intake-connectors.md) processes an incoming email, it creates an alert in TheHive with several observables, including the email file itself. However, the email body isn't parsed for observables by default—you need to run the *EmlParser* analyzer to extract them. |
| 6 | + |
| 7 | +In this tutorial, we're going to set up an automation in TheHive that runs the *EmlParser* analyzer automatically each time an email intake alert is created. |
| 8 | + |
| 9 | +!!! warning "Prerequisites" |
| 10 | + This tutorial assumes you've already [configured an email intake connector](../administration/email-intake-connector/connect-a-mailbox.md) for your TheHive instance. |
| 11 | + |
| 12 | +By the end, you'll have a working configuration that: |
| 13 | + |
| 14 | +* Detects when an observable is created from an email intake connector alert |
| 15 | +* Automatically runs the *EmlParser* analyzer to extract observables from the email body |
| 16 | + |
| 17 | +This eliminates the need to manually run the analyzer for each email alert. |
| 18 | + |
| 19 | +## Step 1: Create a notification triggered by email intake alerts |
| 20 | + |
| 21 | +1. {% include-markdown "includes/organization-view-go-to.md" %} |
| 22 | + |
| 23 | +2. {% include-markdown "includes/notifications-tab-go-to.md" %} |
| 24 | + |
| 25 | +3. Select :fontawesome-solid-plus:. |
| 26 | + |
| 27 | +4. In the **Add notification** drawer, enter the name of the notification: `EmailObservableExtractionNotification` |
| 28 | + |
| 29 | +5. Select the *FilteredEvent* trigger. |
| 30 | + |
| 31 | +6. Enter the following custom filter to match observable creation events from email intake alerts: |
| 32 | + |
| 33 | + ```json |
| 34 | + { |
| 35 | + "_and": [ |
| 36 | + { |
| 37 | + "_is": { |
| 38 | + "action": "create" |
| 39 | + } |
| 40 | + }, |
| 41 | + { |
| 42 | + "_is": { |
| 43 | + "objectType": "Observable" |
| 44 | + } |
| 45 | + }, |
| 46 | + { |
| 47 | + "_is": { |
| 48 | + "object.alert.type": "email-intake" |
| 49 | + } |
| 50 | + } |
| 51 | + ] |
| 52 | + } |
| 53 | + ``` |
| 54 | + |
| 55 | +## Step 2: Configure a *RunAnalyzer* notifier |
| 56 | + |
| 57 | +1. In your current notification, select the [*RunAnalyzer* notifier](./organization/configure-organization/manage-notifications/notifiers/analyzers.md). |
| 58 | + |
| 59 | +2. In the **RunAnalyzer** drawer, select **EmlParser**. |
| 60 | + |
| 61 | +3. Select **Confirm**. |
| 62 | + |
| 63 | +That's it—every time a new email intake observable is created, TheHive will automatically run the *EmlParser* analyzer to extract observables from the email content. |
| 64 | + |
| 65 | +<h2>Next steps</h2> |
| 66 | + |
| 67 | +* [About Email Intake Connectors](../administration/email-intake-connector/about-email-intake-connectors.md) |
| 68 | +* [Connect a Mailbox](../administration/email-intake-connector/connect-a-mailbox.md) |
| 69 | +* [Manually Trigger Email Fetch in a Mailbox](../administration/email-intake-connector/fetch-emails.md) |
0 commit comments