Practical Roadmap

Cybersecurity

Understand systems, practise in authorised labs, investigate evidence, and explain fixes that developers can apply.

Before You Begin

  • Basic computer use
  • A dedicated practice folder
  • Use only your own systems or explicitly authorised training labs

What You Will Build

A small evidence portfolio containing a lab report, a synthetic-log investigation, a permissions review, and a security improvement plan.

YOUR COURSE PROJECT · 10 CONNECTED STAGES

Local Security Casebook

Investigate the fictional StudyNotes application using your own local files, a loopback-only HTTP demonstration, a deliberately incomplete permission function, and synthetic evidence. Each lesson adds a named artifact to one casebook; no public target or real account is involved.

What You Need

  • A text editor
  • PowerShell on Windows, or a terminal with equivalent file commands
  • A currently supported Node.js LTS release for the supplied local examples
  • A modern browser with developer tools
  • Wireshark is optional; the packet lesson supplies a readable text example

Set Up Your Project

  1. Create a new folder named local-security-casebook in a location where you can edit files.
  2. Keep every exercise inside that folder; add notes, fixtures, evidence, and lab subfolders in the first lesson.
  3. StudyNotes is a fictional two-user notes service. learner-a owns note-a; learner-b owns note-b. The teaching server only exposes a health response and does not implement real accounts.
  4. Use port 8787 only for the supplied loopback server. If that port is occupied, choose another unused port and update your own examples consistently; do not stop another project's server.
  5. Create files as the lessons introduce them. The code and synthetic records needed for each exercise are provided inline.

Markdown file · all lessons, examples and project steps · no account needed

01

Get Comfortable in a Terminal

Start the Local Security Casebook in a dedicated practice folder. Use the supplied PowerShell example, or create the same files with your own shell and editor, then record which commands inspect information and which change it. This folder becomes the home for every later StudyNotes exercise.

What You Will Learn

  • Distinguish a terminal, a shell, a command, and an argument.
  • Create a bounded practice workspace and record exactly what you inspected.
  • Identify which operations read information and which change it.

Understand the Idea

A terminal is the window through which you interact with a shell. The shell interprets a command and its arguments, then starts the operation or program. A command's meaning depends on the shell: PowerShell's Get-Content and a Linux shell's cat can both display a file, but their surrounding syntax is different. This lesson uses PowerShell explicitly. On another system, use your editor to create the same files and consult that shell's documentation rather than pasting unfamiliar commands and hoping they behave identically.

Your current directory supplies the starting point for relative paths. If you ask to read evidence\scope.txt, the shell looks below the current directory, not automatically beside whichever file you last edited. An absolute path identifies a location from a drive or filesystem root. Before changing files, establish where you are and what already exists. This small habit prevents many avoidable mistakes and also makes an investigation reproducible: another person needs to know which file an observation came from.

The casebook begins as an organised set of evidence and notes, not a collection of powerful tools. Keep supplied examples in fixtures, observations in evidence, explanations in notes, and executable practice code in lab. Source records should remain unchanged after you begin analysing them; create derived files separately. Give every observation a filename and context so a later conclusion can point back to its origin. You are practising the same distinction that matters in larger investigations: what you received, what you did, and what you inferred.

Read commands before executing them. Get-Location and Get-ChildItem inspect state; New-Item and Set-Content change it. A command that returns no visible output may still have succeeded, and an error should be read before retrying. Here the names are deliberately limited to a new practice folder. Do not experiment with broad deletion, administrator privileges, or existing personal documents. You can learn navigation, quoting, and inspection without any destructive operation.

WORKED EXAMPLE

Create and Inspect the Casebook

Run these commands in PowerShell from a suitable parent folder. Use a new folder name if local-security-casebook already contains work you want to preserve.

powershell
New-Item -ItemType Directory -Path .\local-security-casebook
Set-Location .\local-security-casebook
New-Item -ItemType Directory -Path notes,fixtures,evidence,lab
Set-Content -LiteralPath .\notes\scope.txt -Value 'StudyNotes is fictional. Work only with these local exercises.'
Get-Location
Get-ChildItem
Get-Content -LiteralPath .\notes\scope.txt
  1. The first command creates the project boundary; Set-Location makes it the base for subsequent relative paths.
  2. Four directories separate notes, supplied data, observations, and executable examples.
  3. Set-Content creates a short scope statement. The remaining commands read the location, directory listing, and statement.

Expected Result

The folder contains four subdirectories, and the last command displays the fictional-scope sentence. No application server or remote connection has been started.

PROJECT STAGE 01 / 10

Establish the Evidence Workspace

Builds on: This is the first artifact; no previous file is required.

  1. Create the project folder and four subfolders using the example or your editor.
  2. Create notes/scope.txt and state that StudyNotes and both learners are fictional.
  3. Create README.md listing each folder's purpose and the shell you used.
  4. Create evidence/session-01.txt with your current project path, the inspection commands, and their actual results.
  5. Classify each command you ran as read-only or state-changing; correct any unexpected result before continuing.

Keep This Deliverable

README.md, notes/scope.txt, and evidence/session-01.txt inside local-security-casebook.

Check Your Build

  • All exercise files are inside the named project folder.
  • A reader can identify your shell and reproduce the inspection without guessing a working directory.
  • Your notes distinguish the source file from the record of inspecting it.

Common Mistakes and Fixes

A command fails because the terminal is in a different folder.
Read Get-Location, navigate deliberately, and retry the specific inspection. Do not create several similarly named folders to hide the mistake.
Linux and PowerShell examples are mixed without explanation.
Label the shell in your notebook and use that shell's documented command syntax.

Check Your Understanding

Why can two terminals running the same relative-path command read different files?

Reveal the explanation

They can have different current directories. The relative path is resolved from each terminal's location, so record or set that location before interpreting the result.

Ready to Move On?

