DevOps

Chapter 11
DevSecOps, Software Supply Chain, and Compliance

Bachelors Program in Computer Applications
DevOps   •   Bachelor

DevSecOps, Software Supply Chain, and Compliance

Introduction

Modern software is assembled and delivered through a network of source repositories, developers, cloud platforms, build services, open-source packages, container registries, deployment tools, and operating environments. This network is the software supply chain. A weakness in any link can compromise confidentiality, integrity, availability, privacy, or regulatory compliance.

DevSecOps is the integration of security practices into development and operations rather than treating security as a final inspection. Its strategic purpose is to make secure delivery repeatable, observable, and proportionate to risk. Security becomes a shared responsibility supported by automation, policy, evidence, and informed human judgment.

This chapter explains threat modeling, secure coding, identity controls, vulnerability and dependency management, software bills of materials (SBOMs), artifact signing, secrets protection, zero-trust principles, auditability, and compliance-oriented pipeline design.

Learning Objectives

After studying this chapter, students should be able to:

  1. Explain DevSecOps and the risks of the modern software supply chain.
  2. Apply a basic threat-modeling method to a software system.
  3. Distinguish code, dependency, container, infrastructure, and runtime security controls.
  4. Design identity, secrets, signing, and verification controls for a delivery pipeline.
  5. Explain how SBOMs, provenance, vulnerability management, and audit logs support assurance.
  6. Relate technical controls to governance, compliance, ethics, and organizational risk.
  7. Evaluate a DevSecOps implementation and recommend improvements.

1. DevSecOps as a Secure Delivery System

Traditional delivery models often placed security after coding or immediately before release. This produced late findings, expensive rework, weak ownership, and pressure to waive controls. DevSecOps shifts security left by identifying risks early, but it also shifts security right by monitoring deployed systems and responding to incidents. “Left” and “right” are therefore complementary, not competing, ideas.

A mature DevSecOps system has six characteristics:

  • Shared responsibility: developers, operations, security specialists, product owners, and managers jointly own outcomes.
  • Automation: repeatable checks are executed by pipelines rather than dependent on memory.
  • Risk-based control: critical assets and high-impact threats receive stronger controls.
  • Traceability: a release can be connected to source code, dependencies, builders, approvals, and deployment records.
  • Continuous feedback: findings are corrected and used to improve engineering practices.
  • Evidence preservation: logs and reports demonstrate what was checked, by whom, and with what result.

DevSecOps is not simply the purchase of a security scanner. A scanner that produces thousands of unactionable findings can reduce security by creating alert fatigue. Effective practice combines tools, policies, skilled interpretation, and remediation workflows.

2. The Software Supply Chain

The software supply chain includes both artifacts and the processes that create, transport, and execute them. Typical elements include:

  1. requirements and design decisions;
  2. source code and version-control history;
  3. third-party libraries and package managers;
  4. build servers, runners, compilers, and plugins;
  5. container base images and operating-system packages;
  6. artifact repositories and release systems;
  7. deployment credentials and infrastructure definitions;
  8. production images, services, and update mechanisms.

Threats include malicious or compromised dependencies, typosquatted packages, stolen credentials, poisoned build environments, unauthorized code changes, vulnerable base images, counterfeit artifacts, and insecure update channels. A supply-chain attack may occur without exploiting the final application directly.

Secure software supply chain Sourcereview + history Buildisolated + tested ArtifactSBOM + signature Deploypolicy verification Operatemonitor + respond feedback, incident response, and continuous improvement Security controls and evidence accompany the artifact
Secure software supply chain from source to monitored production
Figure: Secure software supply chain from source to monitored production

Figure: A secure supply chain applies controls and preserves evidence from source through operation.

3. Threat Modeling

Threat modeling is a structured method for identifying what can go wrong, why it might happen, and which controls reduce the risk. It should begin during requirements and design, then be revisited when architecture, dependencies, or trust boundaries change.

