One page for the people who decide
Reporting vulnerability risk means turning hundreds of scan findings into a short account a leader can act on. It names what matters, what it costs to fix and what needs a decision.
A list of 146 findings asks the reader to do the triage. A good report has already done it.
By the end of this lesson
Note
I can write a short vulnerability risk report for people who decide.
Key words
| Word | What it means |
|---|---|
| Risk | how likely harm is, and how bad it would be |
| Asset | a system or service the organisation relies on |
| Metric | a number tracked over time |
| Risk register | a list of risks with owners and decisions |
| Risk treatment | what is done about a risk: reduce, accept, transfer or avoid |
The cells students fill in are left blank in this preview.
Starter
Have a go
Starter
4 questionsRisk is likelihood and impact, not a count
Risk joins how likely harm is with how bad it would be. A count of findings measures neither. KEV and EPSS speak to likelihood. What an asset does, and what it holds, speaks to impact.
So report each asset on a few lines: findings, CVEs, critical ones, ones in KEV and ones with a high EPSS. Then look for the line that should worry a reader.
Write the helper that reads reports, part 1
docker exec tools sh -c "printf '%s\n' 'import csv' 'import gzip' 'import json' '' 'EPSS_FILE = \"/work/snapshot/epss-2026-11-20.csv.gz\"' 'KEV_FILE = \"/work/snapshot/kev-2026-11-20.json\"' '' 'def findings(name):' ' with open(\"/work/reports/\" + name + \".json\") as f:' ' report = json.load(f)' ' rows = []' ' for result in report.get(\"Results\", []):' ' rows = rows + (result.get(\"Vulnerabilities\") or [])' ' return rows' '' 'def cve_list(rows):' ' cves = []' ' for v in rows:' ' if v[\"VulnerabilityID\"] not in cves:' ' cves.append(v[\"VulnerabilityID\"])' > steps/snap.py"Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Write the helper that reads reports, part 2
docker exec tools sh -c "printf '%s\n' ' return cves' '' 'def epss(wanted):' ' scores = {}' ' with gzip.open(EPSS_FILE, \"rt\") as f:' ' for row in csv.reader(f):' ' if row[0] in wanted:' ' scores[row[0]] = [float(row[1]), float(row[2])]' ' return scores' '' 'def kev():' ' with open(KEV_FILE) as f:' ' catalogue = json.load(f)' ' return {v[\"cveID\"]: v for v in catalogue[\"vulnerabilities\"]}' '' 'def nvd(v):' ' return v.get(\"CVSS\", {}).get(\"nvd\", {}).get(\"V3Score\")' >> steps/snap.py"Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Scan the old image to JSON
docker exec scanner trivy image --input /targets/web-1.25.3.tar --format json -o /work/reports/web.jsonShown here, not run. Press Start lab to type it into your own lab’s terminal.
Scan the shop to JSON
docker exec scanner trivy fs /targets/shop --format json -o /work/reports/shop.jsonShown here, not run. Press Start lab to type it into your own lab’s terminal.
Scan the Java service to JSON
docker exec scanner trivy fs /targets/reports --format json -o /work/reports/reports.jsonShown here, not run. Press Start lab to type it into your own lab’s terminal.
Write the script that summarises each asset
docker exec tools sh -c "printf '%s\n' 'import snap' '' 'catalogue = snap.kev()' 'print(\"asset findings CVEs critical in-KEV EPSS>=0.1\")' 'for name in [\"web\", \"shop\", \"reports\"]:' ' rows = snap.findings(name)' ' cves = snap.cve_list(rows)' ' scores = snap.epss(cves)' ' critical = snap.cve_list([v for v in rows if v[\"Severity\"] == \"CRITICAL\"])' ' known = [c for c in cves if c in catalogue]' ' likely = [c for c in cves if scores.get(c, [0, 0])[0] >= 0.1]' ' print(name, len(rows), len(cves), len(critical), len(known), len(likely))' > steps/report.py"Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Summarise the three assets
docker exec tools python3 steps/report.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
What report.py printed
| Asset | Findings | CVEs | Critical | In KEV | EPSS 0.1 or more |
|---|---|---|---|---|---|
| web | 74 | 44 | 3 | 0 | 5 |
| shop | 49 | 49 | 1 | 0 | 1 |
| reports | 23 | 23 | 2 | 2 | 4 |
The cells students fill in are left blank in this preview.
Check
Have a go
Check
3 questionsA common mistake
Warning
Many people think a thorough report lists every finding. A leader cannot act on 146 rows. Put the full list in an appendix for the engineers, and lead with the few lines that need a decision.
What goes on the one page
Start with the headline: the Java reports service has two flaws attackers use, due on 30 November. Then the trend since the last report, how many fixes met their dates, and any exceptions with their expiry.
End with what you need: a decision, a budget or a change window. Write for someone with two minutes.
A one-page report, section by section
| Section | What it says | Example from the lab |
|---|---|---|
| Headline | The one risk that needs action | Log4Shell in the reports service, in KEV |
| Numbers | A few counts per asset | The report.py table |
| Trend | Better or worse than last time | Upgrading web closes 44 CVEs |
| On time | Share of fixes by their due date | The code below |
| Decisions | What you need from the reader | A change window this week |
The cells students fill in are left blank in this preview.
Try it: the share fixed on time
# Each fix: [CVE, due date, fixed date]. ISO dates compare as text.
fixes = [
["CVE-2021-44228", "2026-11-30", "2026-11-26"],
["CVE-2021-45046", "2026-11-30", "2026-11-26"],
["CVE-2024-45491", "2026-12-08", "2026-12-10"],
["CVE-2024-45492", "2026-12-08", "2026-12-10"],
["CVE-2024-56171", "2026-12-08", "2026-12-04"],
]
on_time = 0
for fix in fixes:
if fix[2] <= fix[1]:
on_time = on_time + 1
print("fixed on time:", on_time, "of", len(fixes))
print("share:", round(100 * on_time / len(fixes)), "%")
# Make the libexpat fixes land on 2026-12-08. What is the share now?
Make a free account to save your work and track your progress.
A risk register keeps the decision
A risk that is not fixed at once goes in the risk register. Write it as a sentence: if an attacker uses Log4Shell on the reports service, student records could be read. Give it an owner, a likelihood, an impact and a review date.
Then record the risk treatment: reduce it by patching, accept it for a time, transfer it, or avoid it by switching the service off.
Check
Have a go
Check
3 questionsAssignment: summarise for a report
Build the numbers a risk report needs. Each finding is a dictionary with cve, severity, epss and kev.
summarise(findings) returns {"findings": ..., "cves": ..., "critical": ..., "kev": ..., "likely": ...}, where findings counts every row and the other four count each CVE once; likely means an EPSS of 0.1 or more. headline(summaries) takes a dictionary from asset name to summary and returns the asset with the most KEV CVEs, then the most likely ones, then the most critical ones; the first asset wins a full tie. share_on_time(fixes) takes pairs of [due date, fixed date] as ISO strings and returns the percentage fixed on or before the due date, rounded to one decimal place, or 0 for no fixes.
def summarise(findings):
return {}
def headline(summaries):
return ""
def share_on_time(fixes):
return 0
Make a free account to save your work and track your progress.
Exit quiz
Have a go