Module 27 · Advanced · ⏱ 55 min · 🏆 +350 XP

DevSecOps Governance & Agile Audit

Modern software ships 10 times a day. Traditional annual audits are architecturally incompatible with this reality. This module teaches you to govern security inside the development pipeline — embedding controls where code is written, tested, and deployed.

DevSecOpsSDLC Security CI/CD PipelineCompliance as Code Agile AuditSAST/DAST

Learning Objectives

  • Explain the shift-left security principle and why it dramatically reduces remediation cost.
  • Map security controls across the Software Development Lifecycle (SDLC) phases.
  • Identify the critical CI/CD pipeline security gates every GRC professional should require.
  • Apply Compliance as Code to automate policy enforcement in cloud environments.
  • Conduct an agile audit of a sprint-based development organization.
  • Explain the OWASP Top 10 and how GRC governance addresses each risk.

Lecture

1 · The DevSecOps Philosophy

DevSecOps integrates security into every phase of software development — not as a gate at the end of the pipeline, but as a continuous, automated activity throughout. The core insight: finding a vulnerability in development costs $80. Finding it in production after a breach costs $8,000+ (NIST cost data). Security earlier is security cheaper.

The three pillars: People — security training for developers, security champions embedded in dev teams, shared responsibility culture. Process — threat modeling in design, security requirements in user stories, security review in sprint retrospectives. Technology — automated security testing in CI/CD, SAST, DAST, SCA, container scanning.

2 · The Security Cost Curve (Shift Left)

IBM System Science Institute data shows security defect cost escalates exponentially by phase:

Phase FoundRelative Cost to Fix
Design / Requirements
Development / Coding
Testing / QA15×
Production (pre-breach)45×
Post-Breach100×+

This data is the business case for DevSecOps investment. Every $1 spent on security in design phase saves $45–$100 in post-production remediation.

3 · Auditing DevOps — The Challenge

Traditional audit assumes stable, periodic change cycles. DevOps environments ship dozens of changes daily. The audit question shifts from "review the last change" to "is the change management process controlled?" GRC professionals must audit the pipeline and its automated gates — not individual changes.

Governance principle: In a DevOps environment, the CI/CD pipeline IS the change management control. If the pipeline gates are well-designed and cannot be bypassed, every change is controlled — without manual review of each one.

Theory Deep Dive

🔄 Security Controls Across the SDLC — Phase by Phase

1
Requirements Phase

Security user stories and abuse cases defined alongside functional requirements. Regulatory requirements translated into technical security requirements (GDPR → data minimization in data model, PCI-DSS → tokenization of card data). Threat modeling begins at architecture level. Security acceptance criteria defined before any code is written.

2
Design Phase

Threat Modeling (STRIDE/PASTA/Attack Trees): systematically identify threats to the architecture. STRIDE framework: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege. For each identified threat, define mitigating controls before the design is approved. Security architecture review by a security architect before design sign-off.

3
Development Phase

Secure coding guidelines enforced. IDE security plugins provide real-time vulnerability detection as code is written. Secret scanning prevents credentials from being committed to version control (GitGuardian, git-secrets). Peer code review with security checklist. Developer security training tailored to language and framework.

4
Build / CI Pipeline Phase

SAST (Static Application Security Testing): scans source code for vulnerability patterns without executing it. SCA (Software Composition Analysis): identifies known CVEs in open-source dependencies (SBOM generation). Secret scanning: ensures no credentials or keys committed to the build artifact. Infrastructure-as-Code (IaC) scanning: Terraform, CloudFormation templates scanned for misconfigurations before deployment.

5
Test / CD Pipeline Phase

DAST (Dynamic Application Security Testing): tests the running application for vulnerabilities — SQL injection, XSS, authentication flaws. Penetration testing of staging environment. Container image scanning for known CVEs. API security testing. Compliance policy checks run against the deployed environment before promotion to production.

6
Production / Operations Phase

Runtime Application Self-Protection (RASP): detects and blocks attacks within the running application. SIEM log ingestion from application. Regular vulnerability scanning. Patch management SLAs. Penetration testing (annual minimum). Bug bounty programs. Continuous compliance monitoring (CSPM, cloud policy enforcement).

🏗️ CI/CD Pipeline Security Gates — The GRC Audit Checklist

A well-governed CI/CD pipeline has mandatory security gates that cannot be bypassed. GRC professionals audit these gates as the change management control:

GateTool CategoryBlocks Deploy If…GRC Control Objective
Secret ScanningGitGuardian, TrufflesecCredentials or keys found in codePrevent credential exposure via source control
SAST ScanSnyk, Checkmarx, SonarQubeCritical/High findings exceed thresholdPrevent known vulnerability classes in code
SCA / Dependency CheckSnyk, OWASP Dependency-CheckCVSS Critical CVE in dependencyPrevent deployment of vulnerable libraries
Container ScanTrivy, Clair, AnchoreCritical CVE in base imagePrevent deployment of vulnerable containers
IaC Security ScanCheckov, tfsec, TerrascanHigh-severity misconfiguration in IaCPrevent infrastructure misconfigurations
DAST ScanOWASP ZAP, Burp Suite APICritical runtime vulnerability foundPrevent exploitable runtime flaws
Policy Compliance CheckOPA/Rego, AWS Config RulesCompliance policy violation detectedEnforce Compliance as Code before deployment
Change ApprovalServiceNow, JiraRequired approval not obtainedMaintain change authorization audit trail

