MSBA-361 · Lesson 10 of 12 · 18 min

Metrics and reporting

▶ Video coming soon A video version of this lesson is on the way.

Marisol had one request for the tenth session: a single page she could take to the executive team each month that showed whether the security program was working, without anyone having to explain what CodeQL was. Freya had a related worry. Numbers chosen badly change behavior badly; a team rewarded for closing alerts will close alerts, whether or not the code gets safer. The session was about choosing measures that point people at the right work, and building a report from them.

What to measure

Security metrics fall into four families. A useful program reports at least one measure from each, because each family alone can mislead.

Four families of security measures.
FamilyQuestion it answersExample measuresHow it can mislead alone
CoverageAre the protections switched on where they should be?Share of in-scope repositories with code scanning, push protection and Dependabot enabled and workingEverything enabled but nobody acts on alerts
ExposureHow much known risk is open now?Open critical and high alerts on the default branch, weighted by repository exposureA falling number may mean dismissals, not fixes
SpeedHow quickly is risk removed?Mean or median time to remediate by severity; share fixed within targetFast fixes of easy alerts hide slow fixes of hard ones
PreventionHow much risk never reaches the default branch?Alerts found and fixed in pull requests; push protection blocksRising numbers may reflect more code, not better habits
Four quadrants labeled coverage, exposure, speed and prevention, each with one example measure. A central circle reads read together. Arrows show that each quadrant balances a weakness in another.
Measures from the four families balance one another.

Seraphine's example of a misleading measure came from 2025. Before code scanning, the commerce group had reported vulnerabilities closed per month from a penetration testing tracker. The number rose steadily, and leadership was pleased. Later analysis showed that most of the closures were the same low-severity finding being re-reported and closed in each new environment. A count of closures had measured activity, not safety.

Where the numbers come from

Most measures come directly from GitHub. Security overview's dashboard and reports provide coverage, open alerts, remediation times, net resolve rate and alerts fixed in pull requests, filtered by properties, teams and dates. The REST and GraphQL APIs provide the same data for custom reporting. The audit log provides evidence of changes to settings and exceptions. Campaign views provide progress on targeted remediation.

Sources for Skerry's measures.
MeasureSourceNotes
Feature coverageSecurity overview coverage view; configurations APICount repositories, not committers
Default setup healthTool status; coverage filters for failed setupA repository that cannot be analyzed is not covered
Open alerts by severity and exposureSecurity overview risk view; alerts APIFilter by custom properties
Time to remediateSecurity overview dashboard; alert timelinesReport median as well as mean, because a few old alerts skew the mean
Fixed in pull requestsPull request alerts reportThe leading shift-left measure
ExceptionsDismissal requests, bypass requests, audit logCount and sample the reasons
Campaign progressCampaign view; campaigns APICompare with due dates

The point about the median deserves emphasis. When Skerry first switched on code scanning, the default branch contained alerts that had been in the code for years. Their detection date was the day of the first scan, so their time to remediate counted from then, but a small number of hard cases that stayed open for months still pulled the mean upward. Reporting the median alongside the mean showed that most alerts were fixed in days, while the mean was dominated by a few.

Leading and lagging indicators

Measures can also be read as leading or lagging. Lagging indicators report outcomes after the fact: the number of open critical alerts, the number of incidents. Leading indicators predict future outcomes: the share of new alerts fixed in pull requests, the share of repositories with a passing CodeQL analysis, the number of developers who completed secure coding training. A program that watches only lagging indicators learns about problems late. Freya asked for at least two leading indicators on every report.

Skerry's monthly scorecard

The scorecard Freya and Seraphine built had eight lines, each with a target, the current value, the direction since last month and an owner. It was generated from weekly exports stored in the governance repository, so that the numbers were reproducible.

