Skip to content
Tutorials Center
My learning

Topics

Lesson 48 of 53 ยท Projects

Project: Vulnerability Triage Tracker

Build a vulnerability tracker in Python: ingest scanner findings, rank them by CVSS, exposure and exploitation, set SLAs, and print a summary report.

A scanner can produce thousands of findings in an afternoon. Nobody can fix them all at once, and treating every "High" the same wastes effort on issues that nobody can reach while a truly dangerous one waits in the queue. Triage is the work of deciding what to fix first, who owns it, and by when.

In this project you build a small vulnerability tracker in Python. It ingests findings from a sample scanner export, combines the CVSS score with context (is the asset exposed to the internet, is the flaw being exploited, how important is the asset), assigns a fix deadline from a service-level agreement (SLA), and prints a report. The data is made up and the code is a stand-in for a real tracker or ticketing system, but the reasoning matches Vulnerability Scanning and Triage. Use it only on findings from systems you are authorized to assess.

From finding to fix

Ingest Load and validate findings.
Prioritise Combine CVSS with context.
Set SLA Give every item a deadline.
Report Show what is late and why.
1 / 2

Step 1: Ingest and validate

Scanner exports come as CSV or JSON. Whatever the format, validate each record before trusting it: a missing score or an impossible value should be rejected loudly, not turned into a zero that hides a problem. CVSS base scores run from 0.0 to 10.0 and map to the standard severity bands: 0.0 None, 0.1 to 3.9 Low, 4.0 to 6.9 Medium, 7.0 to 8.9 High, and 9.0 to 10.0 Critical.

Python Load and validate findings

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The rejected list matters as much as the accepted one. In a real tracker, rejected records go back to whoever runs the scanner, so a data problem never silently turns into a hidden vulnerability.

Step 2: Prioritise with context

A CVSS base score describes the flaw in general. It does not know that one server is a public web shop and another sits on an isolated network. Triage adjusts the base score using facts about your environment:

  • Exposure. Reachable from the internet, only from the internal network, or isolated. Internet-facing weaknesses usually come first.
  • Known exploitation. If a flaw is being used in real attacks, it jumps the queue. Public catalogues of exploited vulnerabilities, and exploit-likelihood scores such as EPSS, exist for exactly this question.
  • Asset criticality. What would be lost: payment data, patient records, a test machine?
  • Compensating controls. A firewall rule or a virtual patch may reduce risk until a fix is deployed. Record it, with an expiry date.

Combine them with a simple, explainable formula. A transparent rule that people understand and can argue with beats a clever one nobody trusts.

Python Context-aware priority

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Compare F-7 with F-3. The old test VM has a higher CVSS score (9.1 against 7.8), yet it lands lower because it is isolated and unimportant. That is the point of triage, but it is also a judgement: write down the reason, because a "temporary" test machine often gets connected to something later.

Step 3: Deadlines, status and a report

An SLA turns a priority into a deadline. Example targets (real organizations choose their own, often from policy or regulation): P1 within 2 days, P2 within 14 days, P3 within 45 days, P4 within 90 days. Track the due date from the day the finding was discovered, not the day someone read the ticket. Allow documented risk acceptance with an owner and an expiry for the rare case where a fix is not possible, rather than letting items quietly become overdue.

Python SLA tracking and summary report

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The report answers the questions a manager actually asks: how much is open, what is late, who owns it. Add trend lines (are overdue items growing?) and a mean time to remediate per priority, and you can show whether the process is improving. Tie the numbers to incident response when a P1 turns out to have already been exploited.

What is real and what is the stand-in

CVSS bands, SLAs, exposure and exploitation as inputs, and risk acceptance with an owner and expiry are real practice. The weights in priority() are an invented example; real programs tune theirs and often use frameworks such as SSVC or vendor risk scores. The JSON text and in-memory lists replace a database, a scanner API and a ticketing system. Deduplication (the same flaw found by two scanners), asset inventories and automatic re-scanning to confirm fixes are all things real trackers need and this one skips.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why does a CVSS base score alone make a poor priority?

    The base score describes the flaw in general. Risk to your organization depends on context such as reachability and what the asset holds.
  2. 2. What should happen to a scanner record with a CVSS score of 12.5?

    Scores run from 0.0 to 10.0. Invalid data must be surfaced, not silently converted into a value that could hide or exaggerate a problem.
  3. 3. From which date should the SLA clock normally start?

    Starting at discovery stops delays in routing or reading tickets from extending the real exposure time.
  4. 4. When a fix is not possible, what is the responsible way to leave a finding open?

    Accepted risk must be a visible, time-limited decision by someone accountable, not a silent failure to meet the deadline.

Summary

  • Validate every ingested finding and report the rejects instead of defaulting missing data.
  • CVSS gives a severity band; triage adds exposure, known exploitation, asset criticality and compensating controls.
  • Use a simple, explainable priority formula and write down the reasoning behind exceptions.
  • Give each priority an SLA counted from discovery, and track owners, status and overdue items.
  • Time-limited, owned risk acceptance is better than silent overdue items.

Next: Project: Build and Harden a Login Flow.