Skip to content

Compliance and Audit

First PublishedByAtif Alam

Organizations subject to SOC 2, HIPAA, PCI DSS, ISO 27001, or internal governance policies need CI/CD pipelines that produce evidence — who changed what, who approved it, and what was deployed. This page covers the practices that make CI/CD auditable and compliant.

Auditors ask questions like:

QuestionWhat They Want to See
Who can deploy to production?RBAC, branch protection, approval gates
Was this change reviewed before deployment?PR reviews, merge policies
What exactly was deployed?Artifact provenance, image digests, SBOM
Can a single person push code to production?Separation of duties
Is there an audit trail?Git history, deployment logs, approval records
How do you handle vulnerabilities?Security scanning, patching SLAs

CI/CD, when configured correctly, automates most of these controls — generating audit evidence as a byproduct of the normal workflow.

Every change flows through Git, creating an immutable audit trail:

Commit: a1b2c3d
Author: alice@example.com
Date: 2026-02-17T10:30:00Z
Message: feat: add payment processing (#142)
Signed: GPG signature verified
PR: #142 (reviewed by bob@example.com, approved by carol@example.com)
Merged by: carol@example.com
Pipeline: Build #847 (passed all stages)
Deployed: staging at 10:35 UTC, production at 11:00 UTC (approved by dave@example.com)

This chain answers: who made the change, who reviewed it, who approved deployment, and when it reached production.

CI/CD platforms maintain deployment history:

PlatformWhere to Find It
GitHub ActionsActions tab → workflow runs → job logs
GitLab CICI/CD → Pipelines → job logs, Environments → deployment history
JenkinsBuild history per job, audit log plugin
ArgoCDApplication history, sync events

For compliance, forward CI/CD logs to a centralized system:

CI/CD events ──► Event stream ──► SIEM / Log Analytics
- Pipeline runs - Splunk
- Deployments - Elastic
- Approvals - Azure Sentinel
- Secret access - AWS CloudTrail
- Permission changes

Separation of duties means no single person can write code AND deploy it to production without oversight:

Developer: Writes code, opens PR
Reviewer: Reviews and approves the PR (different person)
Pipeline: Builds, tests, scans automatically
Approver: Approves production deployment (can be the reviewer or a release manager)
Pipeline: Deploys to production
ControlHow to Implement
Code review requiredBranch protection: require 1+ approving review before merge
Author cannot approve own PRBranch protection: dismiss stale reviews, require different person
Production deploy approvalEnvironment protection rules: require named approvers
No direct push to mainBranch protection: require PR, no force push
Limited deploy permissionsRBAC: only specific teams can trigger production deploy
Branch: main
✓ Require pull request before merging
✓ Require 1 approving review
✓ Dismiss stale reviews when new commits are pushed
✓ Require review from code owners
✓ Require status checks to pass (CI pipeline)
✓ Require signed commits (optional, for high-security)
✓ Do not allow bypassing the above settings
Project Settings → Merge Requests
✓ Approvals required: 2
✓ Prevent approval by author
✓ Prevent approval by committers
✓ Require code owner approval
✓ Prevent pushing to protected branches

GPG-signed commits prove that a commit was made by the claimed author — not forged:

Terminal window
# Configure GPG signing
git config --global commit.gpgsign true
git config --global user.signingkey <GPG-KEY-ID>
# Signed commits show as "Verified" in GitHub/GitLab
git log --show-signature
PlatformHow
GitHubBranch protection → “Require signed commits”
GitLabPush rules → “Reject unsigned commits”

Git 2.34+ supports SSH keys for signing — no GPG setup needed:

Terminal window
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true

Formal change management processes require evidence that changes were planned, reviewed, tested, and approved.

A typical change record includes:

FieldSource
Change descriptionPR title and body
Risk assessmentPR labels (e.g. risk:high, risk:low)
Testing evidenceCI pipeline status (all green)
Security scan resultsSAST/SCA/container scan reports
Reviewer(s)PR review approvals
ApprovalEnvironment protection approval in CI/CD
Deployment timeCI/CD deployment logs
Rollback planDocumented in PR or deployment runbook
# GitHub Actions — create a deployment record
- name: Record deployment
run: |
echo "## Deployment Record" > deployment-record.md
echo "**Version:** ${{ github.sha }}" >> deployment-record.md
echo "**Deployed by:** ${{ github.actor }}" >> deployment-record.md
echo "**Time:** $(date -u)" >> deployment-record.md
echo "**Environment:** production" >> deployment-record.md
echo "**PR:** #${{ github.event.pull_request.number }}" >> deployment-record.md
echo "**Pipeline:** ${{ github.run_id }}" >> deployment-record.md
- name: Upload record
uses: actions/upload-artifact@v4
with:
name: deployment-record
path: deployment-record.md
retention-days: 365

Provenance proves where an artifact came from and how it was built:

SLSA (Supply-chain Levels for Software Artifacts)

Section titled “SLSA (Supply-chain Levels for Software Artifacts)”

SLSA is a framework for supply chain security with increasing levels:

LevelRequirement
SLSA 1Build process is documented
SLSA 2Build runs on a hosted service, generates provenance
SLSA 3Build environment is hardened, provenance is non-forgeable
SLSA 4Two-person review, hermetic build, provenance is signed
- uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
with:
image: ghcr.io/myorg/myapp
digest: ${{ steps.build.outputs.digest }}
Terminal window
# Sign an image (Sigstore keyless signing)
cosign sign ghcr.io/myorg/myapp@sha256:abc123...
# Verify signature before deployment
cosign verify ghcr.io/myorg/myapp@sha256:abc123... \
--certificate-identity=https://github.com/myorg/myapp/.github/workflows/build.yml@refs/heads/main \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com

An SBOM lists every component in your software:

Terminal window
# Generate SBOM
syft ghcr.io/myorg/myapp:1.4.0 -o spdx-json > sbom.json
# Attach SBOM to the image
cosign attach sbom --sbom sbom.json ghcr.io/myorg/myapp:1.4.0

See Security Scanning for more on SBOM.

SOC 2 CriteriaCI/CD Control
CC6.1 — Logical access controlsBranch protection, RBAC, environment protection
CC6.2 — Access provisioningTeam-based permissions, code owners
CC8.1 — Change managementPR reviews, approval gates, pipeline status checks
CC7.1 — MonitoringPipeline logs, deployment alerts, security scanning
CC7.2 — Incident responseRollback procedures, deployment history
PCI RequirementCI/CD Control
6.3 — Secure developmentSAST, SCA, code review
6.4 — Change controlPR approval, separation of duties
6.5 — Vulnerability managementDependency scanning, container scanning
10.1 — Audit trailsGit history, pipeline logs, deployment records
HIPAA RequirementCI/CD Control
Access controlRBAC, MFA, environment protection
Audit controlsPipeline logs, deployment history, access logs
IntegritySigned commits, image signing, immutable tags
Transmission securityTLS for registry access, encrypted secrets
ControlImplementation
DevelopmentAny developer can deploy; no approval needed
StagingAuto-deploy from main; team can trigger manually
ProductionRequire approval from 1+ named reviewers; branch restriction (main only)
HotfixExpedited review (1 reviewer minimum); post-incident review within 24 hours
jobs:
deploy-production:
environment:
name: production
url: https://myapp.com
# GitHub checks:
# - Required reviewers (configured in Settings → Environments)
# - Wait timer (optional)
# - Deployment branches (only main)
steps:
- run: ./deploy.sh production

A checklist for CI/CD compliance readiness:

  • Branch protection enabled on main (require PR, reviews, status checks).
  • No direct push to production branches.
  • Environment protection rules for staging and production.
  • RBAC configured — least-privilege for CI/CD permissions.
  • MFA required for all accounts with deploy access.
  • All changes go through PR with at least 1 reviewer.
  • Author cannot approve their own PR.
  • CI pipeline must pass before merge is allowed.
  • Production deployment requires manual approval from named approvers.
  • Git history preserved (no force push to protected branches).
  • CI/CD logs retained for required period (e.g. 1 year).
  • Deployment history tracked with timestamps, actors, and versions.
  • Signed commits enabled (recommended for high-security).
  • SAST, SCA, and container scanning in the pipeline.
  • Secret detection (gitleaks, pre-commit hooks).
  • Secrets stored in platform secret store (not in code).
  • OIDC for cloud authentication (no long-lived credentials).
  • Image scanning on push.
  • Image tag immutability enabled.
  • Container images signed (cosign).
  • SBOM generated and stored for each release.
  • Lifecycle policies for artifact retention.
  • Git is your audit trail — commits, PRs, reviews, and merges provide evidence of who changed what and who approved it.
  • Separation of duties — require PR reviews, prevent self-approval, and use environment protection for production.
  • Branch protection is the foundation — no direct pushes, require reviews and passing CI.
  • Signed commits and images prove provenance and prevent tampering.
  • SBOM and SLSA provide supply chain transparency for compliance frameworks.
  • Automate evidence generation — let the pipeline produce deployment records, scan reports, and approval logs.
  • Map CI/CD controls to your compliance framework (SOC 2, PCI, HIPAA) and let auditors review the automated evidence.