# Get alerted on security events

> Get notified of administration and security events in OpenCTI, such as failed logins or unauthorized actions, as soon as they happen or in a regular digest.

- URL: https://filigran.io/docs/opencti/configure/activity/triggers/
- Products: OpenCTI 7.261119.0
- Edition: requires an Enterprise Edition license
- For: administrators
- Type: How-to guide

An activity trigger watches the [activity events](https://filigran.io/docs/opencti/configure/activity/events/) and notifies chosen recipients when one matches its filters, so you do not have to watch the events screen. This page shows how to create a live trigger, which notifies at once, and a digest, which groups the events of live triggers over a period. To be notified about knowledge rather than activity, use [knowledge triggers](https://filigran.io/docs/opencti/use/automate/notifications/).

## Before you start {#before-you-start}

- Your platform has an Enterprise Edition license.
- Your role has the **Access security activity** capability.
- The events you want to watch are recorded: extended events, such as reads and downloads, need the users to be [listened to](https://filigran.io/docs/opencti/configure/activity/configuration/).
- To notify by email, the platform can send emails: see [Send emails from OpenCTI](https://filigran.io/docs/opencti/administer/smtp/).

## Create a live trigger {#create-a-live-trigger}

1. Open **Settings > Activity > Alerting** and click **Create Live trigger**. The **Create a live activity trigger** panel opens.
2. Enter a **Name** and a **Description** that say what the trigger watches.
3. In **Notifiers**, choose how recipients are told: **User interface** for the notification center, **Default mailer** for an email, or a [notifier](https://filigran.io/docs/opencti/configure/notifiers/) you created. Leave it empty for a trigger that only feeds a [digest](#create-a-digest): it then tells nobody on its own.
4. In **Recipients**, add the users, groups or organizations to notify. At least one is required.
5. Add filters to keep only the events that matter. Combine them as in any OpenCTI filter.

   | Filter | Matches | Example |
   | --- | --- | --- |
   | **Event type** | The type of event | `authentication` |
   | **Event scope** | The scope within the type | `login` |
   | **User** | The user who acted | A contractor account |
   | **Group** | A group of the user who acted | `Administrators` |
   | **Organization** | An organization of the user who acted | A partner organization |

6. Click **Create**.

   ![The Create a live activity trigger panel with the Name and Description fields, the notifiers and recipients fields, and the filter bar limited to activity filters.](https://filigran.io/docs/shots/863cea0465380bb12f328e1284e8c6bb21d788418daf2a92fab50bb8b7a38ef1.webp)

For example, to hear about login failures, filter on **Event type** `authentication` and **Event scope** `login`; failed logins carry the status error. To catch attempts to go beyond one's rights, filter on **Event scope** `unauthorized`.

**Example: Alert administrators when a contractor oversteps**

The contractors of Harbor Security work on the Example CERT platform with limited rights. The administrators want to know at once when one of them tries an action their role does not allow.

- **Name**: `Contractor unauthorized actions`
- **Description**: `Harbor contractors trying actions outside their role`
- **Notifiers**: **User interface** and **Default mailer**
- **Recipients**: the **Administrators** group
- Filters: **Event scope** `unauthorized`, and **Group** `Harbor contractors`

The two filters combine with AND, so analysts of Example CERT who hit a missing capability do not raise the alert. When Sam Reyes, a member of Harbor contractors, tries to delete a report, every administrator gets a notification and an email naming Sam Reyes and the refused action.

## Create a digest {#create-a-digest}

A digest sends, at a set time, the events that one or more live triggers caught over the last period: the last day for a daily digest, the last week for a weekly one. When none of its triggers caught anything, no digest is sent. Use it for events worth a weekly review rather than an immediate alert, and create the live triggers first.

1. In **Settings > Activity > Alerting**, click **Create Regular digest**. The **Create a regular activity digest** panel opens.
2. Enter a **Name** and a **Description**.
3. In **Triggers**, choose the live triggers to group. At least one is required.
4. Choose the **Period**: **hour**, **day** (the default), **week** or **month**. For a week, choose the **Week day**; for a month, the **Month day**. Except for an hourly digest, set the **Time** of sending, in your browser's time zone. It starts at 12:00 AM.
5. Choose at least one notifier in **Notifiers** and at least one recipient in **Recipients**, then click **Create**. A recipient of the digest only gets the events of the live triggers they are also a recipient of: add them to those triggers too.

   ![The Create a regular activity digest panel with the Name, Description and Triggers fields, the Period set to day, the Time field, and the Notifiers and Recipients fields.](https://filigran.io/docs/shots/329494b170da24d53b38274921335aa3e3a420104dec568e0cf8b69f06389755.webp)

## Check that it works {#check-that-it-works}

Make the trigger fire: for a login trigger, log out and log in again, or enter a wrong password. The recipients get a notification, in their notification center or by email, that names the user and the event. If nothing arrives, check the filters against the event in **Settings > Activity > Events**.

## Change or delete a trigger {#change-or-delete-a-trigger}

Open the row menu of the trigger in **Settings > Activity > Alerting** and choose **Update** or **Delete**. **Update** opens **Update an activity live trigger** or **Update an activity digest trigger**, with the fields of the creation panel; each change is saved when you leave the field. The list shows the **Type** of each trigger, live or digest, and its **Notification** channels.

## What's next {#what-s-next}

- [Activity events](https://filigran.io/docs/opencti/configure/activity/events/) for every type and scope you can filter on.
- The [audit event reference](https://filigran.io/docs/reference/opencti/audit-events/) for the message of each event a trigger can catch.
- [Notifiers](https://filigran.io/docs/opencti/configure/notifiers/) to send notifications to a webhook or another channel.
