> ## Documentation Index
> Fetch the complete documentation index at: https://bloodhound.specterops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Large Environment Settings

> Reduce Okta collection volume and tune concurrency for large organizations.

![Applies to BloodHound Enterprise and CE](https://mintcdn.com/specterops/tTIczgde9H07oLXf/assets/enterprise-AND-community-edition-pill-tag.svg?fit=max\&auto=format\&n=tTIczgde9H07oLXf\&q=85\&s=ad49a576589f4d2a8081df77d07fdf56)

Full collection of MFA factors and application-user assignments has been observed to require millions of API requests in large Okta organizations. Collections of this size can take a long time because Okta applies strict rate limits to different API endpoints as well as limits on concurrent requests. In addition, requests that return large result sets, such as expanded group collection, have been observed to time out repeatedly in large Okta organizations and eventually fail, leaving the affected data missing from the collection.

## Limit Collection Scope

By default, the collector collects MFA factors for all users and application-user assignments for all applications. Use the following settings under `[sources.source.okta]` in `config.toml`, or their environment variables using the `SOURCES__SOURCE__OKTA` prefix, to significantly reduce request volume:

<table>
  <colgroup>
    <col />

    <col />

    <col />
  </colgroup>

  <thead>
    <tr>
      <th>Parameter Name</th>
      <th>Environment Variable</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`limit_user_mfa_collection`</td>

      <td>
        `{PREFIX}__LIMIT_USER_MFA_COLLECTION`
      </td>

      <td>Collect MFA factors only for users with role assignments.</td>
    </tr>

    <tr>
      <td>`limit_app_user_collection`</td>

      <td>
        `{PREFIX}__LIMIT_APP_USER_COLLECTION`
      </td>

      <td>Collect application-user assignments only for the collector's built-in set of application types.</td>
    </tr>

    <tr>
      <td>`app_user_collection_app_ids`</td>

      <td>
        `{PREFIX}__APP_USER_COLLECTION_APP_IDS`
      </td>

      <td>Additional Okta application IDs to collect when `limit_app_user_collection` is `true`.</td>
    </tr>
  </tbody>
</table>

For example, to enable both limits:

```toml title="config.toml" theme={null}
[sources.source.okta]
limit_user_mfa_collection = true
limit_app_user_collection = true
app_user_collection_app_ids = ["0oa1a2B3c4D5e6F7g8h9", "0oa9h8G7f6E5d4C3b2a1"]
```

## Tune Extraction Concurrency

Increasing workers or concurrent requests can improve throughput when capacity is available, but cannot bypass Okta's API rate limits. Try overriding the default [extract parameters](https://bloodhound.specterops.io/openhound/configuration.md#extract-parameters) for Okta:

```toml title="config.toml" theme={null}
[sources.source.okta.extract]
workers = 40
max_parallel_items = 80
```

The collector also applies the following request controls under `[sources.source.okta]`. Replace \{PREFIX} with `SOURCES__SOURCE__OKTA` in the environment variables below.

<table>
  <colgroup>
    <col />

    <col />

    <col />

    <col />
  </colgroup>

  <thead>
    <tr>
      <th>Parameter Name</th>
      <th>Environment Variable</th>
      <th>Default</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`endpoint_concurrency`</td>

      <td>
        `{PREFIX}__ENDPOINT_CONCURRENCY`
      </td>

      <td>`32`</td>
      <td>Maximum simultaneous requests per API endpoint.</td>
    </tr>

    <tr>
      <td>`org_concurrency`</td>

      <td>
        `{PREFIX}__ORG_CONCURRENCY`
      </td>

      <td>`32`</td>
      <td>Maximum simultaneous requests across all endpoints.</td>
    </tr>

    <tr>
      <td>`rate_limit_max_elapsed_seconds`</td>

      <td>
        `{PREFIX}__RATE_LIMIT_MAX_ELAPSED_SECONDS`
      </td>

      <td>`900`</td>
      <td>Maximum elapsed retry window for an individual HTTP 429 request.</td>
    </tr>

    <tr>
      <td>`rate_limit_remaining_reserve`</td>

      <td>
        `{PREFIX}__RATE_LIMIT_REMAINING_RESERVE`
      </td>

      <td>`1`</td>
      <td>Requests held in reserve when pacing against a rate-limit window.</td>
    </tr>
  </tbody>
</table>

Keep concurrency within your organization's [endpoint-specific rate limits](https://developer.okta.com/docs/reference/rate-limits/) and [concurrency limits](https://developer.okta.com/docs/reference/rl2-concurrency/), which default to 75 simultaneous transactions, and account for other applications using the API. Retain a [client-specific rate limit](https://developer.okta.com/docs/reference/rl2-token-oauth/) to avoid consuming the organization's full quota.

Use [performance telemetry](https://bloodhound.specterops.io/openhound/collectors/okta/performance-telemetry.md) to see the effective settings and whether a collection is limited by worker capacity or by Okta rate limits. Note that the collector slows down before exhausting rate-limit quotas, so a collection can be quota-bound even without HTTP 429 responses.

## Tune Page Sizes

> [!NOTE]
>
> These are advanced settings. The default page sizes should work well for most environments.

Because requests that return large result sets, such as expanded group collection, have been observed to time out repeatedly and eventually fail in large Okta organizations, the collector requests explicit page sizes for these resources. You can tune the default page sizes with the following environment variables using the `SOURCES__SOURCE__OKTA` prefix:

<table>
  <colgroup>
    <col />

    <col />

    <col />
  </colgroup>

  <thead>
    <tr>
      <th>Environment Variable</th>
      <th>Default</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `{PREFIX}__APPLICATIONS_PAGE_SIZE`
      </td>

      <td>`200`</td>
      <td>Applications per page, from 1 through 200.</td>
    </tr>

    <tr>
      <td>
        `{PREFIX}__APPLICATION_USERS_PAGE_SIZE`
      </td>

      <td>`500`</td>
      <td>Application users per page, from 1 through 500.</td>
    </tr>

    <tr>
      <td>
        `{PREFIX}__GROUPS_PAGE_SIZE`
      </td>

      <td>`200`</td>
      <td>Groups per page, from 1 through 200.</td>
    </tr>

    <tr>
      <td>
        `{PREFIX}__APPLICATION_GROUP_ASSIGNMENTS_PAGE_SIZE`
      </td>

      <td>`200`</td>
      <td>Application-group assignments per page, from 20 through 200.</td>
    </tr>

    <tr>
      <td>
        `{PREFIX}__GROUP_PUSH_MAPPINGS_PAGE_SIZE`
      </td>

      <td>`1000`</td>
      <td>Group push mappings per page, from 1 through 1,000.</td>
    </tr>

    <tr>
      <td>
        `{PREFIX}__IDENTITY_PROVIDER_USERS_PAGE_SIZE`
      </td>

      <td>`200`</td>
      <td>Identity-provider users per page, from 1 through 200.</td>
    </tr>
  </tbody>
</table>

> [!NOTE]
>
> If the initial expanded group page repeatedly times out on large Okta tenants, the collector retries that first page with successively halved page sizes before failing. With the default `GROUPS_PAGE_SIZE` of 200, that fallback sequence is 200, then 100, then 50.