All files are inside the casebook, your shell is named, and read-only commands are distinguished from changes.

Open the learning resource
02

Map Addresses, Ports, and Protocols

Map the local StudyNotes teaching environment before starting a server. Break http://127.0.0.1:8787/health into its protocol, loopback address, port, and route. Build a diagram and evidence plan that distinguish connection questions from application permissions; this step requires no network scan or running service.

What You Will Learn

  • Distinguish a hostname, IP address, port, protocol, and application route.
  • Explain why loopback traffic stays on the same machine.
  • Separate network reachability from application-level success.

Understand the Idea

A network conversation needs more context than a website name. An IP address identifies an interface or destination in a network context; a port helps identify a communication endpoint on that machine. A hostname is a name that may resolve to one or more addresses. HTTP is an application protocol, and /health is a route within the HTTP application. These pieces answer different questions. A successful name lookup says nothing by itself about whether the server is listening or whether the requested operation is permitted.

Our teaching server will listen on 127.0.0.1, the IPv4 loopback address, and port 8787. The browser and server run on the same computer. This particular request does not need a public DNS lookup or a trip through your internet router because the URL already contains the loopback address. That makes it a useful controlled example. A real public website involves additional components, but adding them to this diagram would obscure what this local experiment actually does.

Think of troubleshooting as locating the layer at which an observation occurs. A refused connection can mean that no process is listening on the chosen address and port. An HTTP 404 means an HTTP server responded but did not provide the requested resource. A permission failure belongs to the application's decision about an action. None of those results automatically indicates hostile activity. Record the exact result and ask which possible causes it rules in or out before choosing another check.

The diagram is also an initial scope boundary. Later lessons investigate a fictional permission function and synthetic records; they do not turn this loopback server into a production account system. Draw only the components that exist in the exercise. If you later use an authorised hosted training lab, record that as a different environment rather than quietly mixing its addresses and evidence with your local StudyNotes observations.

WORKED EXAMPLE

Read a URL as Separate Decisions

This is a planning diagram for the server created in the next lesson. It is not output from a network scan.

text
URL: http://127.0.0.1:8787/health

http        application protocol
127.0.0.1   destination: this computer's loopback interface
8787        destination TCP port chosen for this lab
/health     route requested from the teaching application

Browser on this computer
  -> loopback TCP connection to 127.0.0.1:8787
  -> HTTP request for /health
  <- HTTP response from the local teaching server
  1. The numeric address means this example does not ask DNS to resolve a hostname.
  2. The port selects the intended listener; using the wrong port may reach nothing or a different local program.
  3. The route is interpreted after an HTTP connection reaches a server. Changing the route is different from changing the destination.

Expected Result

You can explain all four URL components without claiming that the server is running yet. The diagram makes no statement about authentication or encryption.

PROJECT STAGE 02 / 10

Draw the StudyNotes Boundary

Builds on: Use README.md and notes/scope.txt from the workspace lesson.

  1. Create notes/network-map.txt and copy the diagram, replacing nothing unless you deliberately select a different unused port.
  2. Add a sentence explaining why the router and public DNS are outside this local request path.
  3. Create evidence/network-questions.txt with three separate questions: does a listener exist, does /health respond, and is a requested action allowed?
  4. For each question, write the kind of evidence that could answer it; do not mark any unperformed test as passed.
  5. Add the chosen address and port to README.md so later observations use the same environment.

Keep This Deliverable

A labelled network diagram and a three-question evidence plan.

Check Your Build

  • The diagram distinguishes the IP address, port, protocol, and route.
  • No unperformed connection test is presented as an observation.
  • The chosen scope remains limited to this computer and the supplied exercises.

Common Mistakes and Fixes

A hostname resolving is treated as proof the website works.
Keep name resolution, connection establishment, HTTP response, and permitted action as separate checks.
The diagram includes services that the exercise never creates.
Remove invented components or label them explicitly as future possibilities outside the current scope.

Check Your Understanding

What changes if /health becomes /missing while 127.0.0.1:8787 stays the same?

Reveal the explanation

The intended server endpoint stays the same, while the requested application route changes. A running teaching server can therefore return 200 for one route and 404 for the other.

Ready to Move On?

Explain each URL component and label planned checks separately from observations.

Open the learning resource
03

Read an HTTP Conversation

Run the supplied loopback-only Node teaching server and inspect two HTTP responses in your browser. Record the difference between a successful health route, a missing route, and a connection failure after stopping your server. The example implements no user accounts or note-access service.

What You Will Learn

  • Run a loopback-only teaching server and inspect its responses.
  • Identify the request method, route, status, headers, and body.
  • Explain what an HTTP status proves and what it does not.

Understand the Idea

HTTP gives the browser and server a shared message structure. The client sends a method and target, with headers and sometimes a body. The server returns a status, headers, and possibly a body. A page may generate additional requests for icons or assets, so use the Network panel to select the exact request you intend to study. The request to /health in this exercise is deliberately small: it returns a JSON object that you can compare with the server's code.

The supplied server uses only Node's built-in HTTP module and binds explicitly to 127.0.0.1. It accepts GET requests, returns a health response for one route, and returns an error object elsewhere. It has no users, sessions, password handling, or note database. This narrow implementation lets you inspect transport and message behaviour without confusing it with the fictional permission rules introduced later. Keep the server code in the casebook so your observation has a defined implementation behind it.

Read status codes in context. Here 200 means the health route produced its intended successful response. It does not establish that anyone signed in. A 404 from /missing proves that this server responded to that route with a not-found result. A request may also fail before an HTTP response exists, which is different from receiving an error status. Compare the browser's actual evidence with these distinctions instead of reducing every outcome to working or broken.

Use the experiment to practise repeatability. Record the URL, method, status, content type, and body, then stop the server with Ctrl+C and observe how the browser's result changes on a fresh request. Restart it for subsequent work if needed. Your notes should distinguish a server response from a connection error and should mention that localhost HTTP is used for this limited exercise, not as a deployment recommendation.

