top of page

Automation Governance: Permissions, Audits, and Change Control

Shift Quality Editorial
Nov 28, 2025
10 min read

Updated: Oct 19

A nightly job copies discount rates from a merchandising spreadsheet into the production pricing table. It has run quietly for two years. On a Thursday afternoon, someone adds a new region by editing the job directly on the scheduler. In the edit, a filter condition disappears. That night the job updates the discount rate on all 41,000 rows in the table instead of the 300 it was meant to touch.

Customers see wrong prices for nine hours. Then the questions start, and nobody can answer them. Which version of the job ran? What were the old values? Who changed it, and when? The job ran as a shared integrations account that five other jobs also use, so even the database logs can't say which job made the change. Recovery takes three days of restoring from backups and checking prices by hand.

This is a composite, and the figures are illustrative. The pattern is common. Ungoverned automation doesn't usually fail loudly. It fails in the questions nobody can answer afterwards.

The previous post in this path, Building Automation That Survives Team Changes, covered making automation outlast the person who built it. This one covers the controls that make it safe to run against production: who it runs as, what record it leaves, and how a change reaches it. None of them needs a committee.

Start with an inventory, not a policy

Governance written before anyone knows what automation exists gets applied to the jobs people remember, and the dangerous ones are usually the ones they've forgotten. Start by listing every automation that can write to something that matters. For each, record six things:

- name: pricing-discount-sync
  owner: merchandising-eng          # a team, not a person who left
  runs_as: svc-integrations         # shared with 5 other jobs
  can_write: pricing.*, orders.*, customers.*   # granted, not used
  changed_by: editing on the scheduler
  record: application logs only, 14-day retention

Look in the scheduler, the CI system, cloud functions, database jobs, low-code workflow tools and the crontabs on long-lived servers. Search the identity system for accounts that aren't people, and work backwards to what uses them.

The inventory is the discovery move. Every later control depends on it, and building it usually surfaces the real risks faster than any policy would: jobs with no owner, accounts shared by several jobs, and jobs that are changed by editing them in place.

The test: can you produce this list for every automation that writes to production? Any row with "unknown" for owner or identity is your first piece of work.

Size the controls to the blast radius

Not every job needs the same controls. A report that reads a table and emails a summary can't corrupt anything. A job that rewrites prices can. Applying the heaviest controls everywhere slows down the harmless jobs and teaches people to route around the process. Apply them by what a job can damage:

Tier

What the job can do

Identity

Run record

Change control

1. Read and report

Reads data, produces reports or alerts

Read-only, may share within a team

Run log: start, end, outcome

Version control

2. Writes, recoverable

Writes internal data that can be rebuilt or re-run

Own identity, scoped to its tables

Run record with counts per table

Peer review before merge

3. Writes, customer-facing or hard to undo

Changes prices, money, customer records, permissions, or deletes

Own identity, scoped to the columns it writes

Run record with before and after values

Peer review, dry run, automated write limits

Tier by what the job can do, not what it is meant to do. The pricing job was meant to update 300 rows and could update every row in three schemas. That puts it in tier 3.

The test: every row in your inventory has a tier, and someone other than its owner agrees with it. If most jobs land in tier 3, check whether they need the access they have. That's usually where the tier comes from.

One identity per automation, scoped to what it uses

NIST's control catalogue, SP 800-53, defines least privilege as allowing only the access "necessary to accomplish assigned organizational tasks" for users and for "processes acting on behalf of users". Automation is the second kind, and it is where least privilege most often lapses, because the easy path is to run a job as whoever built it, or as a shared account that already works.

A shared account causes two separate problems. Its blast radius is the union of everything any of its jobs needs, so a bug in one job can reach every system the others touch. And every record of what it did is ambiguous. That's why the database logs in the opening couldn't say which job changed the prices.

Give each tier 2 and tier 3 job its own identity, granted only what it uses. For the pricing job, that's read access to the staging table it loads from and update rights on one column:

CREATE ROLE pricing_discount_sync LOGIN;
GRANT SELECT ON merch_staging.discount_feed TO pricing_discount_sync;
GRANT SELECT (sku, region) ON pricing.price_list TO pricing_discount_sync;
GRANT UPDATE (discount_rate) ON pricing.price_list TO pricing_discount_sync;

