Study guide

14.2 Security Scanning Strategy, GHAS & Secret Scanning

Microsoft Certified: Azure DevOps Engineer Expert AZ-400

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Flow of Work, Traceability & Work Tracking

1.1 Flow of Work, GitHub Flow & Feedback Cycles 1.2 Work Tracking with Azure Boards & GitHub Projects 1.3 End-to-End DevOps Traceability & Quality Tracking

2 Chapter 2: DevOps Metrics, Dashboards & Team Collaboration

2.1 DORA Metrics, Flow Metrics & Dashboard Design 2.2 Lifecycle Metrics Across the Six DevOps Phases 2.3 Work Item Queries, WIQL Charts & Analytics 2.4 Project Documentation: Wikis, Mermaid Diagrams & Release Notes 2.5 Webhooks, Service Hooks & Microsoft Teams ChatOps

3 Chapter 3: Git Branching Strategies & Pull Request Workflows

3.1 Git Branching Models & Strategy Design 3.2 Pull Request Workflows & Merge Strategies 3.3 Branch Policies, Quality Gates & Compliance Restrictions

4 Chapter 4: Repository Management, Optimization & Git Data Operations

4.1 Git LFS Architecture & .gitattributes Tracking 4.2 LFS History Migration, git-fat & File Locking 4.3 Git Repository Scaling, Scalar & Monorepo Governance 4.4 Repository Permissions & Git Tag Governance 4.5 Git Data Recovery & Sensitive-Data Scrubbing

5 Chapter 5: Package Management & Dependency Versioning

5.1 Selecting Package Tools: Azure Artifacts vs. GitHub Packages 5.2 Feed Scoping, Upstream Sources & Pipeline Authentication 5.3 Package Views, Immutability & Quality Promotion 5.4 Dependency Versioning: SemVer, CalVer & Automated Versioning 5.5 Pipeline Artifact Versioning & Artifact Storage Strategy

6 Chapter 6: Pipeline Infrastructure, Agents & Integration

6.1 Selecting a CI/CD Solution: Azure Pipelines vs. GitHub Actions 6.2 GitHub-Azure Pipelines Integration & Hybrid Migration 6.3 Hosted vs. Self-Hosted Agents & Runners 6.4 VMSS Elastic Pools, Container Jobs & Agent Governance 6.5 Pipeline Triggers, Filters & Concurrency Management

7 Chapter 7: YAML Pipeline Architecture & Reusable Elements

7.1 YAML Pipeline Anatomy: Stages, Jobs, Steps & Workspaces 7.2 Job Execution Order: DAG Dependencies, Parallelism & Conditions 7.3 Reusable Elements: Templates, Parameters & Variables 7.4 Variable Groups, Secret Variables & Key Vault Linking 7.5 YAML Environments, Checks & Deployment Approvals

8 Chapter 8: Testing Strategy, Quality Gates & Code Coverage

8.1 Test Strategy Design: Local, Unit & Integration Testing 8.2 Load, Stress & Performance Testing in Pipelines 8.3 Test Execution Tasks, Agents & Results Integration 8.4 Code Coverage Analysis & SonarQube Integration 8.5 Quality Gates, Release Gates & Governance Checks

9 Chapter 9: Modern Deployment Strategies & Zero-Downtime Delivery

9.1 Progressive Delivery: Blue-Green, Canary & Ring Deployments 9.2 Minimizing Downtime: Deployment Slots & Rolling Updates 9.3 Feature Flags with Azure App Configuration & Feature Manager 9.4 Designing the High-Priority Hotfix Path 9.5 Ordered Dependency Deployments, Resiliency & Rollback

10 Chapter 10: Artifact Deployment & Database DevOps

10.1 Containerized Application Delivery: ACR, AKS & Container Apps 10.2 Binary, Web App, Function & Scripted Deployments 10.3 Database DevOps: State-Based & Migration-Based Strategies

11 Chapter 11: Infrastructure as Code (IaC) & Azure Deployment Environments

11.1 Infrastructure as Code Strategy: Bicep, ARM & Terraform 11.2 Desired State Configuration & Azure Machine Configuration 11.3 Azure Deployment Environments (ADE) & Developer Self-Service

12 Chapter 12: Pipeline Maintenance, Health & Modernization

12.1 Pipeline Health, Flaky Tests & Reliability Engineering 12.2 Pipeline Optimization: Caching, Slicing & Concurrency 12.3 Artifact & Build Retention Governance 12.4 Modernizing CI/CD: Classic to YAML Migration

13 Chapter 13: Authentication, Authorization & Identity Governance

13.1 Microsoft Entra Service Principals & Managed Identities 13.2 Service Connections, Workload Identity & Personal Access Tokens 13.3 Azure DevOps Projects, Teams & Permission Evaluation 13.4 Access Levels, GitHub Roles & Outside Collaborators

