Skip to content
Tutorials Center
My learning

Topics

Lesson 36 of 38 ยท Projects and Practice

Project: A Findings Tracker and Report Builder

Build a small findings tracker in Python that rates risk, stores findings as JSON, records retests and generates an executive summary and Markdown report.

In this project you will build the kind of internal tool many testing teams write for themselves: a findings tracker that stores each issue as data, rates it consistently, follows it through remediation and retest, and produces a report. You will practice the ideas from the reporting chapter as working code.

Everything runs in the in-browser Python runner on invented findings for a made-up company. Nothing is scanned or attacked. You will grow the program in four steps, each a runnable example that builds on the last. Copy the finished code into a file on your own machine if you want to keep it.

Step 1: a finding as a data class

A finding needs identity, a rating, assets, text and a status. A dataclass gives you a typed container with very little code. Likelihood and impact use the same low/medium/high scale as the risk matrix.

Python Step 1: the Finding data class

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 __post_init__ check refuses bad input immediately, so a typo in the rating never reaches the report. Severity is a computed property, so it cannot drift out of step with likelihood and impact.

Step 2: a tracker with status workflow

Findings move through a fixed workflow. Enforce it in code so nobody can jump from "open" to "retest passed" without a fix.

Python Step 2: the Tracker and status rules

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 state machine documents how work should flow and the history records who changed what and why. This is the first place the tool earns its keep: it stops "closed" being declared before anyone has verified it.

Step 3: save and load JSON

Real tools keep data between runs. JSON is human-readable and diff-friendly. Here you serialize the tracker to a string (in a normal script you would write it to a file with open(..., "w")).

Python Step 3: save and load as JSON

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.

Round-tripping and comparing the objects is a cheap test that your save format loses nothing. In a real project you would write the same checks as automated tests.

Step 4: reports and a retest summary

Now produce output for two audiences: an executive paragraph and a technical table.

Python Step 4: executive summary and table

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 summary shows the number a leader cares about (what is still open, and what is urgent), and the table gives engineers the details.

Extend the project

  • Add due dates from a severity policy and flag overdue items (see remediation and retesting).
  • Add CVSS vectors and compute scores with the calculator from the first lesson.
  • Add an evidence list with hashes for each finding.
  • Write tests for every invalid status change.
  • Export to Markdown or HTML with a template, as in writing the report.
  • Keep the JSON in version control so every change to a finding has a history.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is severity a computed property rather than a stored field in Step 1?

    Deriving a value from its inputs removes the chance of contradictory data.
  2. 2. What does the status workflow in Step 2 prevent?

    Only allowed transitions are accepted, so 'open' cannot jump straight to 'retest passed'.
  3. 3. What is a quick check that your JSON save and load code loses nothing?

    Equality after a save and load shows that the format preserves every field.
  4. 4. Who is the executive summary paragraph in Step 4 for?

    It gives leaders the totals and the most urgent action; the table serves engineers.

Summary

  • Model findings as typed data, validate input immediately and compute derived values such as severity.
  • Enforce the remediation workflow so closure always needs a verified retest.
  • Store data as JSON and test the round trip.
  • Generate both an executive summary and a technical table from the same data.
  • Extend the tool with due dates, CVSS, evidence hashes and tests.

Next: Project: a loopback security-header audit