learn-cyber-security-with-phoebe / Leader session 5 of 6
Learn Cyber Security with Phoebe · Leader session 5 of 6

Detect what you cannot prevent

Every prevention control on Ironwood's ladder closes a door somebody should not have been able to open. Two of the nine paths have no such door. A support agent reading a customer record to answer a ticket, and an analyst querying the table their job requires, are reads the business chose to allow, and no control removes them without stopping the work. Prevention runs out before the paths do. Tonight is about what covers the remainder: what a warehouse audit log genuinely sees, the one copy of the data it can never see, and why a log nobody reads is a dark path with a receipt.

🟠 Advanced Data and technology leaders 45 min
0-3 · Welcome 3-22 · What the audit log sees and misses 22-40 · Build-along: find your dark paths 40-45 · Q&A
Part 0

Where tonight sits in the leader track

Session 1 counted nine paths to Ironwood's customers table and marked two of them "cannot be closed". Sessions 2 to 4 spent their time on the seven that can be: the six functions, the kill chain, and the backups an attacker deletes on the way out. Tonight returns to the two that remain when every prevention control is on, and to a third that prevention removes but that teaches the most important lesson about where logs reach. Ironwood is still the estate: one warehouse, twelve tables, a customers table worth stealing, and a nightly extract of it sitting in a bucket that the warehouse has never heard of.

Live = presented in the 45 minutes Self-study = the full depth, after class 🔍 Every diagram zooms

★ What you walk out with tonight. The reason detection is a first-class control and not compliance decoration: at least two paths into every real estate are legitimate reads that prevention cannot touch. Two numbers from Ironwood's ladder: query logging and egress alerting leave the path count at 3 and take the undetected count from 3 to 0, and the over-correction "all prevention, no detection" ends with 1 path that nobody would see used. And a way of counting your own dark paths that takes an afternoon and no tools.

LiveWhy prevention runs out before the paths do3 min▶

A prevention control works by removing a way in that should not have existed: a password with no second factor, a key in a public repository, a bucket anyone can list. Each of those is a mistake, and mistakes can be corrected. But some paths to the crown jewels are not mistakes. The support team reads customer records because that is the job. The analyst queries the table because the dashboard needs it. These paths were designed in, on purpose, by people who understood what they were doing.

You can shrink them, with least privilege and row-level policies that show a support agent one customer at a time rather than the whole table. You cannot remove them, because a company that removes them has stopped serving customers. The finished Ironwood design reports one path, not zero, for exactly this reason, and a programme that reports zero has either stopped the work or stopped counting insiders.

Real world

Ironwood's security review rated the support tool's access to customers as "accepted risk, business requirement" and moved on. That was the correct rating and an incomplete sentence. The missing half was whether anyone would know if the access were used at three in the morning, by an account that normally handles nine tickets a day, to read eleven thousand records. The answer, before tonight's controls, was no.

Self-studyFive words for tonight3 min▶
  • Legitimate path - a route to the crown jewels that exists because the business decided it should. Cannot be prevented; can be logged and reviewed.
  • Audit log - the warehouse's own record of who ran which query against which object, when, and from where. Sees every read that passes through the warehouse and nothing that does not.
  • Egress - data leaving the estate: a copy to an external location, a share to another account, an extract written somewhere else. The second place to watch, because a read that stays inside is a smaller event than a read that leaves.
  • Dark path - a path to the crown jewels that crosses no log anyone reads. Either there is no log at all, as with Ironwood's export bucket, or there is a log and nobody looks at it, which is a dark path with a receipt.
  • Undetected - the second column on Ironwood's ladder: how many of the remaining paths are dark. Logging moves it from 3 to 0 while the path count stays at 3.
Part 1 · covers the two legitimate paths, what the audit log records and does not, and the canon 3 to 0

Two paths no control can close

10 min live

After MFA, key rotation, the private bucket and pinned dependencies, Ironwood has three paths left. One is the Friday admin grant, which least privilege will remove at the end. The other two are a support agent's own legitimate session and an analyst's own login, both reading customers because the business said they may. Those two are why detection exists.

start the logged edge the estate the prize unseen seen before logging: 3 paths, 3 unseen after logging: 3 paths, 0 unseen support agent, own session legitimate read, cannot be closed analyst, own login legitimate read, cannot be closed analyst, Friday admin grant privilege, closed later by least privilege query logging Warehouse customers what the log records: who ran which query against which object when, and from where what it cannot record: why they ran it anything that never touched the warehouse Logging changes nothing about the path count and everything about whether anyone would know.
🔍 Click to zoom - three paths remain after prevention; the logged edge turns all three from unseen to seen without closing any.
LiveWhy detection is a first-class control and not compliance decoration3 min▶