WORKED EXAMPLE

A Tiny Server You Can Explain

Save this exact code as lab/server.mjs. From the casebook root, run node lab/server.mjs, then open http://127.0.0.1:8787/health.

javascript
import http from 'node:http';

http.createServer((req, res) => {
  res.setHeader('Content-Type', 'application/json; charset=utf-8');
  if (req.method !== 'GET') {
    res.writeHead(405, { Allow: 'GET' });
    return res.end(JSON.stringify({ error: 'Method not allowed' }));
  }
  if (req.url === '/health') {
    res.writeHead(200);
    return res.end(JSON.stringify({ service: 'StudyNotes teaching server', ok: true }));
  }
  res.writeHead(404);
  res.end(JSON.stringify({ error: 'Route not found' }));
}).listen(8787, '127.0.0.1', () => {
  console.log('Teaching server: http://127.0.0.1:8787/health');
});
  1. Content-Type describes the response body as JSON; JSON.stringify produces that body.
  2. The method check and route check are separate decisions. The teaching route succeeds only for GET /health.
  3. The listen address restricts this listener to IPv4 loopback. Ctrl+C in the running terminal stops this process.

Expected Result

GET /health returns status 200 and an ok:true JSON field. GET /missing returns status 404 and Route not found. Neither response represents an authentication event.

PROJECT STAGE 03 / 10

Record Two Responses and One Connection Failure

Builds on: Use the address and port documented in notes/network-map.txt.

  1. Create lab/server.mjs and start it from the casebook root.
  2. Open the browser's Network panel and request /health; save the method, route, status, content type, and body in evidence/http-observations.md.
  3. Request /missing and append the same fields for that response.
  4. Stop only your teaching server with Ctrl+C, make a fresh request, and record the browser's connection failure separately.
  5. Restart the server if desired and add a sentence explaining which observations came from HTTP responses and which did not.

Keep This Deliverable

lab/server.mjs and evidence/http-observations.md with three clearly separated outcomes.

Check Your Build

  • The two response records match the supplied server's behaviour.
  • The connection failure is not assigned an invented HTTP status.
  • The notes explicitly state that this server implements no authentication.

Common Mistakes and Fixes

An automatic favicon request is mistaken for the selected /health request.
Filter or select the exact route in DevTools and record its URL.
A 200 response is described as proof of a successful login.
State that the route returned successfully; authentication requires an explicit application event or other suitable evidence.

Check Your Understanding

Why is a connection-refused result different from the server returning 404?

Reveal the explanation

Connection refusal occurs before a usable HTTP response from that endpoint. A 404 is an HTTP response from a server that handled the request and reported the target resource unavailable.

Ready to Move On?

Your observations distinguish HTTP responses from connection failure and make no authentication claim.

Open the learning resource
04

Separate Identity from Permission

Define the fictional StudyNotes ownership rule and create its two-note fixture. Write down who may read each note before reviewing code. The permission matrix becomes the expected answer for the failing local lab and the later repair, with authenticated identity kept separate from resource ownership.

What You Will Learn

  • Turn a plain-language ownership rule into an explicit permission matrix.
  • Distinguish a known identity from permission to access a particular note.
  • Create the fictional fixture used by later local tests.

Understand the Idea

Authentication establishes an identity within a system. Authorization applies a rule to that identity, the requested action, and the particular resource. StudyNotes has two fictional learners: learner-a owns note-a and learner-b owns note-b. Our rule is deliberately small: an authenticated learner may read their own note, and nobody else may read it. There is no administrator exception in this exercise. Writing the rule before reviewing code prevents the implementation from silently becoming the definition of correct behaviour.

A permission matrix makes omissions visible. Put principals in rows and resources or actions in columns. Include the unauthenticated case, another ordinary user, and a missing resource. A UI may hide an inaccessible note, but the server-side decision still has to hold when someone requests that note directly. The request's claimed user ID cannot be trusted merely because it arrived in a form or URL. In our isolated code exercises the principal is a controlled test fixture; a real application must derive it from its verified authentication mechanism.

Keep identifiers and permissions separate. An unpredictable note ID can reduce casual guessing, but knowledge of an identifier is not a grant of access. Similarly, changing note-a to a longer name would not repair a missing ownership check. The useful question is whether the decision uses the relationship between the authenticated principal and the note. This distinction helps you evaluate a proposed fix on its actual enforcement rather than on how difficult the interface makes a forbidden action to discover.

Create the fixture now so later experiments share the same assumptions. The JSON below is invented data, not a backup of anyone's notes. Keep it in fixtures/notes.json and document what each field means. The titles make results easy to recognise without carrying private content. Treat the permission matrix as the expected answer against which a deliberately incomplete function and a later repaired function will be tested.

WORKED EXAMPLE

Two Notes and One Ownership Rule

Save the JSON as fixtures/notes.json. The policy table shown in the walkthrough belongs in notes/permissions.md, not in the JSON file.

json
[
  { "id": "note-a", "ownerId": "learner-a", "title": "HTTP Notes" },
  { "id": "note-b", "ownerId": "learner-b", "title": "CSS Notes" }
]
  1. For learner-a, reading note-a is allowed and reading note-b is denied.
  2. For learner-b, reading note-b is allowed and reading note-a is denied.
  3. An unauthenticated principal is denied both notes. A missing note produces no note data regardless of the principal.
  4. These are policy expectations, not observations from the teaching HTTP server, which does not implement note routes.

Expected Result

The fixture has two distinct owners and two distinct notes. The expected matrix has two allowed owner-note combinations and denies the other named combinations.

PROJECT STAGE 04 / 10

Write the Permission Contract

