Cloud Defender for DevOps

Cloud Defender for DevOps

Microsoft Defender for Cloud is Microsoft's integrated security solution for cloud security posture management (CSPM) and cloud workload protection (CWP). In short, it can strengthen security posture by providing recommendations and identifying potential weaknesses such as misconfigurations. Defender for cloud will also proactively protect your multi-cloud and hybrid-cloud workloads by providing real time detection across a range of evolving threats. Why is this important? Well, according to Gartner, between now through to 2025, 99% of cloud security failures can be attributed to human error.

From a software engineering perspective and having used Microsoft Defender for Azure SQL for a while now, it is a great tool for ensuring peace of mind that our SQL data estate has been configured according to best practices and will be able to continuously detect against potential threats to our databases such as injectable queries and potential brute force attacks.

And naturally, my interest piqued when Defender for DevOps was recently announced as a preview from Microsoft Ignite 2022. Defender for DevOps promises the ability for IT admins to centrally manage DevOps security and provide unified visibility across multiple DevOps environment. It not only scans your code (source files, IaC, containers) for code and dependency vulnerabilities, but it will also provide recommendations for strengthening the security of your repos. The value proposition here is that it will surface up this data via a centralised Cloud Defender portal within the Azure Portal alongside the other defender services.

Keep in mind that it is still early days and Defender for DevOps is available only in public preview and in one region (Central US). However, it is free as part of the preview, so there is no better time than to go in there, learn more and provide feedback to the product teams. It is also worth noting that it currently only supports Azure DevOps and GitHub only, but I imagine support for other DevOps tooling such as Jenkins and GitLab would be not too far behind.

No alt text provided for this image
credit: Microsoft Defender for DevOps 2022

Connect to your Repo (GitHub)

To setup Cloud Defender for DevOps, go to your Cloud Defender resource in the Azure Portal and look for DevOps Security (Preview) where you will need to setup a connection to either Azure DevOps or GitHub.

No alt text provided for this image

I have already setup a connection to Azure DevOps so here, I will create one to my demo GitHub account. To do this, select + Add environment and select your DevOps platform i.e. GitHub.

No alt text provided for this image

Provide the standard details for your resource. As noted, only the Central US region will be selectable for the public preview. Select Next to continue.

No alt text provided for this image

Next, we will select a plan. For the public preview, you will only get to select one option which is free. Select Next to authorise the connection to GitHub which will allow Cloud Defender to connect to your GitHub account.

No alt text provided for this image

Select the Authorize button.

No alt text provided for this image

Sign into your GitHub account when prompted. Once signed in, you should have a green tick that indicates the connection has been authorized. Next, you need to install the Defender for DevOps app. Click on Install.

No alt text provided for this image

Here, you can specify which repos you would like to grant access to. Select Save once completed.

No alt text provided for this image

The MSDO (Microsoft Security DevOps) app is a command line application that leverages several open-source tools to perform static application security testing (SAST) on your application source code (source files, IaC, containers etc). You can read more about the MSDO app from the Microsoft website here. GitHub also supports secrets scanning if you are also licensed for GitHub Advanced Security (GHAS) which I will cover a little later. Click here to learn more about it.

No alt text provided for this image

Once you have two green ticks, you can click on Next to review and complete the creation process.

No alt text provided for this image

Enabling code and secret scanning (GitHub)

In order for the MSDO app to work it's magic to full potential, you will need to ensure your repo has code scanning and secret scanning turned on. If you don't, you will notice an error in your workflows similar to the one below.

No alt text provided for this image

What this means is that back in Cloud Defender, you will only see dependency / OSS (open-source software) vulnerabilities and not the full gambit of potential code vulnerabilities.

No alt text provided for this image

Code and secrets scanning does require GitHub advanced security (GHAS) so if you are scanning a private repo, you will need a license or setup a trial. For someone like me which doesn't have a license, I simply created a public repo which is not a problem as it's a demo GitHub account and the source code is cloned from a public repo. I obviously don't recommend doing this for any work or confidential projects.

No alt text provided for this image

Scanning your repo (GitHub)

In order to test out the capabilities of Defender for DevOps, I cloned the DVPWA - Damn Vulnerable Python Web Application which can be found here. It is a Python web application with numerous vulnerabilities so we should be able to pick up something without too much drama.

Once you have completed cloning the repo or have your own project ready, select Actions to create a workflow

No alt text provided for this image

Select New Workflow

No alt text provided for this image

We will start with a blank workflow so select set up a workflow for yourself.

No alt text provided for this image

I used a boiler plate example which was based predominantly from the MS Learn material here.

The workflow will trigger on either a push, pull request or can be manually triggered.

The Run Microsoft Security DevOps Analysis step will execute the MSDO app which in turn will also take care of:

  • Installing the Microsoft Security DevOps CLI
  • Installing the latest Microsoft security policy
  • Installing the latest Microsoft and 3rd party security tools
  • Automatic or user-provided configuration of security tools
  • Executing a full suite of security tools mentioned earlier e.g. Bandit, ESLint, Terraform etc based on file-based application filters
  • Normalize processing of results into the SARIF format
  • Build breaks and more

