how-to

How to Enforce Separation of Duties in Database Deployments

· Editorial Team · 13 min read
How to Enforce Separation of Duties in Database Deployments

Quick Summary

Separation of duties means no single person controls every stage of a database change: the author, the approver, the deployer and the auditor should be different people. Each action gets an independent check, and deployment rights are restricted to a named individual who did not write the change.

  • Four roles work well: developer, independent reviewer, deployer and auditor.
  • The system should block the change author from approving their own change.
  • Grant ALTER rights to deployers only, and only on the schemas they manage.
  • Avoid giving the deployment service account db_owner; it collapses the separation.
  • Limit emergency break-glass access to a fixed window, with logging and next-day review.

Table of Contents

Last Updated: 1 December 2026

What Separation of Duties Means for Database Deployments

Separation of duties (SoD) stops any single person from controlling every stage of a sensitive process. In database deployments, the person who writes a schema change should not also approve it, run it in production, and review the audit log.

When one person can make, approve and hide a change, errors and misconduct go unnoticed. Splitting responsibilities across roles gives each action an independent check, a baseline expectation in many regulated organisations.

Why It Matters: Fraud, Error and Insider Risk

Concentrated access is the core risk. A developer with standing rights to alter production tables can introduce a faulty migration, a backdoor or a quiet data export with no one else's agreement.

Error is the more common problem: a second reviewer catches a dropped index on a large table or a missing WHERE clause in an update script. Insider threat and breach risk fall for the same reason, no individual holds unchecked power.

Administrator and Auditor Roles

Separating the administrator from the auditor is one of the clearest applications of the principle. Administrators execute deployments and manage database objects. Auditors review what happened, using logs and evidence they cannot alter.

A practical rule: administrators hold deploy permissions, while auditors hold read-only access to deployment history, approval records and audit logs. Neither role should be able to edit the other's evidence.

Database Deployment Roles and Responsibilities

Clear roles are the starting point for any SoD design; without them, responsibilities blur during an urgent release. Compare workflow tools that enforce these responsibilities in practice.

A workable model for most teams includes four distinct roles:

  • Developer (change author): writes and tests the migration script in a non-production environment.
  • Reviewer (independent approver): checks the script for correctness, performance and security impact. Should not be the author.
  • Deployer (database administrator): runs approved changes in production using the permissions granted for that purpose.

Small teams often cannot staff four people per release. Compensating controls then matter: peer review recorded in the ticketing system, and production deployment rights restricted to a named individual who is not the author.

Database Deployment Approval Process Step by Step

A defined approval process turns SoD from policy into daily practice. This sequence works well for most SQL Server environments:

Database administrator and developer reviewing a release request to ensure separation of duties at a desk
Database administrator and developer reviewing a release request to ensure separation of duties at a desk
  1. Raise a change request. The developer records the scope, script, target database and expected impact in a ticket.
  2. Test in a non-production copy. Run the script against a realistic, masked copy so teams test production-like structures without exposing personal data.
  3. Assign an independent reviewer. The system should block the author from approving their own change.
  4. Review the script and evidence. The reviewer checks correctness, rollback steps and locking or downtime risk.
  5. Approve or return. Approval is recorded with the reviewer's identity and timestamp.
  6. Deploy with restricted rights. Only the designated deployer can execute the approved script, within the approved window.
  7. Verify and close. Confirm the outcome, record any deviation and close the ticket.

Watch out: Approval recorded in a shared inbox or a chat message is weak evidence. Auditors need the approval tied to a named identity inside a system that prevents edits after the fact.

The approval sequence below summarises each stage, the action required and where the control is enforced.

Step What to do Control point
Raise a change request Record scope, script, target database and impact Ticket
Test in non-production Run against a realistic, masked copy Masked copy
Assign independent reviewer Author cannot approve own change System block
Review script and evidence Check correctness, rollback and locking risk Reviewer
Approve or return Record reviewer identity and timestamp Named approval
Deploy with restricted rights Only designated deployer runs approved script Deployer rights
Verify and close Confirm outcome and record deviations Ticket closed

