CloudForge
Published 8 min read

DevSecOps for SOC 2: The Pipeline Controls Auditors Check and the Evidence to Keep

Map CI/CD controls to SOC 2 change management, access and vulnerability criteria, configure branch protection and blocking scans, and collect evidence continuously.

CloudForge field note
DevSecOpsSOC 2Compliance

Teams preparing for a first SOC 2 audit often treat it as a documentation exercise and are surprised by how much of it concerns the delivery pipeline. Auditors want to know that changes to production are authorized, reviewed, tested and traceable, that access is controlled, and that vulnerabilities are found and handled. For a software company, most of the proof for those points lives in source control and CI/CD.

That is good news. A well-built pipeline produces audit evidence as a side effect of normal work. This guide maps common pipeline controls to the SOC 2 criteria they support, shows how to configure them, and explains what evidence to keep. It is engineering guidance, not audit advice. Your auditor decides what satisfies a criterion for your organization, so confirm the mapping with them early.

How SOC 2 looks at a pipeline

SOC 2 reports are based on the AICPA Trust Services Criteria. The criteria never mention CI/CD by name. Three groups of the common criteria map closely to delivery work:

Criteria groupSubjectPipeline relevance
CC6Logical and physical accessWho can change code, pipelines and production, and how credentials are handled
CC7System operationsDetecting vulnerabilities and anomalies, and responding to them
CC8Change managementChanges are authorized, designed, tested, approved and implemented in a controlled way

CC8.1 is the one most directly about the pipeline, and it is in scope for practically every SOC 2 engagement.

Type I and Type II

A Type I report assesses whether controls are suitably designed at a point in time. A Type II report assesses whether they operated effectively over a period, commonly several months to a year. The difference shapes the engineering work. For Type II it is not enough that branch protection is on today. You need to show it was on, and followed, for every production change in the window. That makes consistency and retained evidence more important than any single setting.

The controls and the evidence they produce

ControlWhat to configureEvidence to keepSupports
Reviewed changesProtected default branch, required pull request, at least one approval, stale approvals dismissedBranch protection settings, pull request history with reviewersCC8.1
Segregation of dutiesAuthor cannot approve their own change, code owners for sensitive pathsReview records, CODEOWNERS file historyCC8.1, CC6
Tested changesRequired status checks for build and testsCheck results per merged commitCC8.1
Security testingSecret, dependency, image and infrastructure code scanning in the pipelineScan logs, findings and remediation ticketsCC7.1, CC8.1
Controlled deploymentDeployments only through the pipeline, approval gate for productionDeployment logs with commit, approver and timeCC8.1
Restricted production accessNo standing human write access, short-lived pipeline credentialsRole definitions, access reviews, session logsCC6
Strong authenticationSingle sign-on and enforced multi-factor authentication for source control and cloudOrganization security settings, user listCC6
Secrets managementSecrets in a manager, not in code or plain CI variables, with rotationScanner results, rotation recordsCC6
Emergency changesA documented fast path with after-the-fact reviewEmergency change records and their reviewsCC8.1
Vulnerability handlingDefined severity levels and remediation timelinesTickets showing detection-to-fix timesCC7

Configure reviewed, tested changes

Define branch protection in code, so the control itself is version controlled and applied the same way to every repository. With the Terraform GitHub provider:

resource "github_branch_protection" "main" {
  repository_id = github_repository.payments_api.node_id
  pattern       = "main"

  enforce_admins          = true
  required_linear_history = true
  allows_force_pushes     = false
  allows_deletions        = false

  required_pull_request_reviews {
    required_approving_review_count = 1
    dismiss_stale_reviews           = true
    require_code_owner_reviews      = true
  }

  required_status_checks {
    strict   = true
    contexts = ["build", "test", "security-scan"]
  }
}

enforce_admins matters more than it looks. If administrators can bypass the rule, an auditor will ask how you know they did not. A CODEOWNERS file then routes sensitive paths to the right reviewers:

# Infrastructure and pipeline changes need platform team review
/terraform/            @example-org/platform
/.github/workflows/    @example-org/platform
# Authentication and payments code need a security reviewer
/src/auth/             @example-org/security
/src/payments/         @example-org/security

Requiring review on the workflow directory closes a common gap. A pipeline that enforces every control is of little value if anyone can edit the pipeline without review.

Add security testing that blocks

Scanning only counts as a control if it can stop a change and if findings are tracked to closure. A minimal set of pipeline steps:

# Secrets committed to the repository
gitleaks detect --source . --redact

# Known vulnerabilities in dependencies and the filesystem
trivy fs --severity HIGH,CRITICAL --exit-code 1 --ignore-unfixed .

# Misconfigurations in Terraform, Kubernetes manifests and Dockerfiles
trivy config --severity HIGH,CRITICAL --exit-code 1 .

