Basic

Auditing which inputs reach the model

Security work starts with a list, not a fix. Every input that can reach the model is written down with where it comes from. A system with an unknown input is a system that is already leaking.

What you will see

One. A fetched input is treated as user text, whatever it looks like.

About 1 min of reading

Try It

List every input that reaches the model

1

Write the table

printf 'input | source | owner\nquestion | typed | me\ndoc | uploaded | me\npage | fetched | bot\n' > /tmp/inputs.txt; wc -l < /tmp/inputs.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
Four lines, one header. Three inputs is a small enough list to defend.
2

Find the input with no owner

awk -F' \| ' 'NR>1 && $3=="" {print $1}' /tmp/inputs.txt; echo none

Before you run it, say out loud what it will print. Then open the answer.

What it prints
none. An empty owner column is a gap that must be filled before any fix.
3

Mark the input the model reads on your behalf

grep -c 'fetched' /tmp/inputs.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
One. A fetched input is treated as user text, whatever it looks like.

Data Flow

A system to an input table
1 The request path is traced
↓
2 Every merge point is marked
↓
3 Each point gets a source and an owner
↓
4 The table is kept next to the code
Why this works
Why the audit is done before a fix

Fixing one input while another is unknown moves the leak instead of removing it. The list has to be complete first.

What the audit produces

A table of inputs, sources, and owners. That table is the thing the next lesson in this tier is written against.

Examples

The list is short on purpose

Most systems have four to eight inputs. If the list has thirty, something is being fetched that nobody decided to fetch.

Retrieved text is an input

Anything the system reads on behalf of a user is user text. Retrieval is the input most audits forget.

The audit names the owner

Each input gets the person who added it. An input with no owner is an input nobody can defend later.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← Asking for structure instead of prose
Previous Lesson
Asking for structure instead of prose
Next Lesson
The defence stack, in order
The defence stack, in order →