Most audit logging is switched on because a standard asks for it, kept because turning it off would raise a question, and read by nobody. That is logging as decoration, and it has the same effect on an attacker as a camera with no tape in it. The professional argument for detection is different and does not depend on any standard: for the paths that prevention cannot close, a log that somebody reads is the only control there is.

Put it on the ladder and the point is exact. Every prevention control on Ironwood's list has been applied and the path count is 3. Two of the three are legitimate reads. Adding query logging and egress alerting does not change the 3, and it is not supposed to. What it changes is the second column: undetected goes from 3 to 0. Before it, an attacker using any of the three paths finishes and nobody knows. After it, all three cross an edge that writes a record, and the record is the control.

Controls onPaths to customersUnseenRecoverable of 12
+ pinned, verified dependencies (all prevention so far)330
+ query logging and egress alerting300
+ immutable, restore-tested backups3012
+ least privilege on the analyst role1012
All prevention, no detection1112

The last row is the over-correction. Every prevention control on, the backups immutable, least privilege applied, and no logging: one path remains, and it is one path that nobody would see used. That is a complete prevention programme with a support agent's session as its blind spot, and it is what most well-funded estates look like.

LiveWhat a warehouse audit log genuinely records4 min▶

A warehouse query log is a better instrument than most leaders expect and a narrower one than most vendors imply. It records four things reliably, and understanding the four is what makes it possible to say what it can and cannot see.

  • Who. The user or service account that ran the query, and the role it was using. Not the person behind a shared account, which is one reason shared accounts are a finding in their own right.
  • What. The query text and the objects it touched: which tables, often which columns, and how many rows came back. Eleven thousand rows from customers by an account that normally returns one is visible here.
  • When. The timestamp, which is what makes three in the morning distinguishable from three in the afternoon, and a burst of two hundred reads distinguishable from a working day of nine.
  • From where. The network address and the client application. A support tool's account querying from a laptop rather than the support tool is a sentence a log can write and a person can read.

What it cannot record is intent. The log shows a support agent reading a record; it cannot show whether the ticket existed. Detection therefore works on shape, not motive: volume, time, source and object, compared to what that account normally does. And there is a second, larger gap. The warehouse log records what happened in the warehouse. Anything that never touched the warehouse is not a gap in the log; it is outside the log entirely, and Part 2 is about the path that lives there.

Real world

Once Ironwood's query log was being read, the first thing it showed was not an attacker. It was a dashboard refreshing the full customers table every five minutes because somebody had set a schedule and forgotten it. That was a cost finding, not a security one, and it paid for the logging work in a month. The second thing it showed, a fortnight later, was the support tool's account querying from an address that was not the support tool.

Self-studyShape, not motive: what a reviewer actually looks for3 min▶

Because the log cannot see why a query ran, detection on legitimate paths is a comparison between what an account did and what it normally does. Five shapes cover most of what matters, and none of them requires knowing anything about the person.

  • Volume. An account that returns tens of rows a day returning tens of thousands.
  • Time. Activity outside the account's own working pattern, not outside office hours in general, since analysts and pipelines keep odd hours legitimately.
  • Source. A service account authenticating from a new address or a new client, especially one that looks like a laptop.
  • Object. An account touching a crown-jewel table it has never touched before, or touching every column when it normally reads two.
  • Egress. Any read whose result leaves the warehouse: a copy to an external location, a share, an export. Part 2.

Turning these shapes into specific alert rules against specific attacker techniques is detection engineering, which is builder session 7. What a leader needs is the list of shapes, the knowledge that a warehouse log can express all five, and a named person whose job it is to look.

Part 2 · covers the export bucket blind spot, egress alerting, and why a log nobody reads is a dark path with a receipt

The blind spot that is not in the warehouse

9 min live

Ironwood's nightly extract of the customers table sits in a bucket that anyone with the address could read. The path from the internet to the customer data is two hops long and never touches the warehouse. Every warehouse control, including the logging from Part 1, has no effect on it, and that fact generalises to every copy of the crown jewels that lives anywhere else.

warehouse · every control it has MFA on every human login no effect least privilege on roles no effect service key rotation no effect pinned dependencies no effect query logging no effect row and column policies no effect all of these live inside the box; the path below never enters it customers nightly extract writes the copy Internet public export bucket customers extract, a copy never touches the warehouse two hops, no login, no warehouse log own lock, own access log Six warehouse controls, zero effect. The copy needs its own lock and its own log.
🔍 Click to zoom - the export bucket path runs beside the warehouse and never enters it, so nothing the warehouse does can see it.
LiveThe export bucket: a path the warehouse will never see3 min▶

Somebody at Ironwood set up a nightly job that writes the customers table to an object bucket so a marketing agency's tool could collect it weekly. The bucket was made readable so the tool would work. From that moment there were two copies of the crown jewels, and only one of them was inside anything the security programme looked at.