There are a number of parameters which you can specify to fine tune the behaviour MSDO. Things you can do for example include specifying the languages, the tools to use and whether to break the build.

You can also request the GitHub team to evaluate onboarding additional open-source tools here.

No alt text provided for this image

Select Start commit to commit your changes.

No alt text provided for this image

Select Commit new file. This should kick off the workflow based on the trigger specified in the yml file.

No alt text provided for this image

The workflow will queue and should start running shortly.

No alt text provided for this image

Drilling into the details, we can see the Run MSDO stage starting to run and return some findings.

No alt text provided for this image

After a few minutes, the remaining steps of the workflow should be completed successfully. The last steps is responsible for setting an output variable to the path of the Sarif file and uploading it.

No alt text provided for this image

We can go to the security tab to find out more about the 34 vulnerabilities identified.

No alt text provided for this image

We can see there are 6 vulnerable dependencies.

No alt text provided for this image

And we can see there are 28 code vulnerabilities.

No alt text provided for this image

Cloud Defender Reporting

Going back to the Cloud Defender service in Azure Portal, we should now see things looking quite different. We will also see the number of code and dependency vulnerabilities will match those we saw earlier in the security tab of our repo in GitHub.

Note: if you have only recently created the connection to GitHub, it can take several hours before the findings will flow from GitHub to Cloud Defender.

No alt text provided for this image

As previously mentioned, one of the benefits of Cloud Defender in general is it's ability to provide recommendations for configuring and strengthening your security posture. To see a list of recommendations and findings, select the project you wish to analyse further.

No alt text provided for this image

In the next screen, we can see a list of actions which were recommended by Cloud Defender. These recommendations will also have a severity classification which is useful in assisting with prioritising on what to focus on first.

As we have already enabled code and secrets scanning, we can see the status is set to Healthy.

Because MSDO has identified various code and dependency vulnerabilities, we can also see some Unhealthy recommendations.

No alt text provided for this image

If you click on an Unhealthy recommendation, we are taken to a screen with the findings (vulnerabilities). Selecting an individual finding will surface additional information and context and can assist in the remediation of these issues.

No alt text provided for this image
No alt text provided for this image

As with any other alert in Cloud Defender, you will also have the ability to connect up a Logic App to trigger automated responses without code. This is useful if you want to for example, notify a team of an issue or to log these findings into a defect management system.

No alt text provided for this image

Cloud Defender for DevOps is an exciting addition to the Microsoft Defender for family. Because there is an abundance of open-source tooling already available today that can also output to the Sarif schema, I imagine the list of tooling which will be supported with MSDO will continue to grow in the future. In addition, I would be interested to learn more about the ability for other licensed SAST and SCA tools in the market and how they can also be integrated with Cloud Defender. I will need to test that out in the future.

要查看或添加评论,请登录

Eric Cheng的更多文章

  • Unleashing the Power of LLM: The Art of Prompt Design and Fine Tuning

    Unleashing the Power of LLM: The Art of Prompt Design and Fine Tuning

    Recently, I came across a requirement whereby I needed to implement Named Entity Recognition (NER) to extract the model…

    1 条评论
  • Building an AI Technical Assistant: Leveraging ChatGPT and Embeddings

    Building an AI Technical Assistant: Leveraging ChatGPT and Embeddings

    Without saying, there has been a great deal of activity and buzz surrounding OpenAI and more specifically ChatGPT. This…

  • The importance of APIM

    The importance of APIM

    Many organisations, regardless of industry and size, will have data spread across a number of disparate systems and…

    2 条评论
  • GitHub Copilot - a pair programming match made in heaven?

    GitHub Copilot - a pair programming match made in heaven?

    If you are in the tech space, you may have read about the splash AI is making when it comes to software development and…

  • Partitioning your Cosmos DB

    Partitioning your Cosmos DB

    One of the exciting announcements from last year's Microsoft Build was that the Cosmos DB serverless tier was becoming…

  • PowerApps Wrap

    PowerApps Wrap

    Unless you have been living under a rock, you would have heard about PowerApps. PowerApps is Microsoft's low code…

    4 条评论
  • Creating a NSW COVID rules chatbot

    Creating a NSW COVID rules chatbot

    Chatbots are becoming increasingly common (or even the norm) across many industry verticals. Imagine having an…

  • Pokémon, Custom connectors and the Power Platform

    Pokémon, Custom connectors and the Power Platform

    I guess it's comes to no surprise that the Power Platform comes loaded with connectors. I'm not even going to list the…

  • Overview of D365 Customer Voice

    Overview of D365 Customer Voice

    If you have been involved in managing customer feedback within the Microsoft ecosystem, chances are you have probably…

  • A glimpse into Azure Digital Twin

    A glimpse into Azure Digital Twin

    So far, I have only been using a single AZ3166 to send telemetry data back to an IoT Central application. In the real…

社区洞察

其他会员也浏览了