Builds on: Use the fictional scope and HTTP limits already recorded; the health server remains separate from this policy model.

  1. Create fixtures/notes.json with exactly the two supplied records.
  2. Create notes/permissions.md and define authenticated principal, ownerId, note ID, and read action.
  3. Write the allowed/denied matrix for learner-a, learner-b, and an unauthenticated caller against both notes.
  4. Add a missing-note case and state that no note data should be returned.
  5. Add a trust-boundary note: future real server code must obtain principal identity from verified authentication, not client-supplied ownerId.

Keep This Deliverable

fixtures/notes.json and notes/permissions.md containing a policy that can be tested.

Check Your Build

  • Every named caller-resource pair has an explicit expected outcome.
  • The policy does not depend on hiding UI controls or keeping an identifier secret.
  • Fixture data and real authentication claims are clearly distinguished.

Common Mistakes and Fixes

The rule says any signed-in user may read any note.
Compare that statement with the stated owner-only requirement and include the resource owner in the decision.
A submitted ownerId is accepted as authenticated identity.
Keep test fixtures controlled, and document that production identity must come from the application's verified session or token handling.

Check Your Understanding

Why does making note IDs harder to guess not replace an ownership check?

Reveal the explanation

A user may learn an identifier through another route. Authorization must still deny access when the authenticated principal is not permitted to read that particular note.

Ready to Move On?

Every caller-note pair has an explicit outcome, including anonymous and missing-resource cases.

Open the learning resource
05

Try a Guided Security Lab

Investigate a deliberately incomplete local function using the fixture and permission matrix you already created. Predict its output, run the supplied script, and record how another fictional user receives a note they do not own. This self-contained exercise needs no hosted lab, account, or public target.

What You Will Learn

  • Reproduce a missing ownership check inside a self-contained authorised code exercise.
  • Compare observed output with the permission contract.
  • Record a cause without claiming the health server has the same weakness.

Understand the Idea

This guided lab uses a deliberately incomplete local function, so every input, expected result, and observation is available to you. The code reads only the two fictional notes from your fixture. It checks whether a principal object exists, then returns the requested note without comparing ownership. That makes it a useful model of a common mistake: confusing logged in with permitted. You are not probing a remote service, and this exercise does not require a paid tool, an account, or a vulnerable application exposed to your network.

Before running the function, predict both results. learner-a requesting note-a should receive HTTP Notes. learner-b requesting note-a should receive no note under our written policy. The second result is the distinguishing case: a function can handle the ordinary owner request correctly while still violating the rule for another user. If you only test the happy path, this problem stays invisible. A deliberate negative test turns an abstract concern into evidence you can reproduce.

The example logs a small object showing the two return values. That output is evidence about this exact function and fixture. It is not evidence that a real person's account was compromised, that a database was accessed, or that the earlier teaching HTTP server exposes notes. Keep the scope visible in the notebook. Security reasoning is stronger when the claimed impact matches the environment actually tested rather than borrowing drama from a more complex system.

After the run, read the function again and identify the missing decision. Do not repair it yet; preserve the small failing example so the report and later regression test have a stable reference. If you also choose an online academy lab, keep its observations in a separate folder with its own authorised scope. This local case is already enough to practise hypothesis, test, result, and cause without importing someone else's walkthrough.

WORKED EXAMPLE

An Authenticated Caller Without an Ownership Check

Save this as lab/permission-lab.mjs. It depends only on fixtures/notes.json created in the previous lesson. Run node lab/permission-lab.mjs from the casebook root.

javascript
import fs from 'node:fs';
const notes = JSON.parse(fs.readFileSync(new URL('../fixtures/notes.json', import.meta.url), 'utf8'));

function readNote(noteId, principal) {
  if (!principal) return null;
  return notes.find((note) => note.id === noteId) ?? null;
}

console.log({
  owner: readNote('note-a', { id: 'learner-a' })?.title ?? null,
  otherUser: readNote('note-a', { id: 'learner-b' })?.title ?? null
});
  1. Both calls provide a principal object, so both pass the same authentication-shaped check.
  2. The lookup uses noteId but never compares principal.id with ownerId.
  3. The expected owner result and forbidden other-user result therefore both contain HTTP Notes.

Expected Result

The program prints owner: 'HTTP Notes' and otherUser: 'HTTP Notes'. The second value contradicts the owner-only matrix and demonstrates the local function's missing ownership decision.

PROJECT STAGE 05 / 10

Preserve a Reproducible Lab Finding

Builds on: Use fixtures/notes.json and the expected matrix in notes/permissions.md.

  1. Create lab/permission-lab.mjs without modifying the fixture or policy.
  2. Write your predicted owner and other-user results in evidence/permission-lab.md before running the script.
  3. Run the script and copy its actual output into that evidence file.
  4. Compare each result with the matrix and identify the exact missing check in the function.
  5. Add a scope sentence stating that this is an isolated function exercise, not a finding against the health server or any public website.

Keep This Deliverable

The unchanged failing lab plus evidence/permission-lab.md showing prediction, output, policy mismatch, and cause.

Check Your Build

  • The owner case works and the other-user case demonstrates the specific policy violation.
  • Another learner can reproduce the result using only the supplied fixture and command.
  • The evidence makes no unsupported claim about a deployed application.

Common Mistakes and Fixes

The failing code is immediately overwritten with a fix.
Keep this file as the baseline and implement a separate repaired file later so the before-and-after comparison remains reproducible.
A successful owner request is treated as sufficient testing.
Always include the other-user and unauthenticated cases from the policy matrix.

Check Your Understanding

Which line creates the security-relevant omission?

Reveal the explanation

The note lookup returns the matching record after only checking that a principal exists. No decision compares that principal's identity with the record's ownerId.

Ready to Move On?

Preserve the owner and other-user results, identify the missing ownership check, and limit the claim to this local function.

Open the learning resource
06

Explain a Finding and Its Fix

