> 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/f/forescout-nac.md).

# ForeScout NAC

Forescout Network Access Control discovers and classifies connected devices and enforces security policies. OctoXLabs reads the hosts known to Forescout through the Web API and adds them to the device inventory.

## Use cases

* List all hosts Forescout sees on the network.

```
Adapters = forescout-nac
```

* Find hosts seen by Forescout that are missing from Active Directory.

```
Adapters = forescout-nac AND NOT Adapters = active-directory
```

## Before you begin

### Network

| Source              | Destination              | Port                        | Protocol                     |
| ------------------- | ------------------------ | --------------------------- | ---------------------------- |
| OctoXLabs connector | Forescout host (Web API) | 443 (default, configurable) | HTTPS (HTTP when SSL is off) |

### Required permissions

| Scope or role                               | Permission               | Needed for                 |
| ------------------------------------------- | ------------------------ | -------------------------- |
| Forescout Web API plugin (eyeExtend module) | Installed and configured | Any API access             |
| Account used by OctoXLabs                   | Not verified             | Reading hosts and policies |

Forescout publishes the plugin steps: [How to install the Web API plugin](https://docs.forescout.com/bundle/web-api-1-5-4-h/page/t-how-to-install-web-api-plugin.html).

## Create credentials in ForeScout NAC

{% stepper %}
{% step %}

### Install and configure the Web API plugin

{% hint style="danger" %}
Access to the Forescout API needs the eyeExtend module. Follow "How to Install Web API Plugin" and "Configure Web API Plugin" in the Forescout documentation linked above.
{% endhint %}
{% endstep %}

{% step %}

### Prepare an account

Use an account that can log in to the Web API. Note the username and password.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter     | Required | Type             | Default | Description                                                                                                                                                                                      |
| ------------- | -------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Ip            | Yes      | Text             | None    | IP address or host name of Forescout.                                                                                                                                                            |
| Port          | No       | Integer          | 443     | Port number.                                                                                                                                                                                     |
| Is secure     | No       | Boolean          | True    | Use SSL (shown as SSL in the instructions).                                                                                                                                                      |
| Username      | Yes      | Text             | None    | Account name.                                                                                                                                                                                    |
| Password      | Yes      | Text (sensitive) | None    | Account password.                                                                                                                                                                                |
| Policy filter | No       | Text             | Empty   | Comma-separated policy names, exactly as in Forescout and case-sensitive, for example `1.1 DISCOVER`. Only hosts matched by the rules of those policies are collected. Empty collects all hosts. |
| Timeout       | No       | Integer          | 30      | Seconds to wait for API responses.                                                                                                                                                               |
| Thread count  | No       | Integer          | 32      | Parallel threads for host detail requests. Minimum 1, maximum 32.                                                                                                                                |
| Sleep time    | No       | Integer          | 0       | Seconds between thread batches. Increase it if you see rate limit errors.                                                                                                                        |

## Troubleshooting

| Error message                                                              | Cause                                         | Fix                                                                         |
| -------------------------------------------------------------------------- | --------------------------------------------- | --------------------------------------------------------------------------- |
| `policy_filter matched no rules, falling back to all hosts.` (log warning) | None of the policy names matched.             | Check spelling and case of the names. The log lists the available policies. |
| `<n> hosts skipped, host detail returned 404 or 500.` (log info)           | Some hosts are unreachable.                   | No action needed unless the number is unexpected.                           |
| `Request to <url> failed after 3 attempts.`                                | The token was rejected 3 times with HTTP 401. | Check the account and password.                                             |

## Change history

{% hint style="info" %}
Available starting from version 3.3.0.
{% endhint %}
