T13.7: dry run for the Okta sync, OKTA_SYNC_DRY_RUN (D22)

This commit is contained in:
2026-10-16 14:53:05 -07:00
parent 2d4e96d668
commit bcef0e8145
7 changed files with 243 additions and 12 deletions

View File

@@ -415,6 +415,21 @@ status SUSPENDED or DEPROVISIONED. A password expiry, a lockout, or a recovery
in progress does not disable anyone. With no token set, the sync is off and the
startup log says `Okta sync DISABLED`.
**First deploy: use the dry run.** Set `OKTA_SYNC_DRY_RUN=true` in `.env` (or the
Portainer stack environment) with the token, then run `docker compose up -d --build api`.
The sync runs as normal but changes no account and writes no audit row. Read the
result:
docker compose logs api | grep "Okta sync"
The summary line shows how many Okta users and active local accounts it checked,
how many matched, and how many it would disable. A line `DRY RUN would disable ...`
names each account. If the match count is close to your number of real users and
the list holds only people who have left, remove `OKTA_SYNC_DRY_RUN` (or set it
to `false`) and run `docker compose up -d api` again to go live. If the match
count is low, the Okta attribute is wrong. Set `OKTA_SYNC_PROFILE_ATTRIBUTE`
and run the dry run again.
The sync only ever disables. **It never re-enables an account.** A person comes
back only when an admin enables the account by hand.