Skerry's November security scorecard. Values are Skerry's own figures.
MeasureTargetNovember 20, 2026Owner
In-scope repositories with a passing CodeQL analysis in the last 7 days98 percent97 percent (691 of 712)Platform team
Open critical code scanning alerts on internet-facing restricted repositories03App security
Open high alerts on the same repositoriesUnder 2538Owning teams
Median days to fix critical and high alertsUnder 149Owning teams
New alerts fixed before mergeOver 70 percent74 percentDevelopment leads
Push protection bypasses reviewed within 1 day100 percent96 percentApp security
Dismissals with a documented reason100 percent100 percentApp security
Q4 SQL injection campaign186 fixed by Dec 18112 fixedReporting team leads

Reporting to different audiences

The same data told different stories to different readers, so the team produced three views from it.

Three audiences, three views.
AudienceWhat they needFormat
Executive teamIs risk going down? Where is it concentrated? What decisions are needed?One page: three trends, three risks, one request
Development leadsWhat does my team need to fix, by when?Security overview filtered by owning team, plus campaign views
AuditAre controls working and are exceptions controlled?Exports, audit log evidence, samples of dismissals and bypasses

The executive page avoided tool names entirely. It said that internet-facing systems holding customer data had 41 serious known weaknesses, down from 166 a month earlier; that three of them were critical and assigned to named teams; that three quarters of new weaknesses were now caught before code was merged; and that the one decision needed was approval for two more application security engineers in 2027, justified by the rate at which dismissal requests and campaign support were growing.

Avoiding perverse incentives

Freya's worry from the start of the session turned into rules for how measures were used.

Guarding against measures that change behavior badly.
RiskRule
Teams dismiss alerts to hit targetsReport dismissals alongside fixes; sample dismissal reasons monthly
Teams fix easy alerts and leave hard onesReport by severity and exposure, not only totals
Teams avoid enabling scanning to keep numbers lowCoverage is a target in its own right, owned by the platform team
Comparing teams with very different codeCompare each team with its own past, not with other teams
Gaming time to remediate by closing and reopeningUse alert timelines, which keep the original detection date

Evidence for audit

Ottoline's interest was different again. She wanted to test that the controls described in Skerry's policies operated throughout the period, not just on the day of the audit. For code security, that meant evidence that the enforced configurations had stayed attached, that dismissals were reasoned and reviewed where required, that merge rules blocked serious alerts, and that exceptions were time-limited. The weekly exports, the audit log stream and the alert timelines together provided that evidence. She asked for one addition: a monthly list of configuration changes with their governance records, which the team added to the export job.

Exporting dismissed code scanning alerts with reasons and comments for an audit sample. Field names should be checked against the API reference.
gh api "/orgs/skerry/code-scanning/alerts?state=dismissed&per_page=100" --paginate \
  --jq '.[] | [.repository.name, .rule.id, .dismissed_reason, .dismissed_by.login, .dismissed_at, (.dismissed_comment // "")] | @csv' \
  > exports/2026-11-dismissals.csv

Worked problem

Choosing a measure

A development director proposes a bonus for teams that close the most code scanning alerts each quarter. What is wrong with this measure, and what should replace it?

Show solution
  1. Recognize that closures include dismissals and easy fixes, so the measure rewards activity rather than reduced risk.
  2. Note that it penalizes teams whose code is already clean.
  3. Propose measures by severity and exposure: open critical and high alerts on important repositories, and time to fix them.
  4. Add a prevention measure: share of new alerts fixed before merge.

Answer: Closure counts reward activity and can encourage careless dismissals. Use severity-weighted exposure, time to remediate and the share of new alerts fixed before merge, compared with each team's own trend.

Setting targets

A measure without a target is a number; with a target, it is a commitment. Freya set targets with three rules. Each target had to be something the teams could influence directly. Each had to be reachable within two quarters at the current rate of improvement. And each had to be reviewed, not just raised, when it was met.

Targets set in November 2026, written as plans.
MeasureNovember valueTarget for March 2027Why this target
Repositories with passing analysis691 of 712All in-scope repositoriesCoverage is fully within the platform team's control
Critical alerts on internet-facing restricted repositories30 older than 7 daysCritical exposure should be rare and short
Median days to fix high and critical alerts97Reachable at the current rate of improvement
Alerts fixed before merge74 percent80 percentPrevention is improving with Autofix and the gate

