Integrating GitHub Advanced Security with Defender for Cloud
This lesson explains how runtime context improves the prioritization of code alerts.
Learning outcomes
After completing this lesson, you will be able to:
- Explain the value of code-to-runtime context.
- Describe what the integration does.
- List its prerequisites.
- Describe how it is configured.
The problem of prioritization
A large organization can have thousands of open code scanning and dependency alerts, and developers cannot fix them all at once. Severity alone is an imperfect guide, since a critical finding in an internal tool with no network exposure can be less urgent than a medium finding in an internet-facing payment service. What is missing from the developer's view is what happens at run time. Conversely, a security team can see a risky cloud workload, but cannot easily find out which repository produced it.
What the integration does
The integration connects the two views, which is often described as code-to-runtime context.
- Maps code to workloads: repositories are linked with the running resources built from them.
- Prioritizes alerts with runtime risk: GitHub Advanced Security alerts gain context, including internet exposure, access to sensitive data, critical resources and lateral movement paths found by attack path analysis.
- Assigns work: GitHub issues can be created for the repository's code owners, so that findings reach those who can fix them.
- Supports remediation: Copilot can suggest fixes, and security teams can run campaigns.
The following diagram shows how runtime context from Microsoft Defender for Cloud orders thousands of code alerts.

Code-to-runtime context
Prerequisites
Exam questions on this skill usually concern what must be in place. Microsoft lists the following prerequisites.
| Requirement | Detail |
|---|---|
| GitHub connector | A connector created in Defender for Cloud for the GitHub organization |
| GitHub Advanced Security licence | Provides the alerts to be enriched |
| Defender CSPM | Enabled on the subscription, since it provides attack path analysis |
| Azure role | Security Admin on the subscription |
| GitHub role | Organization owner |
Microsoft Security Copilot is optional. The integration is available in commercial clouds only, and not in Azure Government, or in clouds operated by 21Vianet.
Integration prerequisites
Configuring the integration
-
Enable Defender CSPM
Turn on the plan for the subscription that holds the workloads.
-
Connect GitHub
Create a GitHub connector in Defender for Cloud, and authorize the organization.
-
Enable GitHub security features
Turn on code and dependency scanning in the repositories.
-
Allow mapping
Build workloads in a way that links artifacts to source, such as through container image metadata.
-
Work with the results
Review prioritized alerts and create issues for code owners.
The result reaches both audiences. Developers keep working on the GitHub Security tab, with better prioritization, and security staff see the same issue in Defender for Cloud alongside the affected resource.
Prioritizing by exposure
A security team has 4,000 GitHub Advanced Security alerts. It wants developers to fix first the alerts in code that runs on internet-facing workloads holding sensitive data. Workloads run in Azure. What is required?
Connect the GitHub organization to Microsoft Defender for Cloud with a connector, and enable Defender CSPM on the subscription, so that alerts are prioritized with runtime context. Sorting by severity in GitHub lacks any runtime information. Tagging repositories by hand would be quickly out of date, and a Log Analytics query over Azure resource data would not link alerts with code.
Which Defender plan supplies attack path analysis for the integration?
Show answer
Defender Cloud Security Posture Management, which must be enabled on the subscription.
Exam Tips
Remember for the exam
- The integration adds runtime context to GitHub Advanced Security alerts.
- Defender CSPM on the subscription is required.
- Setup needs Security Admin in Azure and organization owner in GitHub.
- Issues can go to repository code owners.
- It is available in commercial clouds only.