AZ-401 study notes · 15–20% of the exam

Design and implement a security and compliance plan

First draft for review. Check details against Microsoft Learn before relying on them.

What this area covers

Identities for automation, keeping secrets safe in pipelines, and automated security scanning.

Authentication

  • Managed identities for workloads in Azure. Service principals for workloads outside Azure.
  • Prefer workload identity federation (OIDC) for Azure service connections and GitHub Actions. There's no secret to rotate.
  • GITHUB_TOKEN is created per run. Set permissions to the minimum.
  • GitHub Apps suit cross-repository automation. Use fine-grained PATs only when needed, with an expiry.
  • Azure DevOps PATs should be scoped and short-lived. Organisation policies can limit them.
  • Azure DevOps access levels (Stakeholder, Basic, Basic + Test Plans) and security groups. GitHub roles, teams and outside collaborators.

Secrets

  • Read secrets from Azure Key Vault with a variable group, the Key Vault task or a step after OIDC sign-in.
  • Secure files hold certificates and other files. GitHub secrets exist at organisation, repository and environment level.
  • Don't print secrets. Don't give fork PRs access to secrets. Pin actions to a commit SHA.

Scanning

  • GitHub Advanced Security and GitHub Advanced Security for Azure DevOps: secret scanning with push protection, code scanning with CodeQL, and dependency scanning.
  • Dependabot alerts and updates. Dependency review in PRs.
  • Microsoft Defender for Cloud connects to GitHub and Azure DevOps for a central view of DevOps security.