Unit 1: The response lifecycle · Lesson 4 of 4 · 16 min
Open the case log
Set up a working folder and a timestamped log that records what you did, when, and what you saw.
mission
- You are
- The IR lead analyst.
- Situation
- Everything you do from now on may be read by lawyers, auditors or a regulator. A case log written as you go is the record they will trust.
- Goal
- Create the case folder, write UTC log entries and record a terminal session.
- Hand in
- A case log with the declaration and a recorded command.
Make the working folder
Evidence under /cases stays untouched. Your copies, notes and outputs go in ~/case. mkdir -p creates the folders and does not complain if they exist.
mkdir -p ~/case/IR-2026-031/notes ~/case/IR-2026-031/outputs && ls ~/case/IR-2026-031
notes
outputs
mkdir- Creates folders. Built into Linux and macOS.
ls- Lists the files in a folder. Built into Linux and macOS.
Write UTC timestamps
Log in UTC so entries from every system line up. date -u prints UTC; the format string gives ISO 8601. Your output shows today's time.
date -u +%Y-%m-%dT%H:%M:%SZ
2026-10-29T19:28:37Z
date- Prints the date and time, or converts between date formats. Built into Linux and macOS.
Add entries to the log
printf writes a line, >> appends it to the log without overwriting. The first two entries record facts that already happened, with their real times.
printf '%s %s\n' 2026-10-21T14:18:00Z 'Escalation INC-48213 received from SOC' >> IR-2026-031/case-log.txt printf '%s %s\n' 2026-10-21T14:20:00Z 'Declared IR-2026-031, SEV-2, IC P. Natarajan' >> IR-2026-031/case-log.txt cat IR-2026-031/case-log.txt 2026-10-21T14:18:00Z Escalation INC-48213 received from SOC 2026-10-21T14:20:00Z Declared IR-2026-031, SEV-2, IC P. Natarajan
printf- Prints formatted text. Built into Linux and macOS.
cat- Prints the contents of one or more files. Built into Linux and macOS.
Record a whole terminal session
script saves everything a command prints into a file, so you can show exactly what you ran. -q hides the start and stop messages, -c runs one command. The log file keeps a header with the start time.
script -q -c 'jq -r .alert_id /cases/IR-2026-031/intake/alert-NDR-7731.json' IR-2026-031/outputs/session-01.log NDR-7731 cat IR-2026-031/outputs/session-01.log Script started on 2026-10-29 19:28:37+00:00 [COMMAND="jq -r .alert_id /cases/IR-2026-031/intake/alert-NDR-7731.json" <not executed on terminal>] NDR-7731 Script done on 2026-10-29 19:28:37+00:00 [COMMAND_EXIT_CODE="0"]
script- Records everything in a terminal session to a file. Built into Linux and macOS.
Open the log in the text editor
Open My case folder on the desktop and double-click IR-2026-031/case-log.txt. Add one line in the same format saying you started analysis.
you should see Three lines, each starting with a UTC timestamp.
What a defender takes away
- 1Keep evidence read-only and work in your own case folder.
- 2Log in UTC with ISO 8601 timestamps, as you go, not from memory.
- 3Record sessions so every finding can be traced to a command and its output.
Questions
0 of 2 solved
Answer each one from what you find on your lab machine.