Turn the local permission-lab result into a finding a developer can reproduce. Connect the written policy, fixture, command, actual output, cause, and proposed repair. Keep the future retest marked pending and distinguish the observed fictional result from any conditional real-application impact.

What You Will Learn

  • Write a finding that connects expected behaviour, evidence, cause, and repair.
  • Keep impact proportional to the local exercise.
  • Define a retest that preserves the legitimate workflow.

Understand the Idea

A useful finding answers a developer's immediate questions: what rule should hold, what happened instead, how can I reproduce it, and what change would address the cause? Start with the policy rather than a dramatic title. In this case, the owner-only rule is written in notes/permissions.md, the two note records are defined, and a single command produces the mismatch. These links make the finding independently checkable. A screenshot of an unexplained result would provide much less help.

Separate the observed behaviour from its hypothetical consequence. You observed learner-b receiving note-a's title from a local function. In an application that exposed the same function to real users, the missing check could reveal another user's note. That conditional impact is meaningful, but it does not prove that any real service currently leaks data. State the distinction directly. A reader should not have to infer which sentences describe the lab and which describe a possible real-world consequence.

Recommend an ownership decision at the point that returns protected data, using the authenticated principal supplied by a trustworthy authentication mechanism. Do not propose simply hiding links or changing note IDs. Also avoid prescribing a complete authentication system when the demonstrated defect concerns a small authorization rule. A focused recommendation is easier to review and retest. Include how the legitimate owner action should continue to work, because a repair that returns nothing to everyone would satisfy a narrow denied-case test while breaking the feature.

Your report can remain a draft until the repair is implemented in a later lesson. Mark retest status as pending rather than describing future work as completed. Preserve the command, fixture, and original output references. This is also the moment to review language: confirmed should apply to reproduced behaviour, likely should describe a supported inference, and unknown should remain visible when the exercise contains no evidence. Precise wording is part of technical accuracy.

WORKED EXAMPLE

A Finding With a Verifiable Boundary

This is an original report template filled from the local exercise. Save and adapt it as notes/finding-001.md rather than copying claims that do not match your actual run.

text
Finding: Missing Owner Check in Local readNote Exercise
Scope: lab/permission-lab.mjs and fixtures/notes.json only.
Expected: learner-b cannot read note-a, which belongs to learner-a.
Observed: otherUser is 'HTTP Notes'.
Reproduce: node lab/permission-lab.mjs
Evidence: evidence/permission-lab.md
Cause: the function checks principal presence, but not note ownership.
Impact: this local function returns another fictional user's note.
Repair: require the authenticated principal to own the requested note.
Retest: owner allowed; other user denied; anonymous denied; missing note returns no data.
Retest status: pending.
  1. Expected behaviour cites the policy and names the exact forbidden pair.
  2. The observation records the actual returned value without turning it into a real-world incident claim.
  3. The repair targets the missing decision, while retest cases check both denied and legitimate actions.

Expected Result

A reader can reproduce the issue and understand the proposed repair from local files. The report does not claim that a fix has already been applied.

PROJECT STAGE 06 / 10

Draft the First Casebook Finding

Builds on: Use notes/permissions.md and evidence/permission-lab.md without altering their original observations.

  1. Create notes/finding-001.md using the structure in the example.
  2. Link the policy, fixture, command, and actual output by their relative casebook paths.
  3. Write a conditional real-application impact paragraph separately from the local observation.
  4. Add four retest cases covering owner, other user, anonymous caller, and missing note.
  5. Review every sentence and mark any unverified statement or pending work explicitly.

Keep This Deliverable

A one-page finding whose evidence and planned retest are traceable.

Check Your Build

  • The report's observed result matches the saved output.
  • The suggested repair enforces ownership rather than obscuring the resource.
  • Retest status remains pending until the later control exercise actually runs.

Common Mistakes and Fixes

The report says all user data was compromised.
Limit the observed impact to the supplied fictional records and describe broader consequences conditionally.
The recommendation denies every request.
Include an owner-allowed test so the repair must preserve the intended feature.

Check Your Understanding

Why include a positive owner test when the bug concerns forbidden access?

Reveal the explanation

The control must deny the forbidden action while preserving legitimate use. A deny-everything implementation would otherwise appear to pass an incomplete retest.

Ready to Move On?

The report matches saved output, proposes an ownership check, and preserves legitimate owner access in the retest plan.

Open the learning resource
07

Build an Evidence-Based Timeline

Add a new six-event synthetic dataset to the casebook. Learn to distinguish HTTP responses from explicit authentication decisions, preserve unknown user fields, and build a timeline with record IDs. These supplied records are a separate teaching artifact, not logs produced by the earlier health server.

What You Will Learn

  • Separate HTTP responses from explicit application events.
  • Build a timeline with known counts and visible limitations.
  • Preserve raw evidence while recording derived observations.

Understand the Idea

Logs are records produced by software, not a complete recording of reality. Their meaning depends on the event definitions, collection configuration, clock, and coverage. The sample below is fictional evidence supplied for this lesson; it was not emitted by the earlier teaching server. Some records describe an HTTP response, while others explicitly describe an authentication decision. Keep those types separate. A 200 response for /help is not a successful login, whereas an auth_success event is intended to record that application decision within this dataset's stated schema.

Every record includes an ID and a UTC clock time ending in Z. The IDs give your notes stable references, while the times allow chronological ordering within this fixture. All six records belong to one fictional day and one consistent clock; this teaching format is not sufficient for records spanning multiple days or crossing midnight. In a real investigation you would need complete timing information, clock quality and collection coverage before drawing conclusions. No amount of sorting repairs an undocumented clock assumption. Record the coverage interval and avoid treating the absence of an event as proof that it never occurred.

Count the records before interpreting the story. There are six valid events: three HTTP records, two failed-authentication records, and one successful-authentication record. learner-a has the two failures; learner-b has the explicit success. Nothing here establishes a later success for learner-a. The shared-looking sequence is designed to test whether you follow fields carefully rather than narrating every event as though it belongs to one person. A source address is contextual evidence, not a reliable personal identity by itself.

