> 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/p/palo-alto-networks-iot-security.md).

# Palo Alto Networks IoT Security

Palo Alto Networks IoT Security discovers and profiles IoT devices. OctoXLabs reads the device inventory through Strata Cloud Manager and can also collect activated policy rule recommendations as network policies.

## Use cases

* List IoT devices that OctoXLabs has collected.

```
Adapters = palo-alto-iot-security
```

* Find IoT devices not active for 30 days.

```
Adapters = palo-alto-iot-security AND NOT LastSeen last now-30d/d
```

## Before you begin

### Network

| Source              | Destination                               | Port | Protocol |
| ------------------- | ----------------------------------------- | ---- | -------- |
| OctoXLabs connector | `auth.apps.paloaltonetworks.com` (tokens) | 443  | HTTPS    |
| OctoXLabs connector | `api.strata.paloaltonetworks.com` (API)   | 443  | HTTPS    |

### Required permissions

| Scope or role                                                                   | Permission                                                   | Needed for           |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------ | -------------------- |
| Service account assigned to **All Apps & Services** with the **Superuser** role | Documented by Palo Alto Networks for IoT Security API access | Devices and policies |

## Create credentials in Palo Alto Networks IoT Security

{% stepper %}
{% step %}

### Open Access Management

Log in to the Strata Cloud Manager you use for IoT Security. Go to **Settings > Identity & Access > Access Management**.
{% endstep %}

{% step %}

### Add a service account

Click **Add Identity** and choose **Service Account**.
{% endstep %}

{% step %}

### Assign the role

Assign the account to **All Apps & Services** with the **Superuser** role.
{% endstep %}

{% step %}

### Copy the credentials

Copy the client ID and client secret from the Client Credentials screen. The secret is shown only once.
{% endstep %}

{% step %}

### Find the TSG ID

Note the ID of the tenant service group that holds your IoT Security tenant.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter            | Required | Type    | Default                         | Description                                                                                                                       |
| -------------------- | -------- | ------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| Domain               | No       | String  | api.strata.paloaltonetworks.com | Strata Cloud Manager API host, without `https://`.                                                                                |
| Auth Domain          | No       | String  | auth.apps.paloaltonetworks.com  | Host that issues access tokens. It differs from the API host.                                                                     |
| Client ID            | Yes      | String  |                                 | Client ID of the service account.                                                                                                 |
| Client Secret        | Yes      | String  |                                 | Client secret of the service account.                                                                                             |
| TSG ID               | Yes      | String  |                                 | Tenant service group ID. The token is requested for it (`scope=tsg_id:<id>`).                                                     |
| Fetch Policies       | No       | Boolean | True                            | Also collect activated policy rule recommendations as network policies. Devices are always collected.                             |
| Fetch All Attributes | No       | Boolean | False                           | Ask for every device attribute, including those from third-party integrations. Responses get much larger, so lower the page size. |
| Page Size            | No       | Integer | 1000                            | Devices or policies per page. 1 to 1000.                                                                                          |
| Proxy                | No       | String  |                                 | Proxy address as `host:port`.                                                                                                     |
| Timeout              | No       | Integer | 30                              | Seconds to wait for API responses.                                                                                                |

## Troubleshooting

| Error message                                             | Cause                              | Fix                                                               |
| --------------------------------------------------------- | ---------------------------------- | ----------------------------------------------------------------- |
| Strata Cloud Manager token response has no access\_token. | The token call returned no token.  | Check Client ID, Client Secret and TSG ID.                        |
| Max retries exceeded for :                                | The API kept answering 401 or 429. | The device API allows 60 requests per minute. Wait and run again. |

## Change history

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