14 Chapter 14: Secrets Management, Sensitive Data & DevSecOps Scanning

14.1 Azure Key Vault, Secret Variables & Secretless CI/CD 14.2 Security Scanning Strategy, GHAS & Secret Scanning 14.3 CodeQL SAST in Pipelines and Containers 14.4 Software Supply Chain, Container Scanning & Cloud Defender

15 Chapter 15: Telemetry Collection, Azure Monitor & Alerting

15.1 Azure Monitor Architecture, AMA & Data Collection Rules 15.2 Application Insights & Specialized Azure Monitor Insights 15.3 Alerting Rules, Action Groups & GitHub Repository Insights

16 Chapter 16: Telemetry Analysis, Distributed Tracing & SRE Practices

16.1 Distributed Tracing, Application Map & Exception Triage 16.2 KQL Log Analytics, SRE Observability & Error Budgets

14.2 Security Scanning Strategy, GHAS & Secret Scanning

Key Takeaways Explain This Topic AI

The four blueprint scanning categories are secret scanning, code scanning, dependency scanning and licensing scanning, each answering a different question.

Push protection blocks a commit containing a recognised credential pattern before it reaches the server, which is the only control that prevents exposure rather than detecting it.

Historical secret scanning finds credentials already in history; anything it finds must be treated as compromised and rotated, not merely deleted.

GitHub Advanced Security is licensed per active committer, defined as a developer who pushed to a GHAS-enabled repository in the last 90 days.

Licensing scanning is a compliance control implemented as a deny list on the dependency diff, with the SBOM as the durable audit evidence.

Last updated: September 2026

14.2 Security Scanning Strategy, GHAS & Secret Scanning

Traditional application security historically operated as a reactive, late-stage gate. Before major releases, external security penetration testers or dedicated security operations teams would manually audit code or run surface-level dynamic vulnerability scanners. Defects identified at this stage triggered severe release delays, emergency code refactoring, and friction between development and security teams.

DevSecOps fundamentally transforms this paradigm by shifting security left . Instead of evaluating security at the end of the delivery pipeline, automated security controls are embedded directly into the developer workflow—at the local IDE, during git push , within Pull Request (PR) validation builds, and throughout continuous integration pipelines. On the AZ-400 exam, mastering GitHub Advanced Security (GHAS) , GHAS for Azure DevOps , Push Protection , and CodeQL Static Application Security Testing (SAST) is essential for designing resilient software delivery pipelines.

1. The DevSecOps Philosophy: Shifting Security Left

Shifting left means integrating security validation into the earliest phases of the software development lifecycle (SDLC). The objective is to provide immediate, actionable feedback to developers when remediating vulnerabilities requires minimal effort and carries zero production downtime risk. Traditional Security (Shift-Right - Reactive & Expensive):

[Plan] ──> [Code] ──> [Build] ──> [Test] ──> [Deploy] ──> [Penetration Test] ──> [EMERGENCY PATCH]

DevSecOps (Shift-Left - Continuous & Automated):

  • [Plan] ──> [Code (IDE Lint / Push Protection)]
  • │
  • ▼
  • [PR Validation: Secret Scan + CodeQL SAST + Dependabot]
  • │ (Automated Quality Gate / Branch Policy)
  • ▼
  • [Build & Container Scan] ──> [Deploy] ──> [Continuous Cloud Runtime Defender]
  • Key Principles of Shift-Left Security

Automated Non-Blocking Feedback : Security tools should run alongside unit tests and linters in pull request validation builds, annotating vulnerable code lines directly in the code review interface.

Security as Code : Security policies, scanning configurations, and vulnerability thresholds must be defined in version-controlled YAML pipelines and repository settings.

Developer Empowerment : Rather than simply generating compliance reports for security auditors, DevSecOps tooling provides developers with precise remediation guidance, Common Weakness Enumeration (CWE) explanations, and automated pull requests.

2. GitHub Advanced Security (GHAS) & GHAS for Azure DevOps

GitHub Advanced Security (GHAS) is an enterprise security suite natively integrated into the GitHub platform. Recognizing that enterprise organizations also utilize Azure DevOps for source control and release orchestration, Microsoft introduced GitHub Advanced Security for Azure DevOps (GHAzDO), bringing identical enterprise-grade capabilities natively into Azure Repos and Azure Pipelines .

The Three Pillars of Advanced Security

Secret Scanning & Push Protection : Detects exposed API keys, tokens, and private credentials across source code and prevents commits from entering repository history.

Code Scanning (CodeQL) : Semantic Static Application Security Testing (SAST) engine that analyzes source code for security vulnerabilities such as SQL injection, Cross-Site Scripting (XSS), and path traversal.