Every gate in this table represents a control. GRC professionals should audit: (1) Do all these gates exist? (2) Can any gate be bypassed? (3) Is there a documented exception process for gate overrides? (4) Are override decisions logged with business justification and approval?

📋 OWASP Top 10 — GRC Governance Perspective

The OWASP Top 10 is the most widely recognized application security awareness document. For GRC professionals, each risk maps to governance requirements:

A01:2021 Broken Access Control

Most critical OWASP risk. GRC control: authorization testing in every DAST scan, quarterly access review of application roles, principle of least privilege in application design reviews.

A02:2021 Cryptographic Failures

Data in transit and at rest unencrypted. GRC control: cryptography standard mandating TLS 1.2+, AES-256, key management policy, crypto library approved list, automated scan for cleartext transmission.

A03:2021 Injection (SQL, LDAP)

Untrusted input executed as code. GRC control: SAST rules detecting injection patterns, code review checklist item, developer training on parameterized queries, DAST testing for injection.

A04:2021 Insecure Design

Fundamental design flaws. GRC control: mandatory threat modeling in design phase, security architecture review gate before development begins, abuse case documentation.

A05:2021 Security Misconfiguration

Unnecessary features enabled, default credentials. GRC control: IaC scanning, CSPM continuous monitoring, hardening baseline standards, automated configuration compliance.

A06:2021 Vulnerable Components

Known CVEs in libraries. GRC control: SCA in CI pipeline, SBOM requirement, 30-day SLA for critical CVE patching, approved component library management.

⚙️ Compliance as Code — Automating GRC in the Pipeline

Compliance as Code expresses governance policies as machine-executable rules that are automatically enforced in CI/CD pipelines and cloud environments. Key technologies:

1
Open Policy Agent (OPA) / Rego

A general-purpose policy engine. Policies written in Rego language are enforced at deployment time. Example: a Rego policy that blocks deployment of containers running as root, or that requires all S3 buckets to have encryption enabled before Terraform apply completes.

2
AWS Config Rules / Azure Policy

Cloud-native compliance policy engines. Rules continuously evaluate cloud resource configurations against defined policies. Non-compliant resources are flagged, and some rules can automatically remediate (enable encryption, revoke public access). Audit evidence is automatically generated.

3
Infrastructure as Code (IaC) Security

Terraform, CloudFormation, and Kubernetes YAML scanned by Checkov, tfsec, or Terrascan before apply/deploy. Misconfigurations — public S3 buckets, overprivileged IAM roles, unencrypted EBS volumes — caught before infrastructure is provisioned.

4
Automated Evidence Generation

Every pipeline run generates compliance artifacts: scan results, policy check outcomes, approval records. These artifacts are automatically stored in the GRC platform or evidence repository. SOC 2 and ISO 27001 evidence collection becomes automated — the audit preparation time drops from weeks to hours.

"Compliance as Code shifts compliance from an annual point-in-time snapshot to a continuously enforced operating standard. Every deployment either passes or fails the policy check — making compliance a binary property of each release." — DevSecOps Institute, State of DevSecOps Report

🔍 Agile Audit Methodology — Auditing Without Slowing Delivery

Traditional audits request 12 months of change records and review them after the fact. Agile auditing works differently:

Audit the Process, Not Each Change

In a team deploying 50 times/day, you cannot review each deployment. Instead: audit whether the CI/CD pipeline gates are well-designed, mandatory, and cannot be bypassed. A controlled pipeline ensures every change is controlled.

Continuous Audit Evidence

Pipeline artifacts (scan results, approval records, deployment logs) accumulate continuously. The auditor reviews the system that generates evidence, not individual transactions. Sample from the automated log, not from each sprint.

Embed in the Process

Security audit activities embedded in sprint retrospectives and quarterly reviews. Rather than a separate audit event, GRC activities are part of the development cadence — sprint security review, quarterly penetration test, monthly compliance dashboard review.

Risk-Based Sprint Auditing

Not all sprints are equal. Sprints deploying changes to high-risk components (authentication, payment processing, PHI-touching code) receive higher audit attention. Low-risk UI changes receive less. Risk-tiered sampling aligns effort to actual risk.

🧪 Lab — DevSecOps Pipeline Security Audit

You are auditing a DevOps team's CI/CD pipeline for a financial services company. The pipeline deploys directly to production with no manual approval gate. Complete each security gate assessment — SAST, SCA, secrets scanning, image signing, and DAST — documenting findings in audit language.

Scenario — DevOps Deploys 10× Per Day: How Do You Audit That?

Mission Quiz

Mission Complete

← Module 26 Next: Module 28 →