Microsoft AZ-400: Security, Compliance and DevSecOps — Study Guide

Part of the Microsoft DevOps Engineer Expert AZ-400 — Study Guide. Practice with verified answers in the Microsoft exam hub, or take timed practice tests on ExamRoll.io.

Overview

Security, compliance, and DevSecOps in Azure-focused delivery pipelines demand shifting risk detection to the earliest possible stages, enforcing policy continuously, and automating evidence collection. Effective implementations unify application security testing (SAST/DAST/SCA), secrets governance, infrastructure-as-code (IaC) scanning, and regulatory controls into the CI/CD lifecycle. In Azure DevOps and GitHub, this means running analyzers on every pull request, gating merges with quality thresholds, deploying with least-privilege identities that retrieve time-bound secrets from Azure Key Vault, and continuously monitoring posture with Microsoft Defender for DevOps and Defender for Cloud. The goal is not only to find issues, but to prevent unsafe changes from reaching protected resources, prove compliance through audit trails, and sustain secure velocity.

Shift-left security, OWASP Top 10 mitigations, and pipeline hardening

Shift-left security starts with PR-time SAST and SCA, augmented by secrets scanning and targeted DAST before promotion. SAST surfaces code-level vulnerabilities such as injection points, unsafe deserializers, and missing output encoding. Integrate SonarQube/SonarCloud or GitHub code scanning (e.g., CodeQL) to analyze every change set; decorate pull requests with issues tied to specific lines; and enforce quality gates that fail the build when vulnerability or coverage thresholds are not met. Focus SAST on OWASP Top 10 classes:

DAST validates running builds in a staging environment. Automate OWASP ZAP or equivalent as a pipeline job post-deploy to non-production, using authenticated scans and a ruleset tuned to your app profile. Gate promotion on a vulnerability baseline: block on newly introduced High/Critical findings and persist accepted exceptions with expiry.

Software Composition Analysis (SCA) detects vulnerable third-party packages before merge. Use Dependabot to raise version-bump PRs and OWASP Dependency-Check to produce SBOMs and CVE reports in CI. Enforce license compliance by defining allow/deny lists (e.g., deny copyleft for proprietary products) and failing builds that include disallowed licenses. Secrets scanning must run on commit and in CI: adopt GitHub Advanced Security secret scanning or integrate Gitleaks/Microsoft Security DevOps to catch hardcoded credentials, tokens, and keys; block the merge when a secret pattern is detected and rotate affected credentials.

Pipeline hardening is non-negotiable. Lock down branch protections, require PR reviews, and enforce status checks for SAST/SCA/DAST. In Azure Pipelines, use protected resources, environment approvals and checks, and required templates to standardize security stages. Prefer short-lived, least-privilege tokens; avoid static credentials entirely with workload identity federation. Restrict self-hosted agents to private networks, scope their identities minimally, and disable script injection by enforcing templates that disallow arbitrary script steps for untrusted repositories.

Secrets, identities, Azure Key Vault, and certificate rotation

Azure Key Vault is the authoritative store for secrets, keys, and certificates. Integrate it directly with CI/CD to eliminate plaintext secrets:

Harden Key Vault with private endpoints, firewall rules, purge protection, soft-delete, and logging to Log Analytics or storage for audit. Deny cross-tenant access unless explicitly justified, and routinely rotate access for break-glass accounts.

Dependencies, containers, IaC, and compliance as code

Dependency scanning must handle both security defects and licensing. Dependabot continuously proposes secure updates; use dependency review policies to block PRs that introduce vulnerable versions. OWASP Dependency-Check (or ecosystem-native tools like npm audit, pip-audit) should run in CI to generate SBOMs (CycloneDX/SPDX) and fail the build when severity thresholds or license rules are violated. For advanced license governance, pair with an SCA platform capable of legal policy enforcement and remediation workflows.

Container image security begins in CI and continues in the registry and runtime:

IaC security ensures cloud resources are provisioned safely by default:

Compliance as Code uses Azure Policy and Defender for Cloud to continuously enforce and report on controls:

SonarQube/SonarCloud, pipeline security, and Microsoft Defender for DevOps

SonarQube/SonarCloud provides enforceable quality gates that align engineering quality with security. Adopt “Clean as You Code” by setting gates on new code: minimum code coverage on new/changed lines (e.g., 80%+), zero new Critical vulnerabilities or blocker code smells, and low duplication. Failing the gate must fail the pipeline. Publish coverage from test frameworks (JaCoCo, Cobertura, VSTest) and tune quality profiles per language to include security hotspots and OWASP-aligned rules. Track technical debt ratios and remediation times; report trends to drive team accountability.

Pipeline security hinges on least-privilege service connections, protected resources, and comprehensive secret masking:

Microsoft Defender for DevOps unifies repository and pipeline security posture across GitHub and Azure DevOps. Connect organizations/projects to Defender for Cloud to ingest code, secret, IaC, and dependency risk signals and present consolidated recommendations. It correlates findings to owners, supports suppression workflows with expiry, and measures adoption of branch protections, required reviewers, and status checks. Pair Defender for DevOps with the Microsoft Security DevOps task/action to orchestrate multiple analyzers (e.g., Semgrep, Trivy, tfsec, Gitleaks, Bandit) in one step and publish SARIF to code scanning. Use Defender for Cloud to create governance initiatives that track and enforce DevOps best practices (e.g., secret scanning enabled, required review count ≥ 2, non-admin merges disabled), elevating repository hygiene to an auditable control.

Practical Problem Scenario

Spotify needs to standardize secure delivery for a new AKS-hosted microservice stack spanning .NET and Node.js, with repos in GitHub Enterprise Cloud and deployments through Azure DevOps multi-stage YAML pipelines. The challenge is to stop vulnerable dependencies and misconfigured infrastructure before merge, eliminate static credentials, and block promotion of images with critical CVEs, while producing auditable compliance evidence.

  1. Enforce PR-time SAST/SCA and secrets scanning
  1. Add authenticated DAST before promotion
  1. Secure identities and secrets with Key Vault and workload identity federation
  1. Implement certificate automation
  1. Harden containers and registries
  1. Scan IaC and lint Bicep/ARM
  1. Codify compliance and evidence
  1. Lock down pipelines and protected resources
  1. Consolidate posture with Microsoft Defender for DevOps

Each tool/feature is selected for earliest feasible detection, automatic enforcement, and auditability: SonarCloud and ZAP gate code and runtime risks; Dependabot and Trivy accelerate safe updates; Key Vault and identity federation remove static secrets; Checkov/tfsec and Azure Policy prevent drift; protected resources and approvals control blast radius; Defender for DevOps and Defender for Cloud deliver unified, actionable posture management.


Release Management and Deployment Strategies · All domains · Testing Strategy and Quality Engineering

Practice these questions → · Timed practice on ExamRoll.io →

Pass the whole exam — not just this question

You found this answer. Get every verified question and explanation in one place, and save hours of prep. Free to start.

Pass your exam →

Browse Microsoft →

Related guides

All-in-one access

One subscription. Every exam.

Every plan unlocks unlimited answer search, practice tests, AI explanations, and the full resource library — in 20+ languages.

Monthly
24.87
Just €0.83/day
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

Best value
12 months
179.87
Just €0.49/daySave 40%
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

✓ Free plan included · ✓ Cancel anytime · ✓ All plans unlock the full product