Skip to content
Export guide · Identity

How to export your Okta configuration, and what we check in it

Where you run it: Okta Admin Console (for a read-only token), then the Okta API from a bash terminal on your computer.

In short

Okta configuration export: the file Okta writes of its own settings, which a configuration review reads setting by setting without connecting to Okta.

How to export the Okta configuration, step by step, what the review checks in the file (36 checks run), and what it does not read.

The fileJSON. okta-policies.json: one flat list of your sign-on, MFA enrolment, password and app sign-in policies, each with its rules. Nine more files, one per Okta answer: okta-authenticators.json, okta-threatinsight.json, okta-network-zones.json, okta-event-hooks.json, okta-trusted-origins.json, okta-behaviors.json, okta-idps.json, okta-apps.json, okta-group-rules.json
Checks run on it36
Highest grade its findings reachOBSERVED
Feeds attack pathsYes
Not read from this export1 area, listed below

Sources: Okta documentation (1); Okta documentation (2); Okta documentation (3); the vendor table.

How to export it

These steps have not been checked against the vendor's documentation.

Who can pull it
An admin with Okta’s Read-Only Administrator role creates the API token. Okta API tokens carry the permissions of the admin who created them, so this one can read but not change anything. Use a service account that will stay active: a token stops working when its creator is deactivated, or after 30 days unused.
Time
About 10 minutes: about 5 to create the read-only token, and under a minute for the script.
The file
JSON. okta-policies.json: one flat list of your sign-on, MFA enrolment, password and app sign-in policies, each with its rules. Nine more files, one per Okta answer: okta-authenticators.json, okta-threatinsight.json, okta-network-zones.json, okta-event-hooks.json, okta-trusted-origins.json, okta-behaviors.json, okta-idps.json, okta-apps.json, okta-group-rules.json

No console export: The Okta Admin Console shows each policy but has no download of policies with their rules, so the export runs as the script or the curl steps; the console is only used to create and then revoke the read-only token.

From the command line

  1. Sign in as a Read-Only Administrator (a dedicated service account is best) and create a token: Security → API → Tokens → Create token. Name it (for example cybertwin-read), leave API calls allowed from Any IP unless your policy says otherwise, click Create token and copy the value now: Okta shows it only once. The token has only that admin’s read-only rights.

    The vendor's page, checked 2026-10-19
  2. Download okta-policies.sh (the link under these steps) and open a terminal in the folder it saved to, for example: cd ~/Downloadsthen run: OKTA_ORG=<your-org>.okta.com OKTA_TOKEN=<token> bash okta-policies.sh→ okta-policies.json (the OKTA_SIGN_ON, MFA_ENROLL, PASSWORD and ACCESS_POLICY policies; the script then asks Okta for the rules of each policy, GET /api/v1/policies/<policy id>/rules, and writes them into the policy as "rules")

    The vendor's page, checked 2026-11-11
  3. Or by hand, first: export OKTA_ORG=<your-org>.okta.com OKTA_TOKEN=<token>then once per type (OKTA_SIGN_ON, MFA_ENROLL, PASSWORD, ACCESS_POLICY): curl -s -H "Authorization: SSWS $OKTA_TOKEN" "https://$OKTA_ORG/api/v1/policies?type=OKTA_SIGN_ON" > okta-OKTA_SIGN_ON.json(and the same for each type). These calls read the first page of each answer and do not follow the paging links Okta sends, so an org with more than one page of policies of a type must use the script.

    The vendor's page, checked 2026-11-11
  4. jq -s 'map(select(type=="array")) | add' okta-OKTA_SIGN_ON.json okta-MFA_ENROLL.json okta-PASSWORD.json okta-ACCESS_POLICY.json > okta-policy-list.json(one flat list of the policies; an answer that is not a list, such as Okta's error when it refuses a policy type, is left out; Okta's answer holds no rules)

    The vendor's page, checked 2026-11-11
  5. for id in $(jq -r '.[].id' okta-policy-list.json); do curl -s -H "Authorization: SSWS $OKTA_TOKEN" "https://$OKTA_ORG/api/v1/policies/$id/rules" | jq -c --arg id "$id" '{id: $id, rules: .}'; done > okta-rules.jsonl(the rules of each policy, one line per policy)

    The vendor's page, checked 2026-11-11
  6. jq --slurpfile r okta-rules.jsonl 'map(. as $p | ([$r[] | select(.id == $p.id and (.rules | type) == "array")] | first) as $x | if $x then $p + {rules: $x.rules} else $p end)' okta-policy-list.json > okta-policies.json (each policy with its rules, as okta-policies.sh writes; upload okta-policies.json)

    The vendor's page, checked 2026-11-11
  7. The script also writes nine more files, each Okta's own answer, and you upload each one as Okta: okta-authenticators.json (GET /api/v1/authenticators), okta-threatinsight.json (GET /api/v1/threats/configuration), okta-network-zones.json (GET /api/v1/zones), okta-event-hooks.json (GET /api/v1/eventHooks), okta-trusted-origins.json (GET /api/v1/trustedOrigins), okta-behaviors.json (GET /api/v1/behaviors), okta-idps.json (GET /api/v1/idps), okta-apps.json (GET /api/v1/apps) and okta-group-rules.json (GET /api/v1/groups/rules?expand=groupIdToGroupNameMap, which adds the name of each group a rule assigns). An answer Okta does not return, or an empty list, is skipped and named; the other files are still written. By hand, once per call: curl -s -H "Authorization: SSWS $OKTA_TOKEN" "https://$OKTA_ORG/api/v1/authenticators" > okta-authenticators.json(a long list of apps or zones needs the script, which follows the paging links)

    The vendor's page, checked 2026-11-11
  8. When the upload is done, revoke the token: Security → API → Tokens, then the Revoke token (trash) icon next to it.

    The vendor's page, checked 2026-10-19