Build a timeline and a separate claim table. Each observation should cite IDs; each explanation should be labelled as a hypothesis. You may reasonably ask whether learner-a mistyped a password or encountered a broken client, but the sample does not decide. Preserve fixtures/events.jsonl exactly and put calculations in evidence/log-summary.md. This separation means a reviewer can rerun your reasoning against the same records instead of trusting a cleaned or silently edited version.

WORKED EXAMPLE

Six Events With Two Different Meanings

Save the following six lines as fixtures/events.jsonl. Each line is one complete JSON object. The application events and HTTP responses are intentionally distinct.

jsonl
{"id":"e01","time":"10:00:00Z","type":"http","method":"GET","path":"/health","status":200,"user":null}
{"id":"e02","time":"10:01:00Z","type":"auth_failed","user":"learner-a"}
{"id":"e03","time":"10:02:00Z","type":"auth_failed","user":"learner-a"}
{"id":"e04","time":"10:03:00Z","type":"http","method":"POST","path":"/login","status":429,"user":null}
{"id":"e05","time":"10:04:00Z","type":"http","method":"GET","path":"/help","status":200,"user":null}
{"id":"e06","time":"10:05:00Z","type":"auth_success","user":"learner-b"}
  1. e02 and e03 explicitly name learner-a and describe failed authentication.
  2. e04 records a rate-limited HTTP response, but its null user does not identify who sent the request.
  3. e05 is a successful help-page response, not a login event.
  4. e06 explicitly records success for learner-b, so it cannot be used as evidence that learner-a signed in.

Expected Result

The correct counts are six events, three HTTP records, two auth_failed events, and one auth_success event. The only recorded successful authentication belongs to learner-b.

PROJECT STAGE 07 / 10

Add a Timeline Without Inventing an Incident

Builds on: Continue the casebook's source-versus-observation convention; this dataset is a new synthetic artifact, separate from the permission lab.

  1. Create fixtures/events.jsonl with the exact six records.
  2. Create notes/log-schema.md defining id, UTC clock time, type, user, and the HTTP-only fields. State that all records belong to one fictional day.
  3. Manually count event types and write a chronological table in evidence/log-summary.md.
  4. Add three supported observations with event IDs and two plausible explanations labelled as hypotheses.
  5. State the interval covered and explain why the records do not establish learner-a's later login outcome.

Keep This Deliverable

The raw JSONL fixture, a schema note, and a source-linked timeline.

Check Your Build

  • Counts match the six supplied records.
  • The report does not turn a help-page 200 into a successful login.
  • Every factual observation names the supporting event IDs.

Common Mistakes and Fixes

All nearby events are attributed to the same learner.
Follow explicit user fields and preserve null as unknown instead of filling it from surrounding lines.
A missing event is described as proof it did not happen.
State the dataset's coverage and say that the event is not recorded in this sample.

Check Your Understanding

Does e06 prove learner-a recovered access after the failures?

Reveal the explanation

No. e06 names learner-b. The sample records no successful authentication event for learner-a and does not establish what happened outside its coverage.

Ready to Move On?

Count six events correctly and recognise that the only recorded authentication success belongs to learner-b.

Open the learning resource
08

Inspect a Small Packet Capture

Interpret the supplied text transcript of a loopback conversation. Identify transport setup, endpoint direction, and the HTTP request and response while recording what the excerpt cannot establish. This lesson is complete without a PCAP download, capture driver, or Wireshark installation; the transcript is explicitly synthetic.

What You Will Learn

  • Read a small decoded network transcript without needing a downloaded capture file.
  • Distinguish transport setup from HTTP application content.
  • State what a capture excerpt cannot establish.

Understand the Idea

A packet capture records traffic observed at a particular place and time. A packet analyser decodes that traffic into fields that help you inspect conversations. This lesson supplies a readable synthetic transcript, so you can practise interpretation without installing a driver or downloading an unknown capture. It is not a PCAP file and cannot be imported as one. If you later capture your own loopback traffic, record the interface and capture conditions separately; the resulting frame numbers and timestamps will differ.

The first three rows illustrate a TCP connection setup between a browser's temporary source port and the teaching server's destination port. Both addresses are 127.0.0.1 because the processes are on the same computer. A port number identifies the endpoint within this conversation; it does not prove which executable owns it unless you also inspect the local process state. The following rows show decoded HTTP content. Transport setup and an application response answer different questions, so keep them distinct in your notes.

The transcript is intentionally incomplete. Real captures may contain additional acknowledgements, retransmissions, connection closing, or data spread across several packets. One HTTP message is not guaranteed to fit into one frame, and the analyser may reconstruct it from a stream. Do not derive packet-loss rates or round-trip statistics from this teaching excerpt. It is enough to identify direction, endpoints, protocol stage, and the relationship between the request and response.

Visibility also depends on encryption and capture scope. This local HTTP example shows readable application content. A typical HTTPS capture without suitable decryption material does not expose the same plaintext, even though some connection metadata remains visible. Neither kind of capture automatically proves who operated the client or whether an account was authorised. Compare network evidence with application events only when a defensible correlation exists, rather than forcing the synthetic log fixture to be a recording of this separate transcript.

WORKED EXAMPLE

A Synthetic Loopback Conversation

Save this as fixtures/packet-transcript.txt. It is a teaching excerpt, not a real capture and not a PCAP file. Times are relative seconds and some packets are omitted.

text
No.  Time     Source                 Destination            Decoded Summary
1    0.000    127.0.0.1:53000         127.0.0.1:8787         TCP SYN
2    0.001    127.0.0.1:8787          127.0.0.1:53000        TCP SYN, ACK
3    0.002    127.0.0.1:53000         127.0.0.1:8787         TCP ACK
4    0.003    127.0.0.1:53000         127.0.0.1:8787         HTTP GET /health
5    0.004    127.0.0.1:8787          127.0.0.1:53000        HTTP 200; application/json