Dependency Scanning & Review : Identifies open-source dependencies containing known Common Vulnerabilities and Exposures (CVEs) and surfaces licensing risks.

Licensing and Onboarding

Active Committer Licensing : GHAS is licensed on an active committer model. An active committer is any developer who has pushed code to a GHAS-enabled repository within the last 90 days. Developers who commit across multiple repositories within the same organization consume only a single license seat.

Enabling Advanced Security in Azure DevOps :

Navigated via Organization Settings or Project Settings > Repositories .

Can be toggled at the Organization level, Project level, or individual Repository level.

Enabling GHAS activates the Advanced Security tab under Azure Repos, providing security overview dashboards, active alert lists, and branch-level filters.

3. Secret Scanning & Push Protection Mechanics

Secret scanning continuously inspects source code repositories for inadvertently committed credentials, tokens, and cryptographic keys.

Partner Patterns and Regular Expressions

GitHub and Microsoft partner with over 100 industry service providers (including Microsoft Azure, AWS, Google Cloud, Slack, Stripe, Twilio, and HashiCorp) to recognize high-confidence credential formats. Secret scanning checks for:

Azure Management certificates, Storage Account keys, and Azure OpenAI API keys.

GitHub Personal Access Tokens (PATs) and fine-grained access tokens.

AWS Access Key IDs and secret access keys.

Private SSH and PGP keys ( BEGIN RSA PRIVATE KEY ).

Historical Scanning vs. Push Protection

Understanding the critical difference between historical secret scanning and Push Protection is a frequent AZ-400 exam scenario: Standard Secret Scanning (Reactive - Post-Commit):

Developer: git push ──> Accepted by Git Remote ──> Background Scan ──> Security Alert Generated

* Vulnerability: The secret is already stored in Git history. Credential MUST be revoked and rotated immediately!

Push Protection (Proactive - Pre-Commit Boundary):

Developer: git push ──> Remote Pre-Receive Hook ──> Pattern Match Detected ──> PUSH REJECTED (Exit 1)

* Benefit: The secret NEVER enters remote Git history. Developer removes credential locally before pushing.

Push Protection Workflow and Developer Bypass

When Push Protection is enabled on a repository, the Git server inspects incoming packfiles during the git push operation:

If a secret pattern matches a high-confidence signature, the server rejects the push immediately .

The Git CLI prints a detailed rejection message displaying the exact file, line number, detected secret type, and a URL link to resolve the block.

Developer Bypass : If the detected string is a non-sensitive test fixture or a false positive, the developer can navigate to the provided URL to authorize a bypass by selecting an approved justification:

False positive (string is not a real secret).

Used in tests (dummy credential for mock test suites).

Will fix later (temporary bypass; immediately generates a high-severity alert in the Security tab).

All bypass events are logged in the organization audit log to ensure compliance oversight.

4. Designing a Security and Compliance Scanning Strategy

The blueprint names four scanning categories, and each answers a different question. A complete strategy runs all four and places each at the cheapest point in the lifecycle where it can still block the defect.

Category Question it answers Representative tooling Where it belongs

Secret scanning Are credentials present in the code or history? GHAS secret scanning + push protection, Defender for Cloud Pre-receive (push protection), then continuous history scan

Code scanning (SAST) Does our own code contain an exploitable flaw? CodeQL, third-party SAST publishing SARIF Pull request validation, plus a scheduled full scan

Dependency scanning (SCA) Do our third-party components carry known CVEs? Dependabot alerts, dependency review, Defender for Cloud Pull request diff check, plus a daily alert sweep

Licensing scanning Do our dependencies impose obligations we cannot accept? GitHub dependency review license rules, SBOM tooling, commercial SCA Pull request gate on the dependency diff

Licensing scanning is a compliance control, not a vulnerability control. Its job is to stop a copyleft or commercially incompatible licence entering a product that ships as a binary. Implement it in two layers: a policy naming the allowed licences (for example permissive MIT/Apache-2.0/BSD allowed, strong copyleft such as GPL-3.0 or AGPL-3.0 blocked, everything else routed to legal review), and an automated gate . GitHub's dependency review action enforces exactly this on the pull request diff: - name: Dependency review

uses: actions/dependency-review-action@v4

with:

  • fail-on-severity: high
  • deny-licenses: GPL-3.0, AGPL-3.0

The SBOM produced at build time (SPDX or CycloneDX) is the durable evidence: it records the licence of every component actually shipped, which is what an auditor asks for months after the pipeline logs have aged out.

Sequencing rule for the exam. Blocking controls belong where the developer still has context - push protection and pull request gates. Non-blocking, high-volume analysis (full-history secret scans, deep SAST, container image re-scans) belongs on a schedule so it never adds minutes to pull request feedback.