The script the steps run: Okta policy export (read-only curl).

What the file looks like

JSON. okta-policies.json: one flat list of your sign-on, MFA enrolment, password and app sign-in policies, each with its rules. Nine more files, one per Okta answer: okta-authenticators.json, okta-threatinsight.json, okta-network-zones.json, okta-event-hooks.json, okta-trusted-origins.json, okta-behaviors.json, okta-idps.json, okta-apps.json, okta-group-rules.json. Typically about 20 KB to 300 KB: roughly 3 to 10 KB per policy with its rules

What it holds: Sign-on, MFA enrolment, password and app sign-in (access) policies, each with its rules; and, one file each, the authenticators, the ThreatInsight setting, network zones, event hooks, trusted origins, behavior detection rules, identity providers, applications and group rules.

okta-policies.sh is the script for this upload (the policy review); download it from the link on this page. okta-policies.sh needs curl and jq. <your-org>.okta.com is your Okta domain without -admin (acme.okta.com, not acme-admin.okta.com); <token> is the value you copied. okta-identity-export.sh is a separate export of users, groups and apps for the identity upload. Both run on your machine and send nothing to CyberTwin. If okta-policies.sh prints "Okta did not return …" for a policy or a policy type, the file is still written: that policy is written without its rules, or that type is left out, and the result says those rules are not in the file and concludes nothing about them. Run these commands in bash (macOS, Linux or WSL): in Windows PowerShell 5.1, > writes UTF-16, which jq and the upload refuse.

If the export goes wrong

What you seeThe fix
The script prints "Okta returned no policy list, so no file was written."Okta refused the call. In the same terminal, first run export OKTA_ORG=<your-org>.okta.com OKTA_TOKEN=<token> (the script line sets them for the script only), then run curl -s -H "Authorization: SSWS $OKTA_TOKEN" "https://$OKTA_ORG/api/v1/policies?type=PASSWORD" to see why: "Invalid token provided" means the token is mistyped, revoked or expired (create a new one); an HTML page or "Not found" means OKTA_ORG is wrong (use acme.okta.com, not acme-admin.okta.com).
"jq: command not found".Install jq (macOS: brew install jq; Ubuntu or WSL: sudo apt install jq) and run the script again.
In Windows PowerShell the commands fail, or the upload refuses the file as UTF-16.Run the steps in bash instead: WSL, Git Bash, or the macOS or Linux terminal. In Windows PowerShell 5.1, curl is a different command and > writes UTF-16.

What we read from it

Checks run
36 + 5 guidance items, not counted
Formats read
Okta API JSON export (policies + rules) · Okta API JSON export (authenticators) · Okta API JSON export (ThreatInsight configuration) · Okta API JSON export (network zones) · Okta API JSON export (event hooks) · Okta API JSON export (trusted origins) · Okta API JSON export (behavior detection rules) · Okta API JSON export (identity providers) · Okta API JSON export (group rules) · Okta API JSON export (applications)
Releases
2024.1 to current

Checks run is the number of checks that reached a result on this system's own export in our tests, as the vendor table shows it.

The areas checked

  • Sign-on policies and rules: MFA required, session lifetime, legacy authentication
  • Password policies: length, complexity, history, lockout, expiry and recovery factors
  • MFA enrolment policies: which factors are allowed (SMS, voice, security questions, WebAuthn)
  • App sign-in (access) policies and their rules
  • Authenticators: phone, email, Okta Verify number challenge and passkeys (FIDO2 WebAuthn)
  • ThreatInsight action, network zone gateways, event hook addresses and verification, trusted origin scopes
  • Behavior detection rules, SAML identity provider signature settings, OAuth app grant types and redirect URIs, and the groups each group rule assigns

The grade its findings reach

Observed Findings from this file are OBSERVED: read from the system's own export and cited to the setting.

Its findings feed attack paths: each one can be a step on a path an attacker could take to your crown jewels.

Attack paths, the one change and dollar figures are MODELED. How each grade is worked out is on the method page.

What we do not read from this export

  • Users, groups and app assignments: those come from the separate identity export
  • Admin role assignments, such as how many super admins there are
  • API tokens, inline hooks, log streams and the System Log
  • Last-modified dates, so long-untouched rules are not found

Limits of the reader

  • The checks of this system are not counted: a check counts once a test shows it firing on a file in the layout the vendor documents.

A finding never comes from what the file does not hold: live traffic, running hosts and logs are not in a configuration export.

A Okta finding from the sample company

Sample company: Acme Capital (fictional)

Standing Super Admin with no just-in-time step

CriticalObservedOkta · admin roles › eng-lead

Run the sample to see this finding with its fix and the paths it sits on.

Questions

Who can export the Okta configuration?

An admin with Okta’s Read-Only Administrator role creates the API token. Okta API tokens carry the permissions of the admin who created them, so this one can read but not change anything. Use a service account that will stay active: a token stops working when its creator is deactivated, or after 30 days unused.

How long does the export take?

About 10 minutes: about 5 to create the read-only token, and under a minute for the script.

What does the review not read from this file?

Users, groups and app assignments: those come from the separate identity export. Admin role assignments, such as how many super admins there are. API tokens, inline hooks, log streams and the System Log. Last-modified dates, so long-untouched rules are not found.