Production · Continuous Monitoring

Okta Drift Detection | Policies Checked Every Day

A scheduled job reads an identity provider’s configuration each day, compares it with settings a person approved in Git, stores the result as locked audit evidence, and posts to a chat channel. Okta is the system it watches. The same pattern applies to any system with a read API.

Role
Designer & Operator
Access
Read-Only
Status
Running Daily
Built With
Claude & GitHub Actions
A screenshot records one day
Audits ask whether a control operated for a whole period. Evidence for identity controls usually arrives as a screenshot of an admin console, captured close to the date of the request. The settings behind that screenshot can change the next day, and nothing in the screenshot process notices. Each policy statement needs a daily question: does the system still behave this way, and where is the proof?
What a finding looks like
A run that finds drift fails and posts each finding to a chat channel. The layout below uses placeholder content.
Baseline check | Chat message
Baseline check: DRIFTSAMPLE LAYOUT WITH PLACEHOLDER CONTENTCHANGEDRule name | setting beforeRule name | setting afterADDEDNew rule name | settingNext: ask the owner of the change why it was made, then log the outcome.
Collect, normalize, compare, store, notify
01

Collect

A read-only credential makes GET requests to the vendor API. The responses are saved as one JSON snapshot.

02

Normalize

Deeply nested rules reduce to one readable line each, with a trailing hash over the whole rule so any change shows.

03

Compare

The snapshot is checked against YAML baselines in Git. Each baseline setting ties to a policy statement, a control, and an approver.

04

Store

The snapshot, its hash, the run record, and the baselines used go to a bucket with a locked retention policy.

05

Notify

A chat message lists each finding. A clean run posts one all-clear line, so a missing line shows that nothing ran.

Approved settings live in Git
A baseline is a YAML file that lists settings, ties each to a policy statement and a control, and names the person who approved it. A baseline changes through a pull request, so the change history doubles as change management evidence. Three operators cover most needs: a minimum check (gte), an exact match (eq), and a comparison of the full set of items that exist (set_equals).
- id: min-length
  description: Minimum password length
  policy: Password Policy, section 4.1
  control: ACCESS-01
  path: 'password_policies[name=Example Policy].settings.password.complexity.minLength'
  operator: gte
  expected: 14
Choices that keep the result trustworthy
🧮

A Script Decides

The same inputs always produce the same answer. AI takes no part in deciding whether a result is clean, drifted, or an error.

🔍

Missing Means Drift

A setting the script cannot find counts as drift, so a renamed or removed field raises a finding.

⚠

Incomplete Is Never Clean

If the collection did not finish, the run reports an error and never a pass.

✅

Approval Gate

A baseline with no approver refuses to run, so a generated draft cannot take effect before a person reviews it.

🔒

Locked Evidence

The writing account can only create new objects, and retention blocks deletion until the audit period ends. Whoever changes a baseline cannot edit the evidence of a past run.

🔁

Repeatable Runs

An auditor can download a run folder, check out the commit named in the run record, and reproduce the result without contacting the vendor.

Options I set aside
🛒

A Compliance Platform

Platforms offer prebuilt connectors and mapped tests. Their tests follow generic wording, and this job follows the exact wording of the policy. The two can run together, with the platform covering breadth and the monitor covering specific settings.

🏗

Terraform

Terraform makes a system match a declaration, which requires write access. A read-only monitor can also verify changes that Terraform or a person makes.

📷

Periodic Screenshots

A screenshot proves one moment. A daily snapshot with a hash proves the whole period.

From one policy sentence to a daily check
Claude wrote the collector, the compare engine, the chat notifier, and the tests. I reviewed behavior: the run summary, the alert text, the evidence folder, and what happened when I broke things on purpose.
01

Pick One Sentence

The work started from a single policy statement and the API endpoint that holds the matching setting.

02

Baseline a Few Settings

Three to five settings expressed the sentence, and a pull request approved them.

03

Break Things on Purpose

Each check ran against edited copies of real data. Every break produced a specific, readable finding.

04

Schedule, Then Store

The evidence bucket and chat message came after the comparison ran cleanly.

What the check covers
📄

Baselined Settings Only

A setting outside the baselines changes without notice. The monitoring documentation lists coverage so the claim stays accurate.

⏰

Scheduled Detection

A change can sit until the next run. The daily cadence sets the detection window.

🔗

Vendor API Reach

Some settings have no read endpoint, and the check cannot see them.

📝

Policy Sets the Ceiling

Where a policy leaves a term undefined, the baseline can record what exists and cannot say whether it is right.

The full write-up
The blog post Detecting Okta Configuration Drift With GitOps walks through the pattern, the baseline format, the evidence design, and how to start.
What it's built with
GitHub ActionsYAML BaselinesOkta Policies APILocked Cloud BucketOIDCChat WebhookClaude
Design properties
0
Write calls to the monitored system
5
Steps per run
4
Design rules
1
Message per day, even when clean