Skip to content
Tutorials Center
My learning

Topics

Lesson 35 of 36 ยท Projects and Practice

Project: Incident Timeline Builder

Build an incident timeline tool in Python: normalize events from logs, file times and cloud audit data to UTC, merge and tag them, find clusters and gaps, and export a report table.

This capstone project ties the chapter together. You receive evidence from four places about one imaginary incident: a web server, a Windows workstation, a firewall and a cloud audit trail. Your job is to turn them into one timeline, find the story, and present it in a form fit for a report. All data is synthetic and the incident is fictional.

The scenario

A small company's web server received a suspicious upload. Later the file server in the cloud had a new access key created and some data was read. The four sources use different formats and time zones:

Source Time zone Example
Web access log UTC [12/Nov/2026:14:03:11 +0000]
Workstation file times local, UTC+1 2026-11-12 15:03:40
Firewall UTC, clock 90 s fast 14:05:12
Cloud audit log UTC (ISO) 2026-11-12T14:07:30Z

Step 1: A common event shape

Every event gets: UTC time, source, category, summary and the original timestamp text (so anyone can check your conversion). Review how time handling works in timeline basics.

Python Step 1: normalize four sources

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.

Each parser is tiny and explicit about its assumption: the +1 hour offset and the 90 second drift are parameters you would have to justify from evidence (a time check on the workstation, a comparison of firewall and server logs).

Step 2: Find gaps and clusters

Time gaps between consecutive events show phases of activity. A short gap suggests automation, a long gap suggests a person returning later.

Python Step 2: gaps between events

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 first four events are tightly packed: likely automated after an upload. The longer gap before the cloud events suggests the attacker used stolen credentials after some pause. This is a hypothesis to test, not a fact.

Step 3: Tag stages and report coverage

Group events by their category and state what you have not found. Gaps in coverage are findings too.

Python Step 3: attack stages and coverage

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 empty exfiltration stage is important: reading a file is not the same as proving it left the network. The report must say that the evidence shows access to the file but not yet transfer out, and list the data (flow volumes, storage access logs) that could settle it.

Step 4: Export for the report

A table with original and normalized times lets a reader audit your work. Producing CSV is trivial and tool-friendly.

Python Step 4: export CSV text

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.

(Note the third row's normalized time is only an example of the layout; recompute your own from Step 1.)

What to write in the report

  • Observations: the table of events with sources and original times.
  • Time assumptions: the UTC+1 offset, the firewall drift and how you established them.
  • Inferences: the likely order of stages, with confidence words.
  • Limits: no evidence for exfiltration or initial vulnerability; which logs would help.
  • Alternatives: could build-bot have legitimately created that key? What evidence says no (unfamiliar source address)?

Extensions

  1. Read events from CSV text and sort by UTC time.
  2. Add a source weight (reliability) and show the weakest links.
  3. Detect and flag events whose normalized order contradicts their stage order.
  4. Draw the stages as a mermaid diagram in your report.
  5. Rebuild the timeline after correcting the firewall drift to 60 seconds and see what changes.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why store the original timestamp text next to the normalized time?

    Showing the original lets others check the time zone and drift corrections.
  2. 2. The firewall clock is 90 seconds fast. What do you do with its times?

    A fast clock reports later times than real, so subtract the offset.
  3. 3. No exfiltration evidence was found. How should the report treat it?

    Honest reporting separates what is shown from what is unknown.
  4. 4. What does a short, regular gap between events often suggest?

    Scripts act in quick, regular steps; it is a hypothesis to verify.

Summary

  • Normalize every source into one event shape with UTC time and the original text.
  • Document offsets and drift as explicit parameters.
  • Use gaps and clusters to find phases, and map events to stages.
  • State missing stages honestly; export an auditable table.

Next: Digital Forensics Practice Questions