Chapter 4 — Cybersecurity: guided lab and applied synthesis
Lesson map
Lesson 04 published. Map, example, EX016.
flowchart TD
A["Synthetic action"] --> B{"Named in the written rule?"}
B -->|No| U["UNKNOWN"]
B -->|Yes| C{"Which action?"}
C -->|open-live-site| S["STOP"]
C -->|export-contacts| O["OUT OF SCOPE"]
C -->|confirm-from-printout| D{"Created after 09:00?"}
D -->|Yes| R["REFUSE"]
D -->|No| L["ALLOW"]
C -->|mark-pending| L
The diagram classifies one invented action. It does not describe a real library, and ALLOW is not proof that a room is free.
Logical drawing
written rule + synthetic row
|
+-- open live site --------> STOP
+-- export contacts -------> OUT OF SCOPE
+-- confirm from 09:00 paper
| |
| +-- later booking exists --> REFUSE
| +-- no later booking -----> ALLOW
+-- mark pending ----------> ALLOW
+-- anything else ---------> UNKNOWN
Learning outcomes
After this chapter, you should be able to:
- Apply a written rule to a synthetic staff action and name the verdict the rule produces.
- Separate a classification of a recorded proposal from a decision that the real service is safe.
- Explain why ALLOW, REFUSE, OUT OF SCOPE and STOP answer different questions.
- State one fact the offline script cannot know.
- Write a short dossier that keeps the observation, the decision and the limit in separate sentences.
4.1 Four verdicts, one written rule
Chapters 1–3 left a front-desk worker with a 09:00 paper schedule, two invented bookings, and a rule: do not confirm a later room from that paper, do not open a live site, and do not pull the event-contact list into the booking exercise. Chapter 4 turns that rule into a check a second person can rerun.
The check uses four verdicts. They are labels for this exercise, not a severity scale.
| Verdict | Question it answers | What it does not answer |
|---|---|---|
| STOP | Did this action leave the paper exercise? | Whether a real site is under attack |
| OUT OF SCOPE | Is this data set outside the booking decision? | Whether the contact list is well protected |
| REFUSE | Does the 09:00 snapshot omit a later booking for that room and start? | Why the booking page was unavailable |
| ALLOW | Does the written rule permit this recorded action? | Whether Room 2 is actually free |
| UNKNOWN | Is the action missing from the rule set? | What the owner would decide after being asked |
A number such as 7.4 would hide which of these questions changed. This chapter does not score the library.
4.2 The script reads the exercise assumption
The lab below is standard-library Python. It encodes three assumptions already fixed in this book: the printout time is 09:00, SYN-002 was created at 10:05 for Room 2 at 15:00, and event contacts are outside the booking path. It does not read the Chapter 3 owner report of an 11:40 offline sheet. That report is still unverified, so the script must not treat it as a newer printout.
REFUSE fires only when a confirm-from-printout action names a room and start whose booking was created after 09:00. ALLOW on mark-pending means the rule accepts a pending queue. ALLOW on a confirmation means only that no later booking in this tiny table matches that room and start. A different room can therefore print ALLOW while remaining unknown in the real building.
4.3 Worked example: four actions
Use the same rows the script uses.
| Time | Action | Why the rule speaks | Verdict |
|---|---|---|---|
| 11:42 | Confirm Room 2 at 15:00 from the paper | SYN-002 was created at 10:05, after the printout |
REFUSE |
| 11:43 | Export event contacts | Announcement contacts are not the booking decision | OUT OF SCOPE |
| 11:44 | Open the live booking site | The brief forbids production systems | STOP |
| 11:45 | Mark the 15:00 request pending | The fallback rule allows a pending queue | ALLOW |
The 11:44 line classifies a recorded proposal. It does not by itself halt a classroom. In a live rehearsal the owner still pauses the people, as Chapter 2 required. The script keeps going so the other three rows stay visible. That difference is a limit of the program, not a softer stop condition.
4.4 Lab: classify the synthetic log
Save this program as lab_dossier.py and run it with python3 lab_dossier.py. Do not point it at a network, a library website, or a file of real patrons. The expected output is fixed for these rows. If your output differs, the rule you ran is not the rule in this chapter.
"""Harbor Library tabletop dossier. Synthetic records only."""
PRINTOUT = "09:00"
BOOKINGS = [
{"id": "SYN-001", "room": "Room 2", "start": "14:00", "created": "08:20", "status": "confirmed"},
{"id": "SYN-002", "room": "Room 2", "start": "15:00", "created": "10:05", "status": "confirmed"},
]
ACTIONS = [
{"time": "11:42", "action": "confirm-from-printout", "room": "Room 2", "start": "15:00"},
{"time": "11:43", "action": "export-contacts"},
{"time": "11:44", "action": "open-live-site"},
{"time": "11:45", "action": "mark-pending", "room": "Room 2", "start": "15:00"},
]
def minutes(clock):
hour, minute = clock.split(":")
return int(hour) * 60 + int(minute)
def decide(action):
kind = action["action"]
if kind == "open-live-site":
return "STOP", "live site is outside the paper exercise"
if kind == "export-contacts":
return "OUT OF SCOPE", "event contacts are outside the booking decision"
if kind == "confirm-from-printout":
later = [
booking["id"]
for booking in BOOKINGS
if booking["room"] == action["room"]
and booking["start"] == action["start"]
and minutes(booking["created"]) > minutes(PRINTOUT)
]
if later:
return "REFUSE", "printout 09:00 omits " + ",".join(later)
return "ALLOW", "no later booking is recorded for that room and start"
if kind == "mark-pending":
return "ALLOW", "pending until an approved current source"
return "UNKNOWN", "the written rule set does not name this action"
def main():
print("printout: 09:00; bookings: 2")
omitted = [booking["id"] for booking in BOOKINGS if minutes(booking["created"]) > minutes(PRINTOUT)]
print("omitted by printout: " + ",".join(omitted))
counts = {"STOP": 0, "OUT OF SCOPE": 0, "REFUSE": 0, "ALLOW": 0, "UNKNOWN": 0}
for action in ACTIONS:
verdict, reason = decide(action)
counts[verdict] += 1
print(f"{action['time']} {action['action']}: {verdict}; {reason}")
print(
"STOP {STOP}; OUT OF SCOPE {OUT OF SCOPE}; REFUSE {REFUSE}; ALLOW {ALLOW}; UNKNOWN {UNKNOWN}".format(
**counts
)
)
if __name__ == "__main__":
main()
Exact output, checked with Python 3:
printout: 09:00; bookings: 2
omitted by printout: SYN-002
11:42 confirm-from-printout: REFUSE; printout 09:00 omits SYN-002
11:43 export-contacts: OUT OF SCOPE; event contacts are outside the booking decision
11:44 open-live-site: STOP; live site is outside the paper exercise
11:45 mark-pending: ALLOW; pending until an approved current source
STOP 1; OUT OF SCOPE 1; REFUSE 1; ALLOW 1; UNKNOWN 0
The count line is a tally of these four rows. It is not a risk rating. Changing the 11:42 room to Room 4, which does not appear in BOOKINGS, makes that row ALLOW. The new ALLOW means the table has no later booking for Room 4 at 15:00. It does not mean a resident may have the room.
4.5 A dossier uses only what the run showed
Write six short sentences and stop. Sentence 1 names the exercise and the 09:00 assumption. Sentence 2 quotes one output line. Sentence 3 states the decision that line supports. Sentence 4 names a verdict that must not be merged with it: exporting contacts is OUT OF SCOPE, not REFUSE, because the contact list was never a booking-time comparison. Sentence 5 says the script did not inspect a reservation store and did not accept the unverified 11:40 report. Sentence 6 names the owner question that is still open: which approved source, if any, may replace the 09:00 paper.
If sentence 5 is blank, the note is not ready to guide a procedure change. A blank limit lets a reader treat a classroom tally as a finding about Harbor Library's real systems, which this book does not have.
Chapter 4 summary
A written rule can classify a synthetic action the same way twice. STOP, OUT OF SCOPE, REFUSE, ALLOW and UNKNOWN answer different questions. The program's ALLOW is permission under the rows it was given, not evidence that a room is free or that a reported 11:40 sheet exists. The dossier keeps the output, the decision and the limit apart.
Chapter 4 exercises
Use the program and output in Section 4.4. Do not contact a real library. Worked results are in the appendix.
EX016 — Read the tally
- Objective: Tie one verdict to the row that produced it.
- Input: The exact lab output in Section 4.4.
- Safe condition: Do not add bookings or open a website.
- Task: Name the action that received REFUSE, the booking id the reason cites, and the assumption that makes that id absent from the paper.
- Expected evidence: Three items, each taken from the output or the stated 09:00 snapshot.
- Rubric: Credit only if the action is the 11:42 confirmation, the id is
SYN-002, and the assumption is the 09:00 printout rather than an inferred attack.
EX017 — ALLOW is not availability
- Objective: Limit what a matching rule is allowed to mean.
- Input: Change only the 11:42 action so the room is Room 4 and the start remains 15:00. Leave every other row as printed.
- Safe condition: Edit the synthetic table on paper or in a local copy. Do not query a live system.
- Task: State the new verdict for 11:42 and write the sentence a staff member must not say to a resident.
- Expected evidence: The verdict plus one prohibited claim.
- Rubric: Credit for ALLOW together with a refusal to promise Room 4. An answer that calls the room free fails.
EX018 — Do not merge the verdicts
- Objective: Keep a data-set boundary distinct from a stale-paper comparison.
- Input: The 11:43 output line.
- Safe condition: Reason from that line only.
- Task: Explain why the export is OUT OF SCOPE rather than REFUSE, and name one fact about contact-list protection that this run does not provide.
- Expected evidence: A distinction and one explicit unknown.
- Rubric: Credit when REFUSE stays attached to the printout comparison and the contact list remains unmeasured.
EX019 — Script stop versus human stop
- Objective: Notice that a classified row is not the same act as pausing people.
- Input: The 11:44 STOP line and the Chapter 2 rule that a live-site proposal pauses the exercise.
- Safe condition: Do not open a site to illustrate the point.
- Task: Say what the program did after printing STOP, what a facilitator should do with the participants, and why those two actions differ.
- Expected evidence: Three sentences.
- Rubric: Credit if the program continues through 11:45 while the facilitator pauses the people and asks the owner.
EX020 — Six-sentence dossier
- Objective: Report the run without enlarging it.
- Input: Section 4.5 and the lab output.
- Safe condition: Invent no outage cause, no patron, and no second system.
- Task: Write the six sentences. Leave sentence 5 concrete. Do not assign a numeric score.
- Expected evidence: Six sentences a classmate can check against the output.
- Rubric: Credit when each sentence stays inside the run, the 11:43 line is not redescribed as REFUSE, and the 11:40 report is still unverified.
Continue studying — chapter 04 of 20
← Chapter 03 · Course chapter index · Chapter 05 →
Continue to the next authored lesson.