Scoping by hand works for new jobs. For existing ones, the faster method is to compare what the identity is granted with what it has actually used, and remove the difference. Cloud platforms record this. AWS IAM, for example, reports when each service was last accessed by a role or user, so you can find permissions that haven't been used and remove them. AWS keeps service-level information for at least 400 days.

The exception: some systems can't scope access. A SaaS API key may be all or nothing. When you can't narrow the permission, narrow everything around it: an identity used by that one job only, a credential stored and rotated centrally, and a run record detailed enough to reconstruct what it changed.

The test: for each tier 2 and tier 3 identity, list what it is granted and what it used in the last 90 days. Every grant it hasn't used is blast radius you are carrying for nothing.

A run record that answers "what happened?"

Logs are for debugging. They record events, they're rotated, and they're written in whatever shape the developer needed that day. A run record is for accountability. It has the same fields on every run, and it can answer "did this job change customer records last Tuesday?" without anyone searching through logs.

A useful record for a tier 3 run:

{
  "run_id": "pricing-discount-sync/2026-10-15T02:00:04Z",
  "trigger": "schedule",
  "code_version": "a41c9e2",
  "identity": "pricing_discount_sync",
  "input": "merch_staging.discount_feed, 300 rows, sha256 9f2c...",
  "writes": [
    { "table": "pricing.price_list", "column": "discount_rate",
      "rows": 300, "before_after": "pricing_audit.change_log, run_id above" }
  ],
  "guard": "max_rows 450, actual 300, passed",
  "outcome": "succeeded"
}

Two things make the record trustworthy. First, the code version, so "what ran" has a definite answer. Second, where it's stored. NIST SP 800-53 asks that audit information be protected from "unauthorized access, modification, and deletion", and its enhancement AU-9(2) asks for audit records to be kept on a different system from the one being audited. In practice, the job writes its record to a store it can append to but not edit or delete, which it reaches with a different credential from the one it uses for its real work. A job that can delete its own record can hide its own mistakes, and so can anyone who has compromised it.

For tier 3, keep the old values. A change table written in the same transaction as the update (row key, old value, new value, run ID) turns a three-day restore into a query.

The test: pick a row a tier 3 job changed last week. In under ten minutes, can you say which run changed it, which code version ran, and what the value was before? If you can't, you will be asking that question during an incident.

Change control that doesn't need a committee

The pricing job's real failure was the path its change took: someone edited it in place, nobody reviewed it, and nothing ran it before production. The usual response to an incident like this is to add an approval board. The evidence says that doesn't help.

DORA's 2019 State of DevOps report tested this directly. Teams whose changes needed approval from an external body, such as a change advisory board or a senior manager, were 2.6 times more likely to be low performers. The report found no evidence that the formal approval lowered change failure rates. It recommends peer review during development instead, combined with automated thresholds that bound changes. It also notes that review in version control meets segregation of duties, which regulatory frameworks often require, as long as you record who approved each change.

For automation, that means four controls:

  • One path to production. Jobs deploy from version control through a pipeline. Remove people's rights to edit jobs on the scheduler, so the pipeline isn't optional.

  • A second person reviews every change to a tier 2 or tier 3 job before merge, and the approval is recorded.

  • A dry run before the first real run. For tier 3, the pipeline runs the changed job in report-only mode against a copy or a read replica and shows what it would change, per table. NIST's CM-3(2) asks for changes to be tested and validated before they are finalised. A dry run is the cheapest version of that.

  • An automated limit on the job itself. The job stops if it is about to change far more than expected:

expected = count_rows(feed)                  # rows in today's feed
to_change = count_rows_matching(update_sql)  # rows the UPDATE would touch
if to_change > max(expected * 1.5, 50):
    abort(f"guard: would change {to_change} rows, feed has {expected}")

That guard alone would have stopped the opening incident. The feed had 300 rows and the update would have touched 41,000. Set limits from what the job normally does, and log the decision in the run record either way.

The test: try to change a tier 3 job without a second person seeing the change. If you can, through the scheduler's UI, a shared deploy account or a hotfix route, that is the path the next incident will take.

Keep secrets out of the code

Automation needs credentials, and how they're handled is part of governance. The OWASP Secrets Management Cheat Sheet notes that many organisations still have secrets hardcoded in source code in plain text. The problem doesn't go away when the line is deleted, because the secret stays in version control history. If one has been committed, rotate it. Don't just remove it.

