OutputValues icon
If icon
Fail icon
Queries icon
Log icon
UploadFiles icon
Switch icon
Set icon
SlackIncomingWebhook icon

Run a quarterly user access review with segregation-of-duties checks and manager certification

Quarterly access review in Kestra and DuckDB. HR matching, SoD conflicts across apps, manager certification, forced revocations and audit evidence.

Categories
BusinessData

Every SOX ITGC and ISO 27001 audit asks for the same evidence: proof that each quarter someone reviewed who has access to the financial systems, that people who left lost their access, and that no one can both create a vendor and pay it. Most teams do this in spreadsheets: exports from each application, a VLOOKUP against the HR file, an email to every manager, and a chase at the deadline. The SoD conflicts that span two applications, such as entering an invoice in the ERP and releasing the payment in the bank portal, are the ones the spreadsheet misses.

This flow runs the campaign. OPEN matches the accounts to HR, runs the checks, and produces the certification list per manager. CLOSE applies the decisions, revokes everything nobody certified, and locks the review.

It runs with no setup and no network. The demo has:

  • 90 employees, three of whom have left;
  • four applications (ERP, bank portal, CRM, cloud) with 128 accounts;
  • planted findings: four SoD conflicts, a shared account, a contractor not in HR, an admin role with no ticket, and dormant accounts.

Findings

Finding Rule Outcome
TERMINATED_USER_ACTIVE The HR file has a termination date Revoked, whatever the manager says
ORPHAN_ACCOUNT No employee matches the account Revoked
SHARED_ACCOUNT Generic account, actions cannot be traced to a person Revoked
PRIVILEGED_WITHOUT_TICKET Privileged role with no approved access request Manager decides
DORMANT No login for dormant_days. High when the role is privileged Manager decides
SOD_CONFLICT One person holds two duties of a rule, in the same or in different applications Kept only with a mitigating control

The SoD rules are duty pairs, not role pairs, so one rule covers every role that grants the duty: vendor maintenance with payment approval, invoice entry with payment release, purchase order with goods receipt, payment approval with payment release, journal posting with system administration.

Certification

  • Each account goes to the employee's manager. Orphan and shared accounts go to the application owner.
  • A decision is KEEP or REVOKE for an account in an application, written "ERP|u013": "REVOKE".
  • An account with an SoD conflict is kept only as KEEP: <mitigating control>. A plain KEEP is revoked at close, with that reason.
  • At CLOSE, an account with no decision is revoked: "Not certified by the deadline".
  • A closed review is locked in KV. Running it again fails, so certified evidence cannot be changed afterwards.

How it works

  1. state and closed_gate stop a run on a review that is already closed.
  2. review (io.kestra.plugin.jdbc.duckdb.Queries) holds the HR file, the account extracts, the role catalog with privilege and duty, the SoD rules and the decisions. It checks the extracts, builds the findings, the certification list, the outcomes and the revocation list.
  3. log_review prints the result. evidence_blockers stores blockers.csv.
  4. gate stops on blockers, before any review file is written. Otherwise evidence stores findings.csv, certification.csv, revocations.csv and evidence.csv (population, decided and revoked per application, for the auditors), per phase.
  5. decide ends the OPEN phase, or locks the review on CLOSE.

Blockers: an extract with no export date, an extract taken more than 7 days before the review date, an application with no account, an account with a role missing from the catalog.

Tested end to end

On Kestra 2.0.5 OSS.

Run Inputs Result
1 OPEN 128 accounts, 92 identities. 4 SoD conflicts (SOD-01, 02, 03, 05), 3 terminated users active, 3 dormant, 1 shared, 1 orphan, 1 admin without ticket. 5 revocations forced, 123 accounts to certify by 9 managers
2 CLOSE, 79 decisions, one manager silent 101 kept, 27 revoked: the 5 forced, the silent manager's 13 accounts, the two SoD conflicts kept without a control, and the explicit revocations. The SoD conflict kept with a control stays
3 CLOSE again Fails: the review is closed
4 ISSUES, 2026-Q4 Blocked: the CRM extract is empty, the HRIS extract has no export date

I recomputed the close outcome of all 128 accounts independently in Python from the certification list and the decisions: 27 revoked, 101 kept, every row matching.

Inputs

Input Default Purpose
review_id 2026-Q3 Campaign, locked at close
as_of 2026-09-30 Review date
phase OPEN OPEN or CLOSE
decisions {} Manager decisions
dormant_days 90 Dormant threshold
scenario CLEAN Demo only

Use it with your data

  • Replace hr, apps, accounts, roles and sod_rules with your HRIS, the application exports or your IAM, and your SoD matrix.
  • Send each manager their part of certification.csv, for example with a Slack or email task after log_open, and collect the answers into decisions.
  • Apply revocations.csv from a task after lock, through your IAM or a ticket per application, and keep the closure tickets with the evidence.

Things to know

  • A decision applies to all the roles of an account in an application. Split the key by role to certify role by role.
  • Accounts are matched to HR on the user ID. Map application logins to it first if they differ.
  • Failures post to Slack via SLACK_WEBHOOK_URL if notify_slack.

Links

This blueprint was created by zkasuran.

See How

New to Kestra?

Use blueprints to kickstart your first workflows.