# Vulnerabilities in the built image
trivy image --severity HIGH,CRITICAL --exit-code 1 --ignore-unfixed \
  registry.example.com/payments-api:"$GIT_SHA"

Three practices make this defensible in an audit:

  • Define the blocking threshold in a written policy, for example that critical and high findings with an available fix block a merge.
  • Record exceptions. When a finding is accepted, record who approved it, why, and when it will be revisited. An unexplained ignore file is a finding in itself.
  • Set remediation timelines by severity and keep the tickets. Auditors usually sample findings and check they were fixed within your own stated timeline.

Supply chain controls such as signed artifacts and a software bill of materials strengthen this further. The guide to pipeline security with SBOMs, SLSA and policy as code covers them.

Control the path to production

Three properties matter:

  1. One path. Production changes happen only through the pipeline. Human roles in production are read-only by default.
  2. An approval gate. A named approver, who is not the author, releases the production deployment. In GitHub this is an environment with required reviewers.
  3. Short-lived credentials. The pipeline assumes a role through federation, with no stored cloud keys. The CI/CD pipeline audit checklist includes a working example.

Infrastructure changes follow the same rule. A Terraform plan is reviewed in a pull request and applied by the pipeline, not from a laptop.

Emergency changes

Every team eventually needs to bypass the normal path during an incident. Auditors accept this when it is defined in advance. Document who can invoke it, how access is granted and logged, and that every emergency change gets a retrospective review within a fixed number of days. Then keep the records. An undocumented bypass is a control failure. A documented one that was reviewed afterward is the control working.

Collect evidence continuously

Reconstructing evidence at audit time is slow and unreliable. Collect it on a schedule and store it somewhere access-controlled.

# Current branch protection for a repository
gh api repos/example-org/payments-api/branches/main/protection > protection-$(date +%F).json

# Merged pull requests with author, reviewers and merge time
gh pr list --repo example-org/payments-api --state merged --base main --limit 500 \
  --json number,title,author,mergedBy,mergedAt,reviews > merged-prs-$(date +%F).json

# Members without two-factor authentication
gh api "orgs/example-org/members?filter=2fa_disabled" --jq '.[].login'

A scheduled job that runs these across all in-scope repositories and writes to versioned, write-once storage gives you a dated record for the whole audit window.

Check retention as well. CI systems keep workflow logs for a limited period by default, which at the time of writing is 90 days on GitHub and is configurable on some plans. If your audit window is longer than your log retention, export deployment and scan logs to storage you control. The same applies to cloud audit logs.

Gaps that cause findings

GapWhy auditors noticeFix
Protection on some repositories onlyAuditors sample across repositories, and one unprotected production repository is a findingApply protection from code to every in-scope repository
Administrators can bypass rulesThe control is not enforced for the most privileged usersEnforce for administrators and log any override
Author approves own changeNo segregation of dutiesRequire an independent approver
Scans run but never blockThe control detects without preventing, and findings accumulateSet a blocking threshold and a tracked exception process
Direct production access for engineersChanges can bypass the pipelineRead-only by default, with time-limited elevation that is logged
Config and feature flag changes outside reviewProduction behavior changes with no recordPut configuration in version control and log flag changes
Evidence only from todayType II needs proof across the periodScheduled evidence collection from the first day of the window
No offboarding evidenceAccess removal cannot be shownTie source control and cloud access to single sign-on and keep the records

A realistic sequence

  1. Scope. List the repositories, pipelines, cloud accounts and people in scope. Keep development sandboxes out if you can justify it.
  2. Agree the control list with your auditor before building, so the mapping is not a surprise later.
  3. Enforce the basics everywhere: single sign-on, multi-factor authentication, branch protection and required reviews.
  4. Close the production access path: federated pipeline credentials, read-only human access and an approval gate.
  5. Add blocking security scans with a written threshold and exception process.
  6. Automate evidence collection and confirm log retention covers the window.
  7. Run for a few weeks, then self-audit. Sample ten merged changes and try to prove each was reviewed, tested, scanned, approved and deployed through the pipeline.

Step 7 is the most useful. If you cannot assemble the evidence for ten changes quickly, an auditor's sample will not go better.

CloudForge helps teams build these controls into delivery without slowing releases. See DevSecOps consulting for scope, and the SOC 2 pipeline hardening case study for an example engagement.

Sources

Related expertise

Put this into practice

DevSecOps consulting DevOps consulting CI/CD deployment engineering
Continue learning
Eliminating Deployment Bottlenecks: How Enterprise Engineering Teams Ship Code Faster7 min read CI/CD Implementation Services: Scope, Timeline and Pricing7 min read CI/CD Pipeline Audit Checklist: What to Review Before You Trust Your Deployments7 min read

Need these controls built into your pipeline?

CloudForge adds security checks, access controls and audit evidence to delivery pipelines without slowing releases.

See DevSecOps consulting