What OWASP recommends:

  • Store credentials in a secrets manager and fetch them at runtime, or have the orchestrator inject them. Code never contains them and logs never print them.

  • Rotate regularly, and automate it, "so that any stolen credentials will only work for a short time". Manual rotation is where mistakes happen.

  • Use short-lived, dynamic credentials where possible, with a short lease that is revoked when the job finishes.

  • Detect secrets before they're committed, with scanning at the developer level and in the pipeline.

The test: run a secret scanner over your automation repositories' full history, not just the current branch. For every credential your tier 2 and tier 3 jobs use, can you say when it was last rotated and who else can read it?

A worked example

Here is the composite organisation from the opening, six weeks after the pricing incident. The figures are illustrative.

Inventory (week 1)
  Automations that write to production:   23
  Running as the shared integrations account: 9
  Owner unknown:                           4
  Changed by editing on the scheduler:     3

Tiering (week 2)
  Tier 1: 14    Tier 2: 6    Tier 3: 3

Controls (weeks 2 to 6)
  9 jobs moved to their own identities
  Unused grants removed after a 90-day usage check: 31
  Scheduler edit rights removed; all jobs deploy from the repository
  Tier 3: run record with change table, dry run in the pipeline,
          row-count guard on every write
  4 hardcoded credentials found in history, rotated, moved to the vault

Next quarter
  A reviewed change to the pricing job stopped at dry run:
  it would have changed 38,000 rows, the feed had 412.

The controls didn't slow the team down much. Tier 1 jobs, the majority, gained almost nothing beyond version control. The extra work went where the damage could happen.

Govern automation by blast radius. Start with an inventory of every job that can write to production: owner, identity it runs as, what it can write, how it is changed, and where its record goes. Tier each job by what it can do. Tier 1 reads and reports and needs a run log and version control. Tier 2 writes recoverable internal data and needs its own scoped identity, a run record with counts and peer review. Tier 3 changes prices, money, customer records or permissions and adds before-and-after values, a dry run and an automated write limit. In the composite example, a guard comparing rows to change with rows in the feed would have stopped an update to 41,000 rows when 300 were expected. DORA's 2019 report found teams that needed external change approval were 2.6 times more likely to be low performers.

What to do this week

Build the inventory for one system: every job that can write to your main production database, with owner, identity, write access, change path and record. Tier each one. For the tier 3 jobs, check two things first: whether anyone can edit them without review, and whether a row-count guard would have stopped the worst change they could make. Automation Pitfalls to Avoid covers the failures these controls are designed to catch.

Final takeaway

Ungoverned automation fails in the questions nobody can answer afterwards. Start with an inventory of every job that can write to production, because the risky ones are usually the ones nobody remembers. Tier each job by what it can damage, and spend controls where the damage is. Give tier 2 and tier 3 jobs their own identity, scoped to what they use, and remove grants they don't use. Have every run leave a record it can't edit, with the code version and, for tier 3, the old values. Route every change through version control, a second reviewer and, for tier 3, a dry run and an automated limit on what one run can change. That gives you segregation of duties without a committee, and it would have stopped the 41,000-row update before it ran.

Sources

  • NIST, SP 800-53 Rev. 5, Security and Privacy Controls for Information Systems and Organizations: AC-6 Least Privilege ("allowing only authorized accesses for users (or processes acting on behalf of users) that are necessary to accomplish assigned organizational tasks"); AU-9 Protection of Audit Information and enhancement AU-9(2), storing audit records on a physically different system or component; CM-3 Configuration Change Control and enhancement CM-3(2), testing and validating changes before finalising them. https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final

  • AWS, "Refine permissions in AWS using last accessed information", IAM User Guide: identifying unused permissions so they can be removed; the tracking period for service information is at least 400 days. https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_last-accessed.html

  • DORA (Google Cloud), Accelerate State of DevOps 2019, "Change management" (pp. 48–51): respondents with formal external change approval were 2.6 times more likely to be low performers; no evidence that formal approval lowered change failure rates; recommends peer review and automated thresholds; code review in version control as a way to implement segregation of duties. https://services.google.com/fh/files/misc/state-of-devops-2019.pdf

  • OWASP, Secrets Management Cheat Sheet: hardcoded secrets; regular, automated rotation "so that any stolen credentials will only work for a short time"; dynamic secrets with short leases; detection before commit. https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html

Related reading

Keep learning. This article is part of the Automation & Process Improvement path in the ShiftQuality Learning Center. Remove the repetitive work — and keep the automation from becoming new debt.

bottom of page