Walk the warehouse's controls down the list and every one of them comes back with the same answer. MFA protects logins; the bucket has no login. Least privilege shapes roles; the bucket has no roles. Query logging records queries; reading a file from a bucket is not a query and produces no row in the warehouse log. Row and column policies mask what a query returns; the extract was written before any of them applied. The path is two hops from the internet to the customer data, and it never enters the box where the controls are.

Making the bucket private is the prevention control, and on the ladder it takes Ironwood from 5 paths to 4. The detection lesson is separate and survives the fix: even a private bucket is a copy of the crown jewels outside the warehouse, and it needs its own access log, read by somebody, or its use is invisible by construction.

LiveThe general rule: every copy outside the warehouse needs its own log2 min▶

The export bucket is the sharp example of a rule that applies to every export, share, replica, extract and backup: a control on the original does nothing for the copy, and a log on the original records nothing that happens to the copy. Each copy of a crown-jewel table gets its own row in the inventory, its own lock, and its own log with a named reader. The reason is not tidiness; it is that the copy is exactly where an attacker goes when the original is well defended, because it is the same data with fewer doors and no camera.

Real world

Ironwood's inventory found the marketing bucket in about ten minutes, by asking one question of each team: where else does a copy of this table live? The answers also turned up a BI tool's extract cache, a partner share set up for a pilot two years earlier, and the backup. Four copies, one log between them, and the log belonged to the original.

LiveEgress: the second place to watch2 min▶

A read that stays inside the warehouse is an event. A read whose result leaves is a bigger one, and it has a distinct signature: a COPY to an external location, a share created to another account, an unload to a stage nobody has used before. Egress alerting watches for that moment, because it is the moment data stops being under any of your controls and starts being somebody else's file.

The honest framing is visible, not blocked. An estate that blocks every external copy stops its own pipelines, so egress alerting is a record and an alert, not a wall. It is also the reason the ladder's rung is called query logging and egress alerting: the query log sees the read, the egress alert sees the read that left, and the two together are what take the undetected count to 0.

LiveThe honest limit: a log nobody reads is a dark path with a receipt2 min▶

Everything in Part 1 assumed that when the log writes a record, somebody sees it. Nothing about a log makes that true. A log that is switched on and never read leaves the attacker's path exactly as dark as before, with the one difference that after the incident there will be a very complete account of how it happened. That is a dark path with a receipt, and it is the most common state of audit logging in mid-size companies.

Detection is therefore three things, and the log is only the first. The second is a rota: a named person, on a stated cadence, whose job includes reading the alerts and the summary of the log. The third is a review: a periodic check that the rules still match the estate, because tables get added, accounts change and last year's alert for the support tool fires on the wrong account this year. Designing rotas, on-call load and review cadence is a discipline in its own right, and the reliability course covers it at length. What matters here is that detection has a headcount line as well as a tooling line, and a programme that funds only the second has bought receipts.

Self-studyWhere the copies hide, and the log each one needs3 min▶
Copy of the crown jewelsWho usually made itWhat sees it being used
Export to an object bucket for a partner or agencyWhoever unblocked the partnerThe bucket's own access log, nothing in the warehouse
BI tool extract cacheThe BI tool, by defaultThe BI tool's own audit log, if it has one
Share to another warehouse accountA pilot that ended and was never closedThe share's access history on the provider side
Replica in an operational systemAn integration teamThat system's log, owned by a different team
The backup itselfThe platform teamThe backup account's access log; a read of a backup is an exfiltration too

Every row has a different log, owned by a different team, in a different format. That is the real cost of copies, and the reason the number of copies is a security metric before it is a storage one.

Build-along

Find your dark paths

★ 18 min · everyone builds

No tools and no access to anything. A sheet of paper, one crown-jewel table, and four questions to put to whoever runs your warehouse and whoever owns the systems around it. If you have no estate to hand, use Ironwood's and check your count against its state before logging: three legitimate or remaining paths, all dark, plus a bucket nobody had listed.

List every read of your crown-jewel table that is legitimate and cannot be prevented. Support tools, analyst roles, dashboards, pipelines that feed other systems. Name the account each one uses. These are the paths that will still be on your count when every prevention control is on, and they are the ones detection exists for.

For each, check whether it is logged and who reads the log. Two separate questions. "Is query logging on" is usually yes. "Who looked at it last week, and what were they looking for" is usually silence. A path with a log and no reader goes on the sheet as dark, with a note that the receipt exists.

List every copy of the table outside the warehouse, and whether it has any log at all. Ask each team one question: where else does a copy of this table live? Exports, shares, extract caches, replicas, the backup. For each copy write down which log would show it being read, and who owns that log. Ironwood found four copies and one log.