A practical process is:

  1. Define scope and assets. Identify data, services, identities, interfaces, and business impacts.
  2. Draw data flows. Show components, data stores, external entities, and trust boundaries.
  3. Identify threats. Consider spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privilege—the STRIDE categories.
  4. Assess risk. Consider likelihood, exploitability, affected assets, and impact.
  5. Select controls. Prefer prevention, but include detection, response, recovery, and compensating controls.
  6. Record assumptions and owners. A threat without an owner is unlikely to be addressed.
  7. Validate continuously. Test whether controls work in the actual pipeline and runtime.

Threat modeling is not a prediction of every attack. It is a disciplined prioritization technique. A low-likelihood threat may still require treatment when its impact is catastrophic, while a frequent but harmless alert may receive lower priority.

4. Secure Coding and Verification

Secure coding prevents vulnerabilities at their origin. Essential practices include input validation, output encoding, parameterized database queries, safe deserialization, explicit authorization checks, secure error handling, and careful handling of file paths and operating-system commands. Validation should be based on expected formats and business rules, not merely on blocking a few known “bad” characters.

Authentication answers “Who are you?” Authorization answers “What may you do?” Confusing the two produces serious defects. Authorization should be enforced on the server, close to the protected operation, and checked for every sensitive object or action. The principle of least privilege grants only the permissions required for a task.

Pipeline verification may include:

  • peer review and protected branches;
  • static application security testing (SAST);
  • software composition analysis (SCA);
  • secret detection;
  • dynamic application security testing (DAST);
  • infrastructure-as-code scanning;
  • container image scanning;
  • unit, integration, abuse-case, and security regression tests.

No tool detects every defect. SAST may produce false positives and miss runtime configuration errors; DAST observes externally visible behavior but may not reach untested paths; penetration testing provides expert exploration but is periodic and costly. Controls should therefore be layered.

5. Identity, Access, and Zero Trust

Identity is the foundation of pipeline security. Human users should use federated authentication and multi-factor authentication where appropriate. Workloads should use short-lived, narrowly scoped identities rather than shared passwords or permanent access keys. Administrative actions should be separately authorized and logged.

A secure pipeline commonly separates identities for source control, building, artifact publication, deployment, and production administration. A build process should not automatically possess unrestricted production credentials. Environment promotion should require a verifiable policy decision, and emergency access should be time-limited and reviewed.

Zero trust is a security model based on the principle “never trust, always verify.” It does not mean that trust is literally absent; it means that location, network membership, or previous authentication is insufficient by itself. Access decisions should consider identity, device or workload posture, requested resource, context, and policy. Segmentation, mutual authentication, authorization at service boundaries, and continuous monitoring support this model.

6. Vulnerability and Dependency Management

A vulnerability is a weakness that can be exploited under particular conditions. A vulnerability identifier or severity score does not by itself determine organizational risk. Teams should consider exploit availability, exposure, affected functionality, compensating controls, asset criticality, and whether the vulnerable code is reachable.

Dependency management should include:

  • approved package sources and registries;
  • lockfiles or equivalent version constraints;
  • review of transitive dependencies;
  • removal of unused packages;
  • version update automation;
  • vulnerability monitoring;
  • license review;
  • reproducible or sufficiently controlled builds;
  • an exception process with expiry dates and owners.

A practical remediation workflow is to detect, triage, assign, fix or mitigate, verify, and close. “Fix immediately” is not always technically possible, but “ignore indefinitely” is not an acceptable strategy. A risk-based service-level policy can assign shorter response periods to actively exploited or internet-facing vulnerabilities.

7. SBOMs, Provenance, and Artifact Signing

An SBOM is a machine-readable inventory of components in a software artifact. It may identify direct and transitive dependencies, versions, suppliers, licenses, and relationships. Common formats include SPDX and CycloneDX. An SBOM improves visibility, incident response, procurement, and license management, but it is not proof that software is secure. An inaccurate or incomplete SBOM can create false confidence.

Provenance records how an artifact was produced: source revision, builder identity, build parameters, dependencies, and time or environment information. Artifact signing uses a cryptographic signature to bind an artifact to an identity or key. Verification can establish that the artifact has not changed since signing and that it was signed by an authorized party. Signing does not prove that the code is free of vulnerabilities or that the signer behaved honestly.

