Edit

Remediate code with Microsoft Security Copilot

Microsoft Defender for Cloud integrates with Microsoft Security Copilot to help you fix Infrastructure as Code (IaC) issues in your code repositories. With Copilot, you can catch and fix security issues early in the development cycle. Copilot creates pull requests (PRs) that correct the problems it finds. Automatically generated PRs help ensure that code issues are fixed quickly and correctly. Before you get started, make sure you meet the prerequisites for Defender for Cloud, Security Copilot, and repository integration.

Prerequisites

Before you begin, make sure you have the following items set up:

Remediate an Infrastructure as Code scanning finding

You can use Copilot in Defender for Cloud to fix flagged issues. Follow these steps to resolve a finding:

  1. Sign in to the Azure portal.

  2. Search for and select Microsoft Defender for Cloud.

  3. Go to Recommendations.

  4. Search for and select the Azure DevOps repositories should have infrastructure as code scanning findings resolved recommendation.

    Screenshot that shows the recommendation that you searched for.

  5. Select Reduce risk with Copilot.

    Screenshot that shows where the Summarize with copilot button is located.

  6. Select Help me remediate this recommendation.

  7. Select security check.

  8. Select the description that matches the security check finding.

  9. Select Select.

    Screenshot that shows where the select button is located.

  10. Review the summary of the code fix.

  11. Select Submit.

  12. Select the pull request link shown in the Copilot results.

  13. Review the pull request.

After Copilot creates the pull request in your code repository, a developer should review and approve it before merging.

Next steps