Jump to content

Featured Replies

Posted

**We want to hear from you! If you have tested Microsoft Defender for DevOps, please fill out

this survey to provide feedback on the Pull Request Annotations feature.**

 

 

Written by: Lara Goldstein, Safeena Begum Lepakshi, Charles Oxyer

 

 

 

Introduction:

 

It is no secret that security and development teams operate in silos. Security administrators often struggle with getting developers to remediate vulnerabilities in code because they are not able to provide remediation guidance and feedback directly within the tools are most familiar with (e.g., GitHub and Azure DevOps). Additionally, for developers that embrace the practice of DevOps, they are used to moving quickly and automating as many processes as possible, causing security to struggle to keep up with the speed of development.

 

 

 

To simplify the remediation process, reduce time to remediation, and help security teams build stronger relationships with developers, Microsoft Defender for DevOps can expose security findings as annotations in Pull Requests (PR) within Azure DevOps and GitHub Enterprise.

 

 

 

Why Use Pull Request Annotations:

 

Vulnerabilities and misconfigurations are detected too late in the development cycle, often when code is already deployed. Not only does this make the deployed code a target for bad actors, but it also makes it more expensive to fix the issue. By using PR annotations, security teams can shift left in the development lifecycle and empower developers to remediate security vulnerabilities in their pre-production code.

 

 

 

With PR annotations, get surfaced back to the source code management system as a given line in the Pull Request. Each annotation has the following information:

 

  • Severity of the issue
  • A message about what the issue is
  • A description on how to fix the issue

 

 

 

End-to-End Scenario of using Pull Request Annotations:

 

An example of a common use-case for Pull Request Annotations is as follows:

 

 

 

  • Security Persona configures Pull Request annotations for an Azure DevOps repository within Microsoft Defender for Cloud in the DevOps Security Blade. To learn more about enabling PR annotations, see this document.

 

491x330vv2.png.2de65e6fe5ba01a8f324cbd96c59c4a0.png

 

 

 

  • Developer commits file within Azure DevOps that contains secrets. In this scenario, the developer committed an AWS Secret Access Key

 

396x385vv2.png.108a302357031d93ae03ce390bf991aa.png

 

 

 

  • Developer creates Pull Request to merge the file into the appropriate branch.

 

885x70vv2.png.c5c71e21ea7fad11ddb1bd51773e0521.png

 

 

 

551x562vv2.png.620b3d9ec4710a58df47a5ff66169229.png

 

 

 

 

 

 

  • Developer gets notified that the file contained a secret through an automated comment on the Pull Request coming from Microsoft Defender for DevOps. In the comment, the developer can see the exact line of code where the secret is located. In this example, the AWS Secret Access Key was discovered in Line 2.

 

608x442vv2.png.1b37d8ce7b205bc7e6ad11818578499a.png

 

 

 

  • Developer fixes issue using the guidance provided in the annotations. In this case, the guidance was to validate that the file containers secrets, remove and rotate the secret, and use an approved key store, such as AWS Key Management Service or Azure Key Vault.

 

 

 

  • Developer changes the status of the comment from Active to Resolved to reflect that the issue has been fixed.

 

609x265vv2.png.902a6c301f638cef8049200e14518ebb.png

 

 

 

Summary:

 

This blog discussed why Pull Request Annotations are useful for automating security in DevOps environments and provided an example of a common scenario.

 

 

 

More Information:

 

 

 

 

We want to hear from you! If you have tested Microsoft Defender for DevOps, please fill out this survey to provide feedback on the Pull Request Annotations feature.

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...