A robust release process therefore performs the following sequence:

  1. obtain reviewed source at a fixed revision;
  2. build in a controlled environment;
  3. generate test, scan, SBOM, and provenance results;
  4. sign the artifact and relevant metadata;
  5. store the artifact in a controlled registry;
  6. verify signatures and policy before deployment;
  7. record deployment identity and environment.

Keys require protection, rotation, access control, and recovery planning. Hardware-backed key storage or a managed signing service may reduce exposure. If a key is compromised, organizations need revocation or trust-policy procedures and a way to identify affected artifacts.

8. Secrets Protection

Secrets include passwords, API tokens, private keys, certificates, encryption keys, and database connection strings. They should not be committed to source code, placed in container images, printed in logs, or embedded in build artifacts.

Preferred controls include a centralized secrets manager, encryption in transit and at rest, workload identity, short-lived credentials, automatic rotation, access logging, masking in pipeline output, and separate secrets for development, testing, and production. Secret scanning is useful but cannot compensate for a leaked credential; suspected exposure requires revocation or rotation and investigation.

The safest secret is often one that is not created. For example, a workload identity can obtain narrowly scoped access from an identity provider without a long-lived static token being stored in the repository.

9. Auditability and Compliance

Compliance is the demonstrable fulfillment of applicable laws, regulations, contractual commitments, and organizational policies. Security controls may support compliance, but compliance is not identical to security. A system can satisfy a checklist while retaining unacceptable technical risk; conversely, a strong technical control may require documentation showing how it meets a particular obligation.

Auditability requires evidence that is attributable, complete enough for its purpose, protected from unauthorized alteration, and retained for the required period. Useful evidence includes:

  • source reviews and approval records;
  • pipeline definitions and version history;
  • scan results and remediation decisions;
  • SBOMs and provenance statements;
  • signing and verification records;
  • access-control changes;
  • deployment records;
  • incident, exception, and recovery documentation.

Logs should be time-synchronized, access-controlled, monitored, and designed to avoid exposing sensitive data. An audit trail should answer: who performed an action, what changed, when it occurred, which system performed it, and what authorization supported it. Privacy principles require collecting only appropriate evidence and limiting access to it.

Compliance mapping should begin with obligations, then identify control objectives, technical and procedural controls, evidence sources, owners, and review frequency. Examples of relevant frameworks and regulations vary by context and jurisdiction, including NIST guidance, ISO/IEC 27001, SOC 2, privacy laws, sectoral requirements, and software security procurement rules. Students must verify current legal requirements rather than relying on an outdated checklist.

10. Policy as Code and Pipeline Gates

Policy as code expresses rules in machine-evaluable form. Examples include rejecting unsigned images, preventing deployment of an artifact without an SBOM, prohibiting privileged containers, or requiring approval for production promotion. Policies should be versioned, tested, reviewed, and accompanied by documented exceptions.

Pipeline gates should be proportional. A critical, confirmed vulnerability in an internet-facing component may block release. A low-confidence finding in unreachable code may create a ticket and require review rather than an automatic stop. Gates should have clear ownership and an appeal or emergency process. Every exception should state its rationale, compensating control, approver, and expiration date.

Illustrative Case: Meridian Payments

Background

Meridian Payments, an illustrative regional payment provider, operated several Java and containerized services. Developers used public package repositories, builds ran on shared workers, and production deployments used a long-lived service account. The organization had vulnerability scans but no reliable inventory of deployed components.

Problem

A compromised third-party package was discovered in the industry. Meridian could not quickly determine whether it was present because package versions differed between environments and build records were incomplete. Investigation also found credentials in an old build log.

Analysis

The primary weaknesses were excessive identity privileges, uncontrolled dependency resolution, lack of artifact provenance, inadequate secret handling, and incomplete evidence. Scanning alone had not addressed these structural problems.

Approach and Solution

Meridian introduced protected source branches, dependency lockfiles, an internal package mirror, isolated ephemeral build workers, and separate identities for build and deployment. The pipeline generated an SBOM and provenance record, signed release artifacts, and required signature verification before deployment. Secrets moved to a managed vault with short-lived workload credentials. SAST, SCA, image scanning, and secret detection were combined with risk-based gates. Production logs were centralized, access-controlled, and linked to deployment records. Exceptions required security ownership and expiration dates.

Outcome

When the package advisory was published, Meridian queried its SBOM inventory and identified affected artifacts rapidly. It revoked the exposed credential, rebuilt from a clean source revision, verified signatures, and documented the response. The new process did not eliminate all risk, but it materially improved visibility, containment, and accountability.

Learning Points

The case demonstrates that supply-chain security is a system property. It depends on trustworthy identities, controlled inputs, reproducible or traceable builds, verifiable artifacts, operational monitoring, and practiced response—not on one scanner or one compliance certificate.

Challenges and Limitations

DevSecOps introduces trade-offs. More checks may increase pipeline duration; aggressive gates may encourage bypasses; automated tools may generate false positives; SBOMs may omit runtime-loaded components; signing may be weakened by poor key management; and centralized security teams may become bottlenecks.

Organizations should measure both security and delivery outcomes. Useful indicators include time to remediate serious findings, percentage of releases with verified provenance, percentage of workloads using short-lived identities, mean time to revoke exposed secrets, exception age, and deployment-change traceability. Metrics must not become targets that encourage concealment or superficial compliance.

Ethically, teams should protect user privacy, avoid collecting unnecessary telemetry, disclose vulnerabilities responsibly, and consider the effects of outages caused by automated blocking. Security decisions should account for accessibility, reliability, and the potential harm to users who depend on the system.

Best-Practice Checklist

  • Model threats before implementation and revisit them after significant change.
  • Protect source branches and require meaningful review.
  • Pin and monitor dependencies from controlled sources.
  • Scan code, dependencies, infrastructure, images, and secrets using layered controls.
  • Use least privilege, multifactor authentication, workload identity, and short-lived credentials.
  • Generate and validate SBOMs and provenance.
  • Sign artifacts and verify signatures before deployment.
  • Keep secrets out of repositories, images, logs, and artifacts.
  • Preserve tamper-resistant, privacy-aware audit evidence.
  • Make policy and exceptions explicit, versioned, reviewed, and time-bound.
  • Practice incident response and recovery, not merely prevention.

Chapter Summary

DevSecOps embeds security throughout the software lifecycle. The software supply chain extends from requirements and source code to dependencies, builders, artifacts, deployment systems, and production services. Threat modeling identifies assets, trust boundaries, threats, and suitable controls. Secure coding, layered testing, dependency governance, and vulnerability management reduce weaknesses before release.

Identity controls and zero-trust principles limit what people and workloads can do. Secrets managers, short-lived credentials, artifact signing, SBOMs, and provenance improve protection and traceability. Auditability connects actions and artifacts to accountable identities and supports both incident response and compliance. Effective governance uses policy as code, risk-based gates, documented exceptions, and evidence that is reliable without violating privacy. The central lesson is that secure delivery is a coordinated socio-technical process rather than a single tool or final-stage inspection.

Key Terms

DevSecOps: Integrating security practices, responsibilities, and evidence into development and operations.

Software supply chain: The people, processes, tools, dependencies, and environments used to create and deliver software.

Threat modeling: Structured identification and treatment of threats to a system.

Trust boundary: A point where data or control passes between entities with different trust assumptions.

STRIDE: A threat classification model covering spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privilege.

SAST: Static analysis of application source or compiled code.

DAST: Security testing of a running application from an external perspective.

SCA: Analysis of third-party and open-source components.

Least privilege: Granting only the access required for an authorized task.

Zero trust: An architecture that continuously verifies access rather than trusting network location.

SBOM: A machine-readable inventory of software components and relationships.

Provenance: Evidence describing how, where, and from which inputs an artifact was produced.

Artifact signing: Cryptographic binding of an artifact to an authorized signing identity.

Secrets manager: A controlled service for storing, accessing, rotating, and auditing sensitive credentials.

Vulnerability: A weakness that may be exploited under specified conditions.

Policy as code: Machine-evaluable, version-controlled security or compliance rules.

Auditability: The ability to reconstruct and verify relevant actions and decisions.

Compensating control: An alternative measure that reduces risk when a preferred control is unavailable.

Exception: An approved, documented deviation from a policy or control requirement.

Review Questions

Short Answer Questions

  1. What is the main difference between traditional security inspection and DevSecOps?
  2. Define an SBOM and state one limitation of using it.
  3. Distinguish authentication from authorization.
  4. Why should pipeline identities be separated by function?
  5. What information should an auditable deployment record contain?

Long Answer Questions

  1. Explain the stages of a practical threat-modeling process and illustrate them with a web application.
  2. Discuss how dependency management, vulnerability scanning, and exception handling should operate as one process.
  3. Explain how SBOMs, provenance, and artifact signing complement one another.
  4. Compare the benefits and limitations of SAST, DAST, SCA, and penetration testing.
  5. Discuss why compliance should be treated as evidence-based governance rather than a checklist exercise.

Analytical / Application Questions

  1. A build server can publish artifacts and directly deploy to production using one permanent credential. Analyze the risks and design a safer identity and promotion model.
  2. An organization has excellent vulnerability scanning but cannot identify which version of a library is running in production. What supply-chain controls are missing, and how should they be introduced?
  3. A critical vulnerability is found in a component used by a low-risk internal service and a public payment API. Propose a risk-based remediation and release-gating decision for both systems.

Multiple Choice Questions with Answers

Question 1

Which statement best describes DevSecOps?

A. Security is performed only after deployment

B. Security responsibilities and controls are integrated throughout delivery and operation

C. Only security specialists may modify software

D. Automated scanning replaces human judgment

Correct Answer: B. Security responsibilities and controls are integrated throughout delivery and operation

Question 2

What is the primary purpose of an SBOM?

A. To prove that software contains no vulnerabilities

B. To encrypt application source code

C. To inventory software components and their relationships

D. To replace artifact signatures

Correct Answer: C. To inventory software components and their relationships

Question 3

Which practice most directly supports least privilege for a build pipeline?

A. Using one shared administrator account

B. Giving the build process permanent production access

C. Using a narrowly scoped, short-lived build identity

D. Storing credentials in the source repository

Correct Answer: C. Using a narrowly scoped, short-lived build identity

Question 4

What does artifact signing primarily help establish?

A. That the artifact is free of all defects

B. That the artifact has not changed and is associated with an authorized signer

C. That the artifact has passed every regulatory audit

D. That the artifact will never be compromised after deployment

Correct Answer: B. That the artifact has not changed and is associated with an authorized signer

Question 5

Which activity is an example of SCA?

A. Reviewing a user interface layout

B. Analyzing third-party libraries for vulnerabilities and licenses

C. Measuring server temperature

D. Designing a network cable

Correct Answer: B. Analyzing third-party libraries for vulnerabilities and licenses

Question 6

In a zero-trust model, access is primarily based on:

A. Physical location inside the corporate network

B. Previous trust granted to the network

C. Continuous verification of identity, context, and authorization

D. The age of the user account

Correct Answer: C. Continuous verification of identity, context, and authorization

Question 7

Which action is most appropriate after a credential is exposed in a build log?

A. Leave it unchanged if the log is old

B. Rename the log file only

C. Revoke or rotate the credential and investigate its use

D. Add the credential to a second log

Correct Answer: C. Revoke or rotate the credential and investigate its use

Question 8

Which statement about compliance is most accurate?

A. Compliance and security are exactly identical

B. Compliance requires demonstrable fulfillment of applicable obligations, but does not guarantee complete security

C. Compliance eliminates the need for monitoring

D. Compliance requires every vulnerability to be fixed immediately

Correct Answer: B. Compliance requires demonstrable fulfillment of applicable obligations, but does not guarantee complete security

Question 9

What is provenance evidence intended to describe?

A. The color scheme of an application

B. How an artifact was produced, including relevant inputs and builder information

C. The personal preferences of end users

D. Only the final deployment time

Correct Answer: B. How an artifact was produced, including relevant inputs and builder information

Question 10

Why should automated security gates be risk-based?

A. To ensure that no findings are ever recorded

B. To balance security impact, confidence, exposure, and delivery consequences

C. To allow critical vulnerabilities to pass automatically

D. To eliminate the need for exception ownership

Correct Answer: B. To balance security impact, confidence, exposure, and delivery consequences

DevOps
Chapter 11 of 15