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 behaviour 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.
| Family | Question it answers | Example measures | How it can mislead alone |
|---|---|---|---|
| Coverage | Are the protections switched on where they should be? | Share of in-scope repositories with code scanning, push protection and Dependabot enabled and working | Everything enabled but nobody acts on alerts |
| Exposure | How much known risk is open now? | Open critical and high alerts on the default branch, weighted by repository exposure | A falling number may mean dismissals, not fixes |
| Speed | How quickly is risk removed? | Mean or median time to remediate by severity; share fixed within target | Fast fixes of easy alerts hide slow fixes of hard ones |
| Prevention | How much risk never reaches the default branch? | Alerts found and fixed in pull requests; push protection blocks | Rising numbers may reflect more code, not better habits |
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.
| Measure | Source | Notes |
|---|---|---|
| Feature coverage | Security overview coverage view; configurations API | Count repositories, not committers |
| Default setup health | Tool status; coverage filters for failed setup | A repository that cannot be analyzed is not covered |
| Open alerts by severity and exposure | Security overview risk view; alerts API | Filter by custom properties |
| Time to remediate | Security overview dashboard; alert timelines | Report median as well as mean, because a few old alerts skew the mean |
| Fixed in pull requests | Pull request alerts report | The leading shift-left measure |
| Exceptions | Dismissal requests, bypass requests, audit log | Count and sample the reasons |
| Campaign progress | Campaign view; campaigns API | Compare 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.
| Measure | Target | November 20, 2026 | Owner |
|---|---|---|---|
| In-scope repositories with a passing CodeQL analysis in the last 7 days | 98 percent | 97 percent (691 of 712) | Platform team |
| Open critical code scanning alerts on internet-facing restricted repositories | 0 | 3 | App security |
| Open high alerts on the same repositories | Under 25 | 38 | Owning teams |
| Median days to fix critical and high alerts | Under 14 | 9 | Owning teams |
| New alerts fixed before merge | Over 70 percent | 74 percent | Development leads |
| Push protection bypasses reviewed within 1 day | 100 percent | 96 percent | App security |
| Dismissals with a documented reason | 100 percent | 100 percent | App security |
| Q4 SQL injection campaign | 186 fixed by Dec 18 | 112 fixed | Reporting team leads |
Reporting to different audiences
The same data told different stories to different readers, so the team produced three views from it.
| Audience | What they need | Format |
|---|---|---|
| Executive team | Is risk going down? Where is it concentrated? What decisions are needed? | One page: three trends, three risks, one request |
| Development leads | What does my team need to fix, by when? | Security overview filtered by owning team, plus campaign views |
| Audit | Are 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.
| Risk | Rule |
|---|---|
| Teams dismiss alerts to hit targets | Report dismissals alongside fixes; sample dismissal reasons monthly |
| Teams fix easy alerts and leave hard ones | Report by severity and exposure, not only totals |
| Teams avoid enabling scanning to keep numbers low | Coverage is a target in its own right, owned by the platform team |
| Comparing teams with very different code | Compare each team with its own past, not with other teams |
| Gaming time to remediate by closing and reopening | Use 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.
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.csvWorked 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
- Recognize that closures include dismissals and easy fixes, so the measure rewards activity rather than reduced risk.
- Note that it penalizes teams whose code is already clean.
- Propose measures by severity and exposure: open critical and high alerts on important repositories, and time to fix them.
- 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.
| Measure | November value | Target for March 2027 | Why this target |
|---|---|---|---|
| Repositories with passing analysis | 691 of 712 | All in-scope repositories | Coverage is fully within the platform team's control |
| Critical alerts on internet-facing restricted repositories | 3 | 0 older than 7 days | Critical exposure should be rare and short |
| Median days to fix high and critical alerts | 9 | 7 | Reachable at the current rate of improvement |
| Alerts fixed before merge | 74 percent | 80 percent | Prevention 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.
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).
Why can a falling number of open alerts be misleading?
Show answer
It may reflect dismissals rather than fixes.
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.
Create a free account to save your progress, take quizzes and earn a certificate.