Lesson 4 of 6 Security and Compliance Scanning

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.

Prioritizing 4,000 code alerts by runtime exposure. A GitHub connector to Microsoft Defender for Cloud, with Defender CSPM on the subscription, maps code to the Azure workloads it runs on, so alerts in code on internet-facing workloads holding sensitive data rise to the top.
GHAS stands for GitHub Advanced Security.
Select all that apply

Code-to-runtime context

Exam skills 4.3.4

Pick what the GitHub Advanced Security and Defender for Cloud integration provides.

Log in to try this activity Interactive activities are free with an account.

Prerequisites

Exam questions on this skill usually concern what must be in place. Microsoft lists the following prerequisites.

RequirementDetail
GitHub connectorA connector created in Defender for Cloud for the GitHub organization
GitHub Advanced Security licenceProvides the alerts to be enriched
Defender CSPMEnabled on the subscription, since it provides attack path analysis
Azure roleSecurity Admin on the subscription
GitHub roleOrganization 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.

Match the pairs

Integration prerequisites

Exam skills 4.3.4

Match each requirement with what the integration needs.

Log in to try this activity Interactive activities are free with an account.

Configuring the integration

  1. Enable Defender CSPM

    Turn on the plan for the subscription that holds the workloads.

  2. Connect GitHub

    Create a GitHub connector in Defender for Cloud, and authorize the organization.

  3. Enable GitHub security features

    Turn on code and dependency scanning in the repositories.

  4. Allow mapping

    Build workloads in a way that links artifacts to source, such as through container image metadata.

  5. 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.

Worked example

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.

Check yourself

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.