> 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/b/beamsec-phishtrace.md).

# Beamsec Phishtrace

Beamsec Phishtrace is a phishing reporting and analysis platform. OctoXLabs reads the endpoints that PhishTrace knows (with their history) as devices, and the reporting users together with their phishing reports as users.

## Use cases

* Find reporting endpoints that PhishTrace has seen (Devices).

```
Adapters = beamsec-phishtrace AND IpAddresses = *
```

* List users who have reported phishing mail (Users).

```
Adapters = beamsec-phishtrace
```

## Before you begin

### Network

| Source              | Destination                                    | Port               | Protocol                         |
| ------------------- | ---------------------------------------------- | ------------------ | -------------------------------- |
| OctoXLabs connector | Beamsec Phishtrace host (IP address you enter) | 443 (configurable) | HTTPS (HTTP if Is Secure is off) |

### Required permissions

| Scope or role               | Permission      | Needed for       |
| --------------------------- | --------------- | ---------------- |
| Role with API token allowed | Allow API Token | Token generation |

## Create credentials in Beamsec Phishtrace

{% stepper %}
{% step %}

### Allow API tokens for a role

In PhishTrace, go to **Settings > Authorization**. Choose the role that may generate tokens, open its settings and enable **allow API Token**.
{% endstep %}

{% step %}

### Generate the token

Generate an API token with a user of that role. You enter it as **API Token** in OctoXLabs.
{% endstep %}

{% step %}

### Check the version

If the instance is older than v7.0.0.0, turn on **Is Old Version?** in OctoXLabs. The token is then sent without the `Bearer` prefix.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter       | Required | Type    | Default | Description                                                                    |
| --------------- | -------- | ------- | ------- | ------------------------------------------------------------------------------ |
| IP              | Yes      | String  |         | IP address of the PhishTrace host.                                             |
| Port            | No       | Integer | 443     | Port of the API.                                                               |
| API Token       | Yes      | String  |         | API token.                                                                     |
| Is Secure       | No       | Boolean | True    | Use HTTPS.                                                                     |
| Is Old Version? | No       | Boolean | False   | Turn on for versions older than v7.0.0.0.                                      |
| Timeout         | No       | Integer | 30      | Seconds to wait for API responses.                                             |
| Thread Count    | No       | Integer | 32      | Parallel threads for report detail requests. Min 1, max 32.                    |
| Sleep Time      | No       | Integer | 0       | Delay in seconds between thread batches. Raise it on rate limit errors. Min 0. |

## Troubleshooting

| Error message                                               | Cause                                                                                                                                  | Fix                                                                                                  |
| ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| Failed to fetch test data:                                  | The test endpoint did not return 200.                                                                                                  | Check the token, the port and the Is Old Version? setting.                                           |
| Invalid JSON response while fetching test data (status=...) | The test endpoint returned a body that is not JSON.                                                                                    | Check that the IP and port point to PhishTrace and not to a proxy or login page.                     |
| Failed to fetch devices:                                    | The ip-list endpoint did not return 200.                                                                                               | Check the token permission.                                                                          |
| Failed to fetch phishing reports:                           | The reports endpoint did not return 200.                                                                                               | Check the token permission.                                                                          |
| Failed to fetch a phishing report:                          | A report detail request failed.                                                                                                        | Increase Sleep Time or lower Thread Count if the API rate limits requests.                           |
| Status Code: `, URL, Method`                                | The API answered with an unexpected HTTP status. The shared request code raises it and logs the status, URL, method and response body. | Check the URL, the credentials and the permissions listed above, then run the connection test again. |

## Change history