Separation of Duties in Database Deployments: Worked Examples

Abstract rules are easier to apply once mapped to real deployment stages.

Scenario one: a financial reporting database with a four-person release team.

A developer adds a reporting_period column to a ledger table and writes a backfill script. The work moves through five stages, each with a distinct owner and database identity:

  1. Authoring. The developer writes the migration in a feature branch and tests it against a masked clone. The developer connects using a personal developer login that has db_datareader and db_datawriter on the clone only, no production rights at all.
  2. Review. A second developer reviews the pull request. The reviewer checks the backfill for locking behaviour, confirms the rollback script drops the column cleanly, and records approval in the pull request. The pipeline blocks approval if the reviewer is the commit author.
  3. Approval. The change ticket is approved by the database team lead, who is neither author nor reviewer. The approval is timestamped against a named identity in the ticketing system, not a shared mailbox.
  4. Execution. A deployment service account, call it svc_db_deploy, runs the migration through the pipeline. The service account holds ALTER on the reporting schema and nothing else. No human logs in interactively to run the script; the developer cannot use the service account because its credentials live in the pipeline secret store.
  5. Verification and audit. The auditor connects with a read-only login that has VIEW DATABASE STATE and SELECT on the audit tables. The auditor confirms from the deployment log that the author, reviewer, approver and deployer were four different identities, and that the executed script hash matches the approved version in source control.

Separation is enforced twice: by human role and by the database principal each stage uses.

Scenario two: a healthcare application with a two-person team.

Only two engineers are available, so a four-role model is impossible. The compensating pattern keeps the author and executor separate even when reviewer and approver collapse into one person:

  • Whoever writes the migration cannot run it in production. The second engineer reviews the script, approves it in the ticket, and executes it using a named deployment login that the author does not hold.
  • The pipeline still enforces the author-not-equal-to-approver check, so the control survives even if the two engineers are tempted to shortcut during a busy week.
  • Every deployment raises an alert to the engineering manager, who reviews the week's changes retrospectively. This is a detective control rather than a preventive one, but it closes the gap that a two-person team would otherwise leave open.

This is weaker than the four-role model and should be documented as such in the risk register.

What both scenarios have in common. The audit trail can be reconstructed from three artefacts alone: the pull request with its approval record, the pipeline log showing which service account executed which script hash, and the database audit log showing session identity and timestamp. If any is missing or editable after the fact, the separation of duties is only nominal.

Watch out: A common failure is granting the deployment service account broad rights such as db_owner "just in case".

Database-Specific Role and Permission Design

Database permissions deserve precise design. Granting db_owner to every engineer defeats the purpose of SoD. Instead, map roles to what each task requires.

  • Create custom database roles for deployers, developers and read-only auditors.
  • Grant ALTER rights to deployers only, and only on the schemas they manage.
  • Give developers read and write access to non-production environments, not production.

Least privilege is the guiding rule: each role holds only the permissions its function requires, and privilege escalation itself requires approval.

Automating Controls in CI/CD Pipelines and Handling Emergency Changes

Manual approval does not scale when deployments run several times a day, and it is where separation of duties most often erodes.

Pipeline controls that enforce separation of duties

  • Protected branches with required reviewers. Require at least one approval from someone other than the commit author on main or release, enforced at the branch level rather than by convention.
  • Author-not-equal-to-approver gate. Add a pipeline step that fails the build if the approver identity matches the commit author, catching self-approval through a second account or shared login.
  • Dedicated deployment service account. Run migrations only through a service principal whose credentials live in the pipeline secret store and rotate on a schedule. Developers should have no interactive production login, and the account should hold only the permissions its migrations require, typically ALTER on named schemas, not db_owner.

Handling emergency changes without abandoning separation

