> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/l/lucy-security.md).

# Lucy Security

|                                  |                                          |
| -------------------------------- | ---------------------------------------- |
| Category                         | Security awareness / phishing simulation |
| Asset types                      | Users                                    |
| Authentication                   | Email and password (token)               |
| Direction                        | OctoXLabs → Lucy Security (read only)    |
| Supported Lucy Security versions | Not specified                            |
| Available since                  | Not specified                            |

Lucy Security is a phishing simulation and awareness training platform that you run as an appliance. OctoXLabs reads its recipient groups and the recipients in each group and adds them to the user inventory.

## Use cases

* **Find recipients with no directory account.** List Lucy recipients that are not found in Active Directory. How accounts are matched depends on your user merge settings.

```
Adapters = lucy-security AND NOT Adapters = active-directory
```

* **Find recipients by location.** Review recipients of one location.

```
Adapters = lucy-security AND Location = <location>
```

## Before you begin

### Network

| Source              | Destination             | Port               | Protocol |
| ------------------- | ----------------------- | ------------------ | -------- |
| OctoXLabs connector | Lucy Security appliance | 443 (configurable) | HTTPS    |

Clear **Is Secure** to use HTTP. If a proxy is set, requests go through it.

### Required permissions

| Scope or role                        | Permission | Needed for |
| ------------------------------------ | ---------- | ---------- |
| Read recipients and recipient groups | Read       | Users      |

The baseline says the account must have permission to read recipients and recipient groups, because these endpoints collect the user data.

## Create credentials in Lucy Security

{% stepper %}
{% step %}

### Pick the account

Use the email and password of a Lucy account that can read recipients and recipient groups. It is the same account that signs in to the appliance (`POST /api/auth`).
{% endstep %}

{% step %}

### Note the host

Note the host name of the appliance, for example `phish.local` or `your-lucy-url.tld`.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter | Required | Type    | Default | Description                                                 |
| --------- | -------- | ------- | ------- | ----------------------------------------------------------- |
| IP        | Yes      | String  | None    | Host of the Lucy Security appliance.                        |
| Port      | No       | Integer | 443     | Port number.                                                |
| Is Secure | No       | Boolean | True    | Connect over HTTPS.                                         |
| Email     | Yes      | String  | None    | Login email of the Lucy account.                            |
| Password  | Yes      | String  | None    | Password of that account.                                   |
| Proxy     | No       | String  | None    | Proxy address, used as `http://<value>` for HTTP and HTTPS. |
| Timeout   | No       | Integer | 30      | Seconds to wait for an API response.                        |

## What the connection test does

The test signs in and requests one recipient group (`limit` 1, `offset` 0). It reports success when the request does not fail.

## API endpoints called

| Method | Path                                       | Purpose                                               |
| ------ | ------------------------------------------ | ----------------------------------------------------- |
| POST   | /api/auth                                  | Signs in with email and password and returns a token. |
| GET    | /api/recipient-groups                      | Lists recipient groups, 1000 per page.                |
| GET    | /api/recipient-groups/{groupId}/recipients | Lists the recipients of one group, 1000 per page.     |

No flat recipient list exists, so the connector walks groups and then the recipients of each group. A recipient in several groups is returned more than once. The platform removes duplicates by email. On 401 the connector signs in again and retries, up to 5 attempts.

## Fields fetched

| Lucy Security field | OctoXLabs field            |
| ------------------- | -------------------------- |
| email               | Email (primary identifier) |
| firstname           | FirstName                  |
| lastname            | LastName                   |
| name                | DisplayName                |
| location            | Location                   |

## Troubleshooting

| Error message                                                  | Cause                                                                                   | Fix                                                                                            |
| -------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Max retries exceeded for {url}                                 | The API answered 401 on every attempt.                                                  | Check the email and password.                                                                  |
| Status Code: `, followed by URL, Method and the response body` | The API answered with a status other than 200. This is the shared REST connector error. | Read the status code and body in the message, then check the credentials, permissions and URL. |

## Change history