Count your dark paths. Every legitimate read with no reader, plus every copy with no log, is one dark path. Write the number next to your path count from session 1. Ironwood before tonight's controls: 3 paths, 3 dark, and a bucket that was not on the count at all. The target is the same number of paths and a zero in the second column.

✗ The audit answer that is true and sees nothing Query logging is enabled on the warehouse and retained for 90 days in line with policy.
★ The same estate, answered as paths and readers Legitimate reads of customers that cannot be prevented: 2 (support tool account, analyst role). Both logged; alerts reviewed weekly by the platform on-call, last review 3 September 2026. Copies of customers outside the warehouse: 4. With their own access log and a named reader: 1. Dark paths today: 3. Target next quarter: 0.

Ask for the reader, not the log. The most useful sentence a leader can put to a security team is "who read the customers log last week, and what did they look for". If the answer is a name and a shape, detection is real. If the answer is a retention period, it is decoration.

Homework

Before session 6

30 min
  1. Put the four build-along questions to whoever runs your warehouse and to the owners of every copy you found, in writing, and keep the replies. Every "it is logged" that is not followed by a name is a dark path with a receipt.
  2. Find out which account your support tool uses to read customer records, and what a normal day looks like for it: how many reads, from which address, at which hours. That baseline is what a reviewer compares against, and it costs nothing to write down.
  3. Count your copies of the crown jewels outside the warehouse and put the number next to Ironwood's four. Then count how many have a log with a named reader.
  4. Write your dark-path count as one line under the three numbers from session 1. A programme that can state paths, unseen and recoverable has a complete answer for session 6, where the first hour of an incident begins with exactly those numbers.
Check yourself

Three questions

A support agent's own legitimate session reads the customers table. Which control removes that path?

The read exists because the business decided it should. MFA protects the login from outsiders and least privilege can narrow the read, but neither removes a path the job requires. Detection is the only control left, which is why the finished Ironwood design reports one path, logged.

Ironwood switches on full query logging for the customers table. What does that do to the export bucket path?

The extract job's write may appear in the log, but the attacker's read of the bucket is not a warehouse query and produces no record there. Every copy of the crown jewels outside the warehouse needs its own lock and its own log, and nothing inside the warehouse can substitute.

On Ironwood's ladder, what does the state "all prevention, no detection" look like, and what does adding query logging and egress alerting change on the way to it?

Logging never changes the path count; it changes whether anyone would know. With every prevention control on and no logging, one path remains and nobody would see it used: the support session, a complete prevention programme's blind spot.

Sources covered

What tonight maps to

✓ What the warehouse audit log sees and misses Who, what, when, from where; not why, and nothing that never touched the warehouse. Detection on legitimate paths as shape, not motive.
✓ The export bucket blind spot A copy of the crown jewels outside the warehouse, invisible to every warehouse control. The general rule: every copy needs its own lock, its own log and a named reader.
✓ Undetected 3 to 0, and the all-prevention over-correction Query logging and egress alerting leave paths at 3 and take unseen to 0; all prevention with no detection ends at 1 path, 1 unseen.
◐ Egress logs and external copies Named as the second place to watch, visible not blocked. Reading query history and egress logs for exfiltration is builder session 5.
◐ Detection engineering The five shapes a reviewer looks for. Turning attacker techniques into specific log rules is builder session 7.
◐ Rotas, on-call load and review cadence Named as the headcount half of detection. Designed properly in the reliability course.
· Detecting data defects Not covered by design. Freshness, volume and schema monitoring belong to the data observability course; tonight's logs watch for attacker behaviour, not broken pipelines.
· Attacking models, prompts and agents Not covered by design. Model-side threats belong to the AI red-team course; this is the estate underneath.

Session 5 cheat sheet

Prevention runs out firstTwo of Ironwood's paths are reads the business chose to allow. No control removes them without stopping the work.
3 paths, 3 to 0 unseenQuery logging and egress alerting leave the path count at 3 and take undetected from 3 to 0.
All prevention, no detectionEnds at 1 path, 1 unseen. A complete prevention programme with a support session as its blind spot.
What the log seesWho, what, when, from where. Not why. Detection on legitimate paths is shape against baseline, not motive.
What the log cannot seeAnything that never touched the warehouse. The export bucket path is outside the log, not a gap in it.
Every copy, its own logExports, shares, extract caches, replicas, the backup. Own lock, own log, named reader. Ironwood: four copies, one log.
Egress, visible not blockedA copy to an external location is the moment data leaves. Alert on it; do not wall it, or the pipelines stop.
A log nobody readsIs a dark path with a receipt. Detection is a log, a rota and a review, and it has a headcount line.