14.4 Software Supply Chain, Container Scanning & Cloud Defender
Key Takeaways
- Software supply chain security mandates maintaining an auditable Software Bill of Materials (SBOM) using standards like SPDX generated via SbomTool@1.
- Dependabot provides continuous Software Composition Analysis (SCA), automatically dispatching alerts and opening automated pull requests with patched library versions.
- Microsoft Defender for Containers performs automated vulnerability assessments of container images in Azure Container Registry (ACR) upon push and continuous rescanning.
- Azure Policy for Kubernetes enforces container security gates at runtime by blocking the deployment of images with Critical or High severity CVEs to AKS clusters.
- Microsoft Defender for Cloud DevOps Security bridges code-to-cloud security posture, mapping discovered code and pipeline vulnerabilities to runtime cloud resources.
14.4 Software Supply Chain, Container Scanning & Cloud Defender
Modern cloud-native applications rarely consist entirely of proprietary code. Industry studies show that 80% to 90% of code in modern enterprise applications comes from third-party open-source libraries, frameworks, and base container images. While open-source ecosystems dramatically accelerate development velocity, they introduce severe software supply chain vulnerabilities—such as the widespread Log4Shell exploit, typosquatting attacks, and compromised package repositories.
On the AZ-400 exam, candidates must demonstrate the ability to govern the entire software supply chain. This encompasses generating standard Software Bill of Materials (SBOM) manifests, automating dependency vulnerability remediation with Dependabot, securing containerized workloads in Azure Container Registry (ACR), and unifying pipeline-to-runtime posture with Microsoft Defender for Cloud DevOps Security.
1. Software Supply Chain Security & SBOM Generation
A Software Supply Chain encompasses everything that touches an application before it reaches production: third-party dependencies, build infrastructure, package managers, base container images, and deployment scripts. Compromising any single link in this chain allows adversaries to inject malicious code into trusted downstream production systems.
Traditional Vulnerability Vector: Direct Code Injection
Attacker ──> [Attacks Enterprise App] ──> Blocked by Firewalls / WAF
Software Supply Chain Attack Vector: Indirect Transitive Dependency
Attacker ──> [Compromises Open-Source Package on npm/NuGet]
│
▼
[Legitimate Update Pushed to Registry]
│
▼
[CI Pipeline Restores Package via npm install]
│
▼
[Enterprise Builds & Signs Contaminated Binary]
│
▼
[Production Deploy: Full Enterprise Compromise]
The Software Bill of Materials (SBOM)
A Software Bill of Materials (SBOM) is a formalized, machine-readable inventory of all components, libraries, transitive dependencies, metadata, and licensing details that comprise a software build artifact. Governed by global cybersecurity standards (such as US Executive Order 14028), enterprise DevOps pipelines must generate an SBOM for every release build.
Industry SBOM Standards
- SPDX (Software Package Data Exchange - ISO/IEC 5962:2021): The international standard format for communicating software package components, licenses, copyrights, and cryptographic hashes. Microsoft's tooling natively outputs SPDX 2.2 JSON manifests.
- CycloneDX: A lightweight, application-security-focused SBOM standard developed by the OWASP foundation, popular for container and software bill of materials analysis.
Generating an SBOM in Azure Pipelines via SbomTool@1
Microsoft provides the open-source Salus SBOM generation tool integrated as the SbomTool@1 task in Azure Pipelines. It automatically inspects build output directories, detects package dependencies (NuGet, npm, Maven, PyPI), generates an SPDX 2.2 compliant manifest.spdx.json, and signs the manifest:
# Generating and Publishing an SPDX SBOM in Azure Pipelines
- task: DotNetCoreCLI@2
displayName: 'Build and Publish Web API'
inputs:
command: 'publish'
publishWebProjects: true
arguments: '--configuration Release --output $(Build.ArtifactStagingDirectory)/app'
- task: SbomTool@1
displayName: 'Generate Software Bill of Materials (SPDX)'
inputs:
# Root directory of compiled artifacts to catalog
buildDropPath: '$(Build.ArtifactStagingDirectory)/app'
# Root source code repository path
buildComponentPath: '$(Build.SourcesDirectory)'
packageVersion: '$(Build.BuildNumber)'
packageName: 'ContosoPaymentService'
packageSupplier: 'Contoso Enterprise DevOps'
# Manifest output folder
manifestDirPath: '$(Build.ArtifactStagingDirectory)/app/_manifest'
- task: PublishPipelineArtifact@1
displayName: 'Publish Build Drop with SBOM Manifest'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/app'
artifact: 'ProductionDrop'
publishLocation: 'pipeline'
2. Dependabot: Dependency Vulnerability & Version Management
Open-source components frequently contain known security vulnerabilities cataloged in the GitHub Advisory Database (with mapped CVE and GHSA identifiers). Dependabot provides automated Software Composition Analysis (SCA) directly within GitHub and Azure DevOps.
┌────────────────────────────────────────────────────────────────────────┐
│ Dependabot Core Operational Modes │
├───────────────────────────────────┬────────────────────────────────────┤
│ Dependabot Alerts │ Dependabot Security Updates │
├───────────────────────────────────┼────────────────────────────────────┤
│ • Scans package manifests │ • Automatically generates a PR │
│ • Notifies developers of CVEs │ • Updates to minimum secure patch │
│ • Non-intrusive security triage │ • Runs CI tests against patch PR │
├───────────────────────────────────┼────────────────────────────────────┤
│ Dependabot Version Updates │ Dependabot Grouped Updates │
├───────────────────────────────────┼────────────────────────────────────┤
│ • Scheduled maintenance PRs │ • Consolidates multiple package │
│ • Keeps libraries on latest release│ updates into a single PR │
│ • Governed via dependabot.yml │ • Reduces developer PR fatigue │
└───────────────────────────────────┴────────────────────────────────────┘
Dependabot Alerts vs. Dependabot Security Updates
- Dependabot Alerts: Continuously monitors dependency manifests (
package.json,pom.xml,requirements.txt,Directory.Packages.props). When a library matches a new CVE, Dependabot creates a security alert with CVSS severity scoring and remediation advice. Alerts do not modify code. - Dependabot Security Updates: When an alert is detected, Dependabot automatically opens a Pull Request that modifies the project's dependency manifest to bump the vulnerable library to the minimum version required to patch the flaw. It does not perform breaking major version upgrades, minimizing regression risk.
Configuring Dependabot Version Updates (dependabot.yml)
While security updates trigger reactively on CVE discovery, Dependabot version updates run on a proactive schedule to prevent technical debt. Configured via .github/dependabot.yml:
# .github/dependabot.yml: Multi-Ecosystem Version Maintenance
version: 2
updates:
# Maintain npm frontend dependencies
- package-ecosystem: "npm"
directory: "/src/frontend"
schedule:
interval: "weekly"
day: "monday"
time: "04:00"
timezone: "America/New_York"
open-pull-requests-limit: 10
reviewers:
- "frontend-leads"
labels:
- "dependencies"
- "javascript"
# Group patch updates to reduce PR noise
groups:
minor-and-patch:
patterns:
- "*"
update-types:
- "patch"
- "minor"
# Maintain NuGet backend dependencies
- package-ecosystem: "nuget"
directory: "/src/backend"
schedule:
interval: "daily"
open-pull-requests-limit: 5
commit-message:
prefix: "build(deps)"
include: "scope"
3. Container Vulnerability Scanning in Azure Container Registry (ACR)
Deploying microservices to container runtimes like Azure Kubernetes Service (AKS) or Azure Container Apps introduces another supply chain layer: the container image itself. If a base operating system image contains vulnerable system packages (e.g., outdated glibc or openssl), the containerized microservice can be compromised regardless of how secure the application code is.
Pipeline: docker build ──> docker push ──> [Azure Container Registry (ACR)]
│
1. Push Trigger Scan
│
▼
[Defender for Containers]
(Vulnerability Assessment)
│
▼
[Security Findings & CVEs]
(Critical, High, Med, Low)
│
▼
[Azure Policy Kubernetes Gate]
│
┌────────────────────────┴────────────────────────┐
▼ ▼
[Compliant Image (No High CVE)] [Vulnerable Image (High CVE)]
│ │
▼ ▼
[Allowed: Deployed to AKS] [Blocked: Rejected by Admission Webhook]
Microsoft Defender for Containers & ACR Scanning Architecture
- Continuous Registry Scanning: When enabled on an Azure subscription, Microsoft Defender for Containers automatically scans Linux container images pushed to Azure Container Registry (ACR).
- Scan Triggers:
- On-Push: The image is scanned immediately upon being pushed to ACR (
docker pushor CI pipeline task). - Continuous Re-Scanning: Any image that has been pulled from the registry within the last 30 days is rescanned continuously whenever new vulnerabilities are published to global CVE databases.
- On-Push: The image is scanned immediately upon being pushed to ACR (
- Scanning Engine: Powered by industry-standard vulnerability assessment engines (Qualys and Trivy combined with Microsoft Threat Intelligence), evaluating OS packages (Debian, Ubuntu, Alpine, Red Hat) and language application packages.
Automated Deployment Quality Gates via Azure Policy
To prevent developers or deployment pipelines from launching non-compliant images into production AKS clusters, teams implement Azure Policy for Kubernetes (backed by OPA Gatekeeper):
- Built-in Policy Initiative:
Ensure vulnerable container images are not deployed to AKS clusters. - Mechanism: The Kubernetes Admission Controller queries Defender for Cloud vulnerability assessments for the container image digest before admitting the pod. If the image contains unpatched Critical or High CVEs exceeding organization thresholds, the admission controller rejects the deployment request.
4. Microsoft Defender for Cloud DevOps Security
In complex enterprise environments, security teams frequently struggle with fragmented visibility: development teams manage code in GitHub and Azure DevOps, while cloud operations teams monitor virtual machines, databases, and AKS clusters in the Azure portal.
Microsoft Defender for Cloud DevOps Security establishes a unified Code-to-Cloud security posture management (CSPM) solution.
┌────────────────────────────────────────────────────────────────────────┐
│ Microsoft Defender for Cloud: DevOps Security Architecture │
├────────────────────────────────────────────────────────────────────────┤
│ Connectors: │
│ • Azure DevOps Organizations │
│ • GitHub Enterprise Cloud / GitHub Organizations │
├────────────────────────────────────────────────────────────────────────┤
│ Unified Capabilities: │
│ │
│ 1. Code-to-Cloud Contextual Traceability: │
│ Runtime Alert (AKS Pod Exploit) ──► Maps to Container Image Digest │
│ ──► Maps to ACR Repository ──► Maps to GitHub/ADO Commit & PR │
│ ──► Identifies exact developer who introduced vulnerable dependency │
│ │
│ 2. Infrastructure as Code (IaC) Security: │
│ Scans Bicep, ARM, and Terraform files in PRs against CIS Benchmarks │
│ │
│ 3. Centralized DevOps Security Posture: │
│ Aggregates Secret Scanning, CodeQL SAST, and Dependabot findings │
│ into the global Azure Secure Score │
└────────────────────────────────────────────────────────────────────────┘
Code-to-Cloud Contextual Traceability
A major topic on the AZ-400 exam is contextual correlation:
- When Defender for Cloud detects a live intrusion attempt or compromised pod on an Azure Kubernetes Service cluster, DevOps Security correlates the runtime resource back to the specific build pipeline run, the exact Git commit SHA, and the developer pull request that introduced the vulnerability.
- This drastically compresses Mean Time to Remediate (MTTR) from weeks to minutes by delivering remediation guidance directly to the responsible engineering team.
Infrastructure as Code (IaC) Posture Scanning
Defender DevOps Security inspects declarative Infrastructure as Code templates (Azure Resource Manager templates, Bicep, Terraform) during CI builds and PR reviews to detect misconfigurations before deployment:
- Storage accounts configured with public access enabled.
- Kubernetes clusters with role-based access control (RBAC) disabled.
- Network security groups with overly permissive ingress rules (
0.0.0.0/0on port 22 or 3389).
5. Comprehensive YAML Pipeline: SBOM Generation, Container Build & Security Scan
The following complete Azure Pipelines YAML demonstrates an enterprise software supply chain workflow: compiling a .NET microservice, generating an SPDX 2.2 SBOM, building a Docker container image, pushing to ACR, and awaiting vulnerability assessment:
# azure-pipelines.yml: Secure Supply Chain Build, SBOM, and Container Deployment
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
variables:
acrServiceConnection: 'ACR-Production-ServiceConnection'
acrRegistryName: 'acrcontosoprod.azurecr.io'
imageRepository: 'payment-service'
tag: '$(Build.BuildId)'
jobs:
- job: SupplyChainBuildAndScan
displayName: 'Build, Catalog SBOM, and Publish Container'
steps:
- checkout: self
# 1. Restore and Compile Microservice
- task: DotNetCoreCLI@2
displayName: 'Compile Payment Application'
inputs:
command: 'publish'
publishWebProjects: true
arguments: '--configuration Release --output $(Build.ArtifactStagingDirectory)/publish'
# 2. Generate SPDX 2.2 Software Bill of Materials (SBOM)
- task: SbomTool@1
displayName: 'Generate Software Bill of Materials (SPDX)'
inputs:
buildDropPath: '$(Build.ArtifactStagingDirectory)/publish'
buildComponentPath: '$(Build.SourcesDirectory)'
packageVersion: '$(Build.BuildId)'
packageName: 'PaymentService'
packageSupplier: 'Contoso Enterprise DevOps'
manifestDirPath: '$(Build.ArtifactStagingDirectory)/publish/_manifest'
# 3. Publish SBOM Drop as Pipeline Artifact
- task: PublishPipelineArtifact@1
displayName: 'Publish Build Artifacts and SBOM'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/publish'
artifact: 'DropWithSBOM'
publishLocation: 'pipeline'
# 4. Build Docker Container Image
- task: Docker@2
displayName: 'Build Docker Image'
inputs:
command: 'build'
repository: '$(imageRepository)'
dockerfile: '**/Dockerfile'
buildContext: '$(Build.ArtifactStagingDirectory)/publish'
tags: |
$(tag)
latest
# 5. Push Image to Azure Container Registry (Triggers Defender Scan)
- task: Docker@2
displayName: 'Push Container Image to ACR'
inputs:
containerRegistry: '$(acrServiceConnection)'
repository: '$(imageRepository)'
command: 'push'
tags: |
$(tag)
latest
# 6. Verify Registry Vulnerability Compliance
- script: |
echo "Image pushed to $(acrRegistryName)/$(imageRepository):$(tag)"
echo "Microsoft Defender for Containers scan initiated automatically on ACR push."
displayName: 'Audit Image Supply Chain Attestation'
6. Supply Chain & Cloud Security Defense Matrix
| Tool / Feature | Scope & Target | Execution Location | Primary Vulnerabilities Addressed | Enforcement Action |
|---|---|---|---|---|
SbomTool@1 (Salus) | Direct & transitive build components | CI Build Agent step | Supply chain compliance (SPDX 2.2), component inventory | Produces audited manifest.spdx.json drop artifact |
| Dependabot Alerts | Open-source package manifests | GitHub / Azure DevOps backend | Known CVEs in third-party libraries (npm, NuGet, PyPI) | Surfaces security alerts with CVSS severity ranking |
| Dependabot Security Updates | Open-source package manifests | GitHub / Azure DevOps backend | Unpatched dependency CVEs | Automatically opens PR to bump library to patched version |
| Defender for Containers | Container images in ACR | Azure Container Registry service | OS and language package CVEs inside container images | Vulnerability assessment reports; rescans images pulled in last 30d |
| Azure Policy for Kubernetes | Running AKS clusters | Kubernetes Admission Controller (Gatekeeper) | Non-compliant or high-CVE container images | Rejects Pod deployment requests at the API server boundary |
| Defender DevOps Security | Repositories, pipelines, and cloud | Multi-cloud & DevOps portals | IaC misconfigurations, CodeQL findings, Code-to-Cloud posture | Centralizes posture into Azure Secure Score; traces runtime CVEs to code |
7. Realistic Exam Scenario & Common Traps
Scenario: Regulated Banking Supply Chain Compliance Pipeline
Organization: First National Bank maintains a hybrid banking platform. Under new federal regulatory guidelines, the bank must provide a verifiable Software Bill of Materials (SBOM) for every production release, automate third-party dependency patch management without developer overhead, and guarantee that no container image with unpatched Critical CVEs is admitted to production AKS clusters.
DevOps Strategy Implemented:
- SBOM Generation: The bank inserts the
SbomTool@1task into all Azure Pipelines build workflows. Every build outputs an SPDX 2.2manifest.spdx.jsonuploaded to pipeline artifacts. - Automated Remediation: Dependabot security updates are enabled across all Git repositories. When a vulnerability in a logging library is published to the GitHub Advisory Database, Dependabot creates a pull request bumping the version, triggering automated unit and integration tests.
- Registry Assessment: All container images are pushed to a Premium tier Azure Container Registry protected by Microsoft Defender for Containers, which immediately performs vulnerability scanning.
- Runtime Gate Enforcement: An Azure Policy definition (
Ensure vulnerable container images are not deployed to AKS clusters) is assigned to the production AKS cluster with thedenyeffect. When Helm attempts to roll out a release referencing an image with an unpatched Critical OpenSSL vulnerability, the Kubernetes admission controller rejects the rollout, preventing contaminated containers from executing.
Common Exam Traps to Avoid
- Trap: Conflating Dependabot Version Updates with Dependabot Security Updates. Version updates update dependencies on a calendar schedule (
dependabot.yml) to keep libraries current, even if no vulnerability exists. Security updates trigger reactively upon the publication of a known CVE to patch security flaws. - Trap: Believing SBOM Generation Tools Fix Vulnerabilities. The
SbomTool@1task generates a catalog and manifest of software components (SPDX). It does not evaluate CVE severity, rewrite package manifests, or upgrade libraries. Remediation is handled by Dependabot or manual developer intervention. - Trap: Assuming Container Scanning Occurs During
docker buildon the Agent. Microsoft Defender for Containers does not execute inside the build agent VM duringdocker build. The image must be pushed to Azure Container Registry (ACR), where Defender's registry scanner inspects the image layers. - Trap: Overlooking Continuous Re-scanning Window. Defender for Containers does not scan an image once and abandon it. It continuously rescans any container image that has been pulled from ACR within the past 30 days, alerting teams if a zero-day CVE is discovered in an image deployed weeks prior.
A financial services organization is updating its continuous integration pipelines in Azure Pipelines to comply with enterprise software supply chain security standards. The organization requires each pipeline run to generate a standardized, machine-readable Software Bill of Materials (SBOM) cataloging all open-source dependencies and licensing details in the SPDX format. Which task should be incorporated into the pipeline?
A development team maintains an enterprise web application across dozens of microservices. While Dependabot alerts are enabled and actively reporting known vulnerabilities in open-source libraries, developers struggle to keep up with manual updates to project package manifests. The engineering lead wants to automate the creation of pull requests that bump vulnerable libraries to the minimum required secure version whenever a new security advisory is published. Which feature should be enabled?
An enterprise deploys microservices as container images to Azure Kubernetes Service (AKS) through Azure Container Registry (ACR). The security architecture mandates that container images must be automatically scanned for OS and package vulnerabilities upon being pushed to ACR, and that any container image containing unpatched Critical or High Common Vulnerabilities and Exposures (CVEs) must be prevented from running in production AKS clusters. Which combined architecture fulfills this requirement?