iac.htora.dev · security templates

Home/Refreshers/Catch account takeover at the identity provider: refresher

Catch account takeover at the identity provider

Alerts in Okta, Entra ID, Google Workspace, and Microsoft 365 on the moves that turn one stolen account into many. They cover admin rights granted, sign-in rules changed, MFA removed, mail forwarded out, and a log feed going quiet.

Remember

  1. Someone acts in the identity provider: grants a role, changes sign-in, removes MFA.
  2. Its audit log records it: Okta, Entra ID, Workspace, or Microsoft 365.
  3. A copy lands in your cloud: EventBridge, Log Analytics, or Cloud Logging.
  4. A rule matches: and an email names who, what, and from where.
PlatformUsesThe part that catches people
OktaOkta's System Log streamed to an Amazon EventBridge partner event source, with EventBridge rules and a CloudWatch log groupOkta deactivates a stream when two delivery attempts fail, and does not turn it back on.
Entra IDA tenant diagnostic setting sending audit and sign-in logs to Log Analytics, with scheduled query alertsMicrosoft allows up to three days for the first rows to reach a new workspace.
Google WorkspaceWorkspace audit logs shared with Google Cloud, an organisation sink to a log bucket, log-based metrics, and Cloud Monitoring alertsGoogle documents the sharing switch only in the Admin console, so Terraform cannot turn it on or see that it is off.
Microsoft 365Microsoft Sentinel's Microsoft 365 connector filling OfficeActivity in Log Analytics, with scheduled query alertsTurning on Sentinel puts every table in the workspace under Sentinel billing, which is why this source gets a workspace of its own.

Run the quick start

Download providersterraform init
Previewterraform plan
Applyterraform apply
Print the proof commandsterraform output verify

Watch out

  • Each source also has a silence alert.
  • Tune before you trust.
  • An alert on a role grant or an MFA reset starts a check with the person named.
Check it worked

In a test tenant or org, grant a test user an admin role and remove it. The alert reaches the security inbox within minutes.

Read the full pageDownload PDF

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.