Emergency changes are where separation of duties is most often quietly suspended, and where auditors look hardest. A workable break-glass procedure has five elements:

  1. A named break-glass identity. Create a dedicated emergency account, separate from normal deployment credentials, held by a small number of senior administrators. Its use should be impossible to hide, for example, by alerting the moment it authenticates.
  2. A documented trigger. Define what qualifies as an emergency: a production outage, a data corruption incident, a security vulnerability requiring immediate patching. Routine urgency does not qualify.
  3. A time limit. Grant elevated rights for a fixed window, commonly a few hours, after which permissions expire automatically. Time-bound elevation beats a permanent emergency account that relies on discipline (Secure system administration | Use privileged access management).
  4. Mandatory logging and alerting. Every break-glass session should alert the on-call manager and record the identity, timestamp, commands run and reason given in the incident ticket.
  5. Retrospective review. Within a set period, typically the next business day, a reviewer not involved in the emergency should examine what ran, confirm it matches the incident record, and ratify the change or raise a follow-up. Record the review as evidence.

Watch out: The most common failure is a break-glass account that is used for routine work because it is faster than the normal pipeline.

Detecting drift and unauthorised changes

Automation should also cover changes that bypass the pipeline. Schema drift occurs when production structure is altered outside approved releases, by a manual script, a vendor tool or an application migration that runs at startup.

Building a Database Deployment Audit Trail

An audit trail should answer four questions for any change: who requested it, who approved it, who deployed it and what exactly ran. Capture these elements:

  • The change ticket ID and its approval record, with named identities and timestamps
  • The exact script version executed, stored in source control
  • Deployment logs showing the start and end times, and the outcome

Store the trail where administrators cannot edit it, so auditors can reconstruct any release from the records alone. Periodically trace a random release end to end to confirm the controls work.

Applying Separation of Duties in Your Next Database Release

Start with one release and map it against the four roles above. Identify who holds each responsibility, where approval is recorded and which permissions are broader than needed. Tighten the worst gaps first, typically production deployment rights and self-approval.

Teams that want to reduce the overhead of testing changes safely often find that database cloning helps.

Begin with the change path you can control this week, then extend the same discipline across every release.

Frequently Asked Questions

Can you give me an example of separation of duties in a database deployment?

A developer writes and tests a schema change in a development environment. A different person, such as a database administrator, reviews the script and approves it. A third role, often a release engineer or the pipeline itself, deploys it to production. No single person can write, approve and deploy the same change. Each step is recorded against a named identity, so the change can be traced later. This split stops one person from pushing unreviewed changes into live data, which is the core purpose of the control.

How can teams prevent developers from approving their own database changes?

Remove write-and-approve rights for the same account. In most pipelines this means the approval gate requires a reviewer who is not the change author, enforced by the tooling rather than by trust. Restrict production deployment permissions to a service account or a small release group. Configure the pipeline so that a change cannot advance while its author is the only approver. Review access rights regularly, because role creep often gives developers production rights they no longer need.

How should database deployment responsibilities be divided?

Divide responsibilities by stage rather than by person alone. Developers author and test changes. Database administrators review schema and performance impact and approve production changes. Release or operations staff execute deployments using controlled credentials. Auditors or security staff review the logs without holding deployment rights. In small teams where people wear several hats, avoid giving one person both approval and execution rights for production. If that cannot be avoided, add a compensating control such as a second reviewer or a retrospective check of the audit log.

How do you audit separation of duties in database deployments?

Capture who authored, reviewed, approved and deployed each change, with timestamps and the exact script version. Store these records in a location the deployment team cannot edit. Periodically sample deployments and check that the author, approver and executor were different identities. Reconcile role memberships against the documented responsibilities matrix to find excessive privileges. Document each finding and its remediation, so the audit trail shows the control was tested and not only designed.

GoogleAdd datatamed.com as a preferred source on Google →
#separation of duties #separation of duties in database deployments #separation of duties in database deployments examples #database deployment approval process