Decoded response body: {"service":"StudyNotes teaching server","ok":true}
Illustrative Wireshark display filter: tcp.port == 8787
  1. Rows 1-3 illustrate transport setup; the server's responses reverse the source and destination endpoints.
  2. Row 4 requests the same /health route used earlier; row 5 shows a successful HTTP response.
  3. The filter would select displayed TCP packets involving port 8787 in an actual loaded capture. It is not a shell command and cannot create a capture.

Expected Result

The excerpt supports a local connection and a health response. It does not establish authentication, total traffic volume, packet loss, or an actual observation made on your machine.

PROJECT STAGE 08 / 10

Add a Packet Interpretation Note

Builds on: Compare terminology with notes/network-map.txt and evidence/http-observations.md; keep the transcript's synthetic origin explicit.

  1. Create fixtures/packet-transcript.txt with the supplied text.
  2. Create evidence/packet-interpretation.md and label the browser-side and server-side endpoints.
  3. Explain rows 1-3 separately from rows 4-5.
  4. List three conclusions the excerpt supports and three it cannot support.
  5. Add a paragraph describing what would change if the application payload were encrypted, without claiming to have performed a capture.

Keep This Deliverable

A synthetic transcript and an interpretation note with explicit visibility limits.

Check Your Build

  • The file is never described as a measured capture or a PCAP.
  • The explanation distinguishes transport setup from the HTTP response.
  • No authentication or packet-loss conclusion is invented.

Common Mistakes and Fixes

A display filter is mistaken for a capture operation.
Explain that it selects which already available packets are shown; capturing and filtering are separate activities.
An HTTP response is assumed to equal exactly one network packet.
Allow for segmentation and stream reassembly; treat the example as a simplified decoded excerpt.

Check Your Understanding

Why can the same IP address appear on both sides with different ports?

Reveal the explanation

The browser and server are processes on the same machine using loopback. Their different ports distinguish the two communication endpoints in this local connection.

Ready to Move On?

Distinguish TCP setup from HTTP content and label the example as a synthetic transcript, not a measured capture.

Open the learning resource
09

Translate a Weakness into a Control

Repair the ownership omission in a separate local file while preserving the failing example. Reuse the same fixture and run five assertions covering legitimate owners, another user, an anonymous caller, and a missing note. Update the finding only after recording the actual retest result.

What You Will Learn

  • Implement the ownership decision missing from the local lab.
  • Test allowed, denied, anonymous, and missing-resource cases.
  • Connect a code change to evidence without claiming complete application security.

Understand the Idea

The earlier finding identified a precise defect: the local readNote function checked only whether a principal existed. A focused repair must use the relationship defined in the permission matrix. Look up the note, reject missing input or a missing note, compare the authenticated principal's ID with the owner, and return data only when the rule is satisfied. In this exercise the principal is a controlled fixture; the function does not perform real authentication, and its tests must not be presented as testing a session system.

Keep the failing lab file and create a separate repaired version. This preserves the evidence behind the finding and allows a reviewer to see what changed. The repaired code uses the same notes.json data, so a difference in results can be attributed to the decision rather than to a convenient change of fixture. Returning null is the small function's defined denied result. A real HTTP application would need an appropriate response policy and consistent error handling around it, which remain outside this isolated exercise.

Tests make the intended rule executable. The owner case prevents a deny-everything repair. The other-user case reproduces the original defect. The anonymous and missing-note cases check nearby boundaries. A second owner case helps reveal accidental hardcoding to learner-a or note-a. Assertions should check the observable result, not merely whether a particular line of code exists. If an assertion fails, read which requirement it represents before changing the code.

After the tests pass, update the finding with the actual command and result. Passing these cases establishes the stated local ownership behaviour for the supplied inputs, not the security of an entire service. There are no password, session, database, concurrency, or deployment checks here. Naming those limits makes your achievement precise: you took a documented rule, found a concrete omission, implemented a control, and produced a reproducible regression check.

WORKED EXAMPLE

An Owner Check With Five Assertions

Save this as lab/permission-control.mjs and run node lab/permission-control.mjs. It reuses fixtures/notes.json; leave permission-lab.mjs unchanged.

javascript
import fs from 'node:fs';
import assert from 'node:assert/strict';
const notes = JSON.parse(fs.readFileSync(new URL('../fixtures/notes.json', import.meta.url), 'utf8'));

function readNote(noteId, principal) {
  const note = notes.find((item) => item.id === noteId);
  if (!note || !principal || principal.id !== note.ownerId) return null;
  return note;
}

assert.equal(readNote('note-a', { id: 'learner-a' })?.title, 'HTTP Notes');
assert.equal(readNote('note-a', { id: 'learner-b' }), null);
assert.equal(readNote('note-a', null), null);
assert.equal(readNote('missing', { id: 'learner-a' }), null);
assert.equal(readNote('note-b', { id: 'learner-b' })?.title, 'CSS Notes');
console.log('PASS: five local ownership checks');
  1. The note and principal must both exist before the ownership comparison can permit a return.
  2. The tests cover two legitimate owner actions and three cases where note data must not be returned.
  3. An assertion failure stops the script with an error; the PASS message appears only after every listed assertion succeeds.

Expected Result

The script prints PASS: five local ownership checks. The original lab still demonstrates its failing other-user result, providing a clear before-and-after record.

PROJECT STAGE 09 / 10

Close the Finding With a Retest

Builds on: Use the policy, fixture, failing lab, and notes/finding-001.md from earlier lessons.

  1. Create lab/permission-control.mjs with the repaired function and assertions.
  2. Run it and save the complete result in evidence/control-retest.md.
  3. Run the unchanged failing lab again and compare its other-user output with the repaired result.
  4. Update notes/finding-001.md from retest pending to the actual verified local outcome, linking the new evidence.
  5. List the authentication and deployment behaviours this isolated test does not assess.

Keep This Deliverable

A repaired local function, executable checks, retest evidence, and an updated finding.

Check Your Build

  • All five assertions pass without changing the fixture or expected policy.
  • The failing example remains available for comparison.
  • The report's closure statement is limited to the tested local control.

Common Mistakes and Fixes

The repair returns null for every caller.
Keep both owner-allowed assertions so legitimate access remains part of the contract.
The result is advertised as a secure application.
Describe the exact tested function and inputs, and list the unimplemented authentication and service boundaries.

Check Your Understanding

Why keep a second owner test for learner-b and note-b?

Reveal the explanation

It checks that the implementation follows the general ownership relationship rather than accidentally allowing only the first hardcoded user or note.

Ready to Move On?

All five checks pass without changing the fixture, and the original failing script remains reproducible.

Open the learning resource
10

Assemble a Clear Defensive Portfolio

Finish the Local Security Casebook with an artifact index, reproduction commands, and a short reflection. Make the source of every item clear: authored policy, synthetic fixture, measured local output, or derived interpretation. Use an actual remaining gap to choose the next exercise.

What You Will Learn

  • Organise the cumulative work so another learner can reproduce it.
  • Distinguish original fixtures, observations, conclusions, and untested claims.
  • Choose a next learning goal from an actual gap in the casebook.

Understand the Idea

A portfolio is useful when it shows how you reached a conclusion. Your casebook now includes a policy, a deliberately failing function, an explanation of the defect, a repair, and a retest. It also contains separate exercises about HTTP, synthetic logs, and packet interpretation. The final step is to make those relationships easy to follow. An index should tell a reader which artifacts depend on which earlier files and which commands reproduce a result. A directory full of screenshots without context does not provide the same evidence.

Review provenance carefully. The six-event JSONL file and the packet transcript were invented for teaching; they are not actual evidence of an incident. The HTTP observations are results you recorded from your local server. The permission outputs come from the supplied isolated functions. Preserve these distinctions in the index and in each report. If a reader cannot tell whether something was observed, supplied, or hypothesised, improve the explanation before adding more tools or exercises.

Reproduce the essential work from a clean terminal. Confirm the fixture is present, run both permission scripts, and start the HTTP server only if you are repeating that part of the demonstration. Check that the README gives the right working directory and commands. Stop your own server when finished. Do not silently repair missing files while testing the instructions; record the documentation gap, fix the instructions, and try again. This is a practical way to test whether the casebook stands on its own.

Finish with an honest reflection. Name one mistaken assumption you corrected, one control you verified, and one question the current project cannot answer. A sensible next step might be a guided hosted lab, a real authentication tutorial, or inspecting an actual capture from your own environment. Choose based on the missing skill rather than the most impressive tool name. The casebook demonstrates a beginner investigation workflow; it does not certify professional competence or establish that a real application has been comprehensively assessed.

WORKED EXAMPLE

An Index That Makes the Work Reviewable

Use this outline in README.md and fill the result column with your actual status. Relative paths refer to the casebook root.

text
Artifact                         Purpose                       Evidence Type
notes/permissions.md             Owner-only contract           Authored policy
fixtures/notes.json              Two fictional notes           Synthetic fixture
lab/permission-lab.mjs           Reproduce missing check       Executable local exercise
notes/finding-001.md             Explain issue and repair      Evidence-based report
lab/permission-control.mjs       Verify ownership control      Executable local checks
fixtures/events.jsonl            Six teaching events           Synthetic fixture
evidence/log-summary.md         Counts and timeline           Derived analysis
fixtures/packet-transcript.txt   Explain network layers        Synthetic transcript

Reproduce permission result:
node lab/permission-lab.mjs
node lab/permission-control.mjs
  1. The evidence-type column prevents a synthetic example from being mistaken for a measured incident.
  2. The paired scripts expose both the original failure and the verified control.
  3. The index points to files rather than repeating all their contents, so corrections have one clear home.

Expected Result

A reviewer can trace the main finding from policy to fixture, observation, repair, and retest, and can recognise the independent learning exercises.

PROJECT STAGE 10 / 10

Finish the Local Security Casebook

Builds on: Bring together all previous files without replacing their original observations.

  1. Expand README.md with the artifact index, prerequisites, working directory, and exact reproduction commands.
  2. Create notes/reflection.md with one corrected assumption, one verified control, and one unresolved question.
  3. Check every filename referenced by the index and remove any claim about a test you did not perform.
  4. Run the two permission scripts from a fresh terminal and follow your own HTTP instructions if you include that demonstration.
  5. Write a next-step plan naming one specific learning gap and a bounded exercise to address it.

Keep This Deliverable

A self-contained casebook index, reproducible commands, scope statement, and reflection.

Check Your Build

  • A reader can follow the main evidence chain without asking where files came from.
  • Synthetic fixtures and measured local observations are labelled accurately.
  • The next learning goal follows a documented gap rather than a blanket claim of readiness.

Common Mistakes and Fixes

Tool names replace an explanation of the work.
Describe the question, input, method, result, and limit for each portfolio item.
A copied success message is retained after files change.
Rerun the named command and date the actual verification result; keep stale observations clearly labelled.

Check Your Understanding

What makes this casebook more useful than a list of completed tutorials?

Reveal the explanation

It preserves a reproducible chain from a stated rule through a failing example, evidence, a focused repair, and a retest, while clearly identifying the limits and origins of the material.

Ready to Move On?

A reader can trace the finding from policy to repair and distinguish synthetic material from performed observations.

Open the learning resource

Project References

HACKTRONIAN_CLI // COMMAND PALETTE
QUICK_EXEC: