<a id="ch-13"></a>

## Chapter 13 — The allowlist stops email and still counts tag

<!-- open-cyber-academy:lesson-figures:start ch-13 -->
### Lesson map

Lesson 13. Map, example, EX059.

```mermaid
flowchart TD
  P["Parse calls the same way as a non-none mode"] --> F["Keep a call only if it is in ALLOWED"]
  F --> E["email is dropped, so exfil is 0"]
  F --> T["tag remains, so any_injected is 3"]
```

The zero is padded. The three is the tag count.

### Logical drawing

```text
ALLOWED = {"summarise", "tag"}
defence=allowlist exfil_calls= 0/20 any_injected_call= 3/20 benign_calls=0/20
```
<!-- open-cyber-academy:lesson-figures:end ch-13 -->

### Learning outcomes

After this chapter, you should be able to:

1. Name the two strings in `ALLOWED`.
2. Explain a zero exfil count beside a three in the other column.
3. Read the leading space before that zero as width 2.

### 13.1 Filtering happens after the parse, and email is not in the set.

`ALLOWED` holds `summarise` and `tag`. Nothing else. Allowlist does not take the none-only branch, so the seven spaced memo rows never become calls. It also does not take keyword's early return, so the three note rows are parsed. Each note contributes the call `tag`. The ten invoice rows contribute `email`, and the list comprehension then drops every call that is not in the set. Email goes. Tag stays.

`exfil_calls` counts remaining calls equal to `email`. That count is 0. `any_injected_call` counts injected rows that still have any call. The three tag rows remain, so the column is 3. Both numbers are formatted with width 2. A zero therefore prints as a space and then `0`, which is the ` 0/20` in the line. The three prints as a space and then `3`.

`summarise` is in the set and is never produced by this corpus, so it does not move either counter. Benign rows still produce no call.

| Call | In the set? | Effect on this line |
|---|---|---|
| email | No | exfil stays 0 |
| tag | Yes | three rows remain |
| summarise | Yes | Unused by these rows |

### 13.2 Worked example

| Reading of the allowlist line | Decision |
|---|---|
| "Email was removed, so the exfil column is zero." | Keep |
| "Tag survived, so any_injected_call is 3." | Keep |
| "The space before 0 is a formatting width." | Keep |
| "Zero means the parser saw no verbs at all." | Refuse; tag was seen and kept |

> **Synthetic case.** Allowing tag is a property of this set. It is not a firm policy for InboxAide.

### Errors and limits

A zero in the email column can hide a non-zero call column. Both numbers have to be read.

### Apply

- **EX059 — Tag remains.** Why does the allowlist line show exfil 0 and any_injected_call 3, with a leading space on the zero? *Rubric:* 3 = email is not in ALLOWED and tag is; three note rows remain; width 2 pads the zero;; 2 = the set and the two counts;; 1 = "tag is allowed";; 0 = reads the zero as "no calls".

<!-- open-cyber-academy:chapter-navigation:start ch-13 -->
### Continue studying — lesson 13 (chapter 13 of 20)

[← Chapter 12](#ch-12) · [Course chapter index](../SUBJECTS.md) · [Chapter 14 →](#ch-14)

Continue to the next authored lesson.
<!-- open-cyber-academy:chapter-navigation:end -->

## Worked answers

<a id="answer-ex059"></a>
**EX059.** ALLOWED holds summarise and tag. Email is removed, so exfil_calls is 0. Tag is kept on the three note rows, so any_injected_call is 3. Width 2 prints the zero as a leading space. The zero does not mean the parser saw no verb.
