fix(remediation): close the recurring Exchange-Admin-role gap fleet-wide

EXO email-cleanup tasks (Search-UnifiedAuditLog, Get-MessageTrace, inbox rules) kept
401/403-ing per tenant because the Exchange Operator SP was missing the Exchange Admin
directory role — admin consent grants Exchange.ManageAsApp but never the directory role.
onboard-tenant.sh assigns it, but tenants consented before that step / by hand never got
it, and nothing audited for it. Hence the recurring 'next onboarding will fix it' (false
for already-onboarded tenants).

- NEW assign-exchange-role.sh: idempotent role assignment via the authoritative
  roleManagement/directory/roleAssignments API (the legacy directoryRoles/members list
  reads back unreliably). <domain|--all> + --verify/--dry-run.
- Backfilled the whole fleet (--all): 13 stragglers ASSIGNED, 12 already OK, 20 skipped
  (tenant-admin not consented), 0 errors. Safe Site included.
- Standing audit documented (assign-exchange-role.sh --all --verify) + memory so no future
  session repeats the empty promise.
- Adds wiki/clients/safesite.md (tenant + 4-source endpoint inventory + investigation).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 20:07:28 -07:00
parent f49f632c7d
commit b4fcea91dc
4 changed files with 41 additions and 19 deletions

View File

@@ -5,6 +5,14 @@ Last updated: 2026-04-20. Source of truth: CIPP ListTenants API.
Run `bash scripts/onboard-tenant.sh <domain>` after any tenant consents Tenant Admin.
After full onboarding, update the Onboarded column below.
**Exchange access (recurring gap — now closed):** EXO management (audit log, message trace, inbox
rules) needs the **Exchange Operator SP** to hold the **Exchange Administrator** directory role, which
admin consent does NOT grant. Onboarding assigns it, but tenants consented before that step / by hand
were missing it. Fleet **backfilled 2026-06-08** (13 stragglers fixed). **Standing audit:** run
`bash scripts/assign-exchange-role.sh --all --verify` periodically — any `WOULD assign` is a tenant
that will fail the next email task; fix it with `assign-exchange-role.sh <domain>`. See
[[feedback_exchange_role_recurring_gap]].
## Tenant List
| Display Name | Domain | Tenant ID | Onboarded | Notes |