Configuring Microsoft Defender for Cloud DevOps Security
This lesson explains central DevOps posture, connectors and Microsoft Security DevOps.
Learning outcomes
After completing this lesson, you will be able to:
- Explain what DevOps security provides.
- Describe how platforms are connected.
- Identify the tools in Microsoft Security DevOps.
- Run the task and the action.
What DevOps security provides
Microsoft Defender for Cloud is Azure's cloud security posture and workload protection service. Its DevOps security capability extends that view to the development environment. Whereas GitHub Advanced Security helps a developer to fix code in one repository, Defender for Cloud gives a security team a central picture across Azure DevOps, GitHub and GitLab: which repositories have exposed secrets, vulnerable dependencies, code flaws and insecure IaC, and which have weak settings, such as no branch protection.
Foundational visibility is available when an environment is connected, and advanced features such as attack path analysis and code-to-cloud contextual mapping need the Defender Cloud Security Posture Management (Defender CSPM) plan.
What Defender for Cloud DevOps security gives
Connecting environments
Platforms are connected through connectors. The following sequence applies to each platform.
-
Open the console
In Defender for Cloud, open DevOps security, or Environment settings.
-
Add an environment
Choose Azure DevOps, GitHub or GitLab, and create a connector in a subscription.
-
Authorize
Grant access to organizations and repositories, which needs admin rights on the platform.
-
Review findings
Repositories and their findings appear in the DevOps security console.
-
Configure annotations
Enable pull request annotations for chosen severity levels.
After connection, the console shows an inventory and recommendations. A pull request annotation reports IaC and other findings directly to a developer, inside the pull request.
The following diagram shows GitHub and Azure DevOps feeding one security console in Microsoft Defender for Cloud.

Connecting a DevOps platform
Microsoft Security DevOps
Microsoft Security DevOps (MSDO) is a command-line application that runs open-source and Microsoft static analysis tools, and is packaged for pipelines. It sends results in SARIF format. The tools include the following.
| Tool | Scans |
|---|---|
| Bandit | Python code |
| ESLint | JavaScript code |
| BinSkim | Compiled binaries |
| Checkov | IaC, including Bicep, ARM and Terraform |
| Template Analyzer | ARM and Bicep templates |
| Terrascan | IaC, including Terraform and Kubernetes |
| Trivy | Container images and file systems |
| AntiMalware | Malware, on Windows agents |
In Azure Pipelines, the extension is installed from the Marketplace, which needs Project Collection Administrator rights, and it adds the MicrosoftSecurityDevOps@1 task.
steps:
- task: MicrosoftSecurityDevOps@1
displayName: Run Microsoft Security DevOps
inputs:
categories: IaC,containers
break: true
# Third-party SARIF results reach Defender for Cloud through this artifact name
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/results
ArtifactName: CodeAnalysisLogsThe artifact name CodeAnalysisLogs matters, since Defender for Cloud reads results from it. On GitHub, the microsoft/security-devops-action action does the same job, and it can upload SARIF to the Security tab, which needs security-events: write.
permissions:
contents: read
id-token: write
actions: read
security-events: write
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: microsoft/security-devops-action@latest
id: msdo
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.msdo.outputs.sarifFile }}One tool has changed: the CredScan secret scanner in MSDO for Azure DevOps was deprecated on 20 September 2023, and GitHub Advanced Security for Azure DevOps replaced it. Do not choose MSDO for secret scanning.
Tools inside Microsoft Security DevOps
One view across platforms
A company uses GitHub for some teams and Azure DevOps for others. Its central security team wants one place to see exposed secrets and IaC weaknesses across both, and it does not want to change developers' workflows. What should you recommend?
Connect both platforms to Microsoft Defender for Cloud through DevOps security connectors, and review findings in the console. Moving all code to one platform would be disruptive, and is not needed. The GitHub security overview covers only GitHub, and the Azure DevOps Advanced Security view covers only Azure DevOps, so neither gives a single view.
Why should you avoid MSDO for secret scanning?
Show answer
Its CredScan tool was deprecated in 2023, and GitHub Advanced Security for Azure DevOps replaced it.
Exam Tips
Remember for the exam
- DevOps security gives one view across Azure DevOps, GitHub and GitLab.
- Platforms connect through connectors in Defender for Cloud.
- Advanced context needs the Defender CSPM plan.
- MSDO runs Bandit, Checkov, Trivy, Terrascan and similar tools.
- SARIF results for Defender for Cloud use the CodeAnalysisLogs artifact name.