Lorcan asked why the fixed-before-merge target was not higher. Freya's answer was that some alerts are better dismissed than fixed, and some arrive in emergency changes, so a target near the maximum would push teams to merge unnecessary fixes or dismiss carelessly. A target set slightly above the current trend keeps attention on the measure without distorting it.

Building the numbers

The scorecard was produced by a scheduled workflow in the governance repository that called the REST API for code scanning alerts, campaigns and configurations, wrote the results to a file, and opened a pull request with the new month's figures. Using a pull request meant every month's numbers were reviewed before publication and kept with their history, which Ottoline treated as part of the audit evidence. The workflow used a GitHub App with read-only security permissions rather than a personal token, following the token policies from MSBA-291.

Two lessons came from the first months. Definitions had to be written down: median days to fix counted only alerts closed as fixed, not dismissed, and Seraphine added that sentence to the scorecard footer after a team asked why their number had changed. And numbers had to be compared with the same filter each month, because a change in the in-scope repositories could move a measure without any change in security.

The scorecard and the exam

The GH-500 security operations domain expects candidates to know which views and data sources support reporting: security overview's dashboards and filters, alert lists exported as files, the REST API for alerts and campaigns, and webhooks for events as they happen. It does not expect candidates to design a scorecard, but questions often describe a reporting need and ask which source fits. Priya's rule of thumb was that a point-in-time question for a person is answered by security overview, a repeated report for many people is built from the API, and an action that must happen the moment something changes needs a webhook. The scorecard used all three: security overview for exploring, the API for the monthly figures, and webhooks from the GitHub App that watched custom properties.

What the numbers did not show

Freya ended the session with a caution. The scorecard showed alerts, and alerts are only what the tools can see. A design flaw in how two services trust each other, a missing check in a business rule, or a weakness in a third-party service would not appear in any of the five measures. Penetration tests, threat reviews for new systems and the incident reviews from MSBA-360 remained part of the program for that reason. The scorecard was a way to manage the part of the problem that tools make visible, not a measure of whether Skerry was secure.

Common mistakes

  • MistakeReporting only the total number of open alerts.

    InsteadReport coverage, exposure, speed and prevention together.

  • MistakeUsing the mean time to remediate alone.

    InsteadReport the median as well, so a few old alerts do not dominate.

  • MistakeRewarding alert closures.

    InsteadReward reduced exposure and prevention, and sample dismissals.

  • MistakeBuilding reports that cannot be reproduced.

    InsteadStore regular exports so numbers and evidence can be checked later.

Summary and key terms

  • Good security reporting combines coverage, exposure, speed and prevention measures.
  • Security overview, the APIs, the audit log and campaign views supply the data.
  • Report medians as well as means for remediation time.
  • Leading indicators such as fixes before merge predict outcomes; lagging indicators report them.
  • Different audiences need different views of the same data.
  • Design measures to avoid perverse incentives such as careless dismissals.
  • Regular exports and audit log streaming provide evidence that controls operate over time.
Coverage measure
A measure of whether protections are enabled and working where required.
Exposure measure
A measure of known risk currently open.
Leading indicator
A measure that predicts future outcomes, such as fixes before merge.
Lagging indicator
A measure that reports outcomes after the fact, such as open critical alerts.
Median
The middle value in a sorted list, less affected by extreme values than the mean.
Scorecard
A short list of measures with targets, current values, direction and owners.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Name one measure from each of the four families.

    Show answer

    For example: repositories with passing analysis (coverage), open critical alerts (exposure), median days to fix (speed), alerts fixed before merge (prevention).

  2. Why can a falling number of open alerts be misleading?

    Show answer

    It may reflect dismissals rather than fixes.

  3. What did Ottoline need beyond the current numbers?

    Show answer

    Evidence that controls operated throughout the period, from exports, the audit log and alert timelines.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz