Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Reporting vulnerability risk

After this lesson: I can write a short vulnerability risk report for people who decide.

60 min lesson7 commandsVulnerability management lab: Trivy, CVSS, EPSS and KEV

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

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

WordWhat it means
Riskhow likely harm is, and how bad it would be
Asseta system or service the organisation relies on
Metrica number tracked over time
Risk registera list of risks with owners and decisions
Risk treatmentwhat 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 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Risk 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

Command
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

Command
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

Command
docker exec scanner trivy image --input /targets/web-1.25.3.tar --format json -o /work/reports/web.json

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Scan the shop to JSON

Command
docker exec scanner trivy fs /targets/shop --format json -o /work/reports/shop.json

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Scan the Java service to JSON

Command
docker exec scanner trivy fs /targets/reports --format json -o /work/reports/reports.json

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Write the script that summarises each asset

Command
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

Command
docker exec tools python3 steps/report.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

What report.py printed

AssetFindingsCVEsCriticalIn KEVEPSS 0.1 or more
web7444305
shop4949101
reports2323224

The cells students fill in are left blank in this preview.

Check

Have a go

Check

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

A 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

SectionWhat it saysExample from the lab
HeadlineThe one risk that needs actionLog4Shell in the reports service, in KEV
NumbersA few counts per assetThe report.py table
TrendBetter or worse than last timeUpgrading web closes 44 CVEs
On timeShare of fixes by their due dateThe code below
DecisionsWhat you need from the readerA change window this week

The cells students fill in are left blank in this preview.

Try it: the share fixed on time

Code: python
# 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 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Assignment: 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.

Code: python
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

Exit quiz

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.