Lesson 5 of 7 DevOps Metrics and Dashboards

Metrics and Queries for Security

This lesson explains how to measure exposure and response, and where each platform reports it.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify meaningful security measures.
  • Explain why alert counts need coverage data.
  • Identify where security data is reported.
  • Distinguish a report from a security gate.

Measuring exposure and response

A raw count of alerts is a weak measure on its own, because it rises when scanning improves. The useful questions are how serious the findings are, how long they stay open, and how much of the estate is being scanned at all.

Open alerts by severity and age

Grouping alerts by severity shows what needs attention, and alert age shows whether the team is keeping up. A critical alert that has been open for 200 days is more informative than a total count.

Mean time to remediate

Mean time to remediate (MTTR, in a security context) measures the time from when a finding is detected until it is fixed. Organizations often set targets by severity, for example seven days for critical vulnerabilities, and report the percentage of findings fixed within target.

Coverage

Scanning coverage is the share of repositories with code, secret and dependency scanning enabled. A repository that is not scanned reports zero alerts, so a low alert count means little without this measure.

Prevention

Prevention measures show issues stopped before they arrived, such as secrets blocked by push protection and vulnerable dependencies blocked by dependency review. Rising prevention with falling new alerts shows that security has shifted left. It is also useful to record bypasses, which show when people override a control.

The following diagram compares a security dashboard whose open-vulnerability count misled before and after the change.

Why the open-vulnerability count misled. It fell 40% partly because 60 repositories stopped being scanned, while the mean age of critical alerts rose. Showing scanning coverage beside the count, and alert age or mean time to remediate by severity, reveals what the count alone hid.
MTTR stands for mean time to remediate.
Select all that apply

Security measures worth reporting

Exam skills 1.2.5

Pick the measures that show real exposure and response.

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

Where the data is found

The following table shows where each platform reports security data.

ToolWhat it shows
GitHub security overviewAlerts and scanner enablement across an organization's repositories, with trends
Repository Security tabCode scanning, secret scanning and Dependabot alerts
Azure DevOps Advanced Security overviewAlerts by repository, and enablement across an organization
Microsoft Defender for Cloud DevOps securityFindings across Azure DevOps, GitHub and GitLab in one place
GitHub REST API and Azure DevOps Advanced Security APIsAlert data for custom reports

Security metrics should also be built into pipelines as gates. For example, the AdvancedSecurity/NewHighAndCritical status check in Azure Repos can block pull requests that introduce high or critical alerts. This is a stronger control than a report, as the lesson on quality gates explains.

Scenario questions

Choosing the security view

Exam skills 1.2.5

Find the tool that reports the security data each person needs.

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

A misleading trend

A chief information security officer reports a 40% fall in open vulnerabilities this quarter. You discover that 60 repositories were archived from scanning during a platform migration, and that the mean age of critical alerts has risen. How should the dashboard change?

The dashboard should show scanning coverage beside the alert count, because the fall partly results from less scanning. It should also show alert age or mean time to remediate by severity, which reveal that response has become slower. Showing only the count created a false sense of progress.

Check yourself

Why should scanning coverage appear beside alert counts?

Show answer

A repository that is not scanned reports no alerts, so a low count could simply mean less scanning.

Exam Tips

Remember for the exam

  • A low alert count means little without scanning coverage.
  • Track time to remediate by severity.
  • Security overview summarizes alerts across a GitHub organization.
  • Defender for Cloud gives one view across DevOps platforms.
  • A status check on new high and critical alerts is stronger than a report.