What does Zero Trust for a One-Commander Empire conclude, in numbers, about “Anti-Scraper Defence: Token Buckets and Trap Pages”?
Answer: With ten canaries, a leaked copy of 1,000 records contains at least one with probability 0.0956; a copy of 10,000, 0.6513; a copy of 50,000, 0.9990. With fifty canaries, a copy of 1,000 records gives 0.3951 and a copy of 10,000 gives 0.9949. With two hundred canaries, a copy of 1,000 records gives 0.8663. For a copy of 1,000 records to contain at least one canary with probability 0.95, 298 canaries are needed, and such a copy holds on average 2.980 of them.
Scope of the numbers: The book is defensive only and describes no attack, intrusion, bypass or evasion technique; all hosts, domains and tokens are synthetic, parameters are illustrative, and all calculations are generated by its programs. It is general business analysis, not a security audit or legal advice, and any production change requires human review and sign-off.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.0956, 0.3951, 0.6513, 0.8663, 0.95, 0.9949
| trap pages h | fetch 50 | fetch 500 | fetch 2,500 |
| 5 | 0.0490 | 0.4096 | 0.9688 |
| 20 | 0.1824 | 0.8789 | 1.0000 |
| 50 | 0.3965 | 0.9950 | 1.0000 |
| people: 2,000 sessions a day x e = 0.0005 -> 1.0 touches a day | |||
| P(some person touches a trap in a day) = 0.6322 | |||
| canaries c | copy 1,000 | copy 10,000 | copy 50,000 |
| 10 | 0.0956 | 0.6513 | 0.9990 |
| 50 | 0.3951 | 0.9949 | 1.0000 |
| 200 | 0.8663 | 1.0000 | 1.0000 |
| canaries needed so a 1,000-row copy shows one with 0.95: 298 | |||
| expected canaries in that copy: 2.980 |
Key formula
Show the full program
# Chapter 5. p52: trap links and canary records, exact detection odds.
# A site has N pages; h of them are trap pages that no visible link,
# sitemap or menu leads to and that the robots rules exclude. A client
# that fetches n distinct pages at random hits at least one trap with
# P = 1 - C(N - h, n) / C(N, n) = 1 - prod_{i<h} (N - n - i) / (N - i).
# A data set of M records carries c canary records, fake rows unique to
# one account key. A copy of k records found elsewhere holds at least one
# canary with the same formula. People can touch a trap by accident (for
# example through assistive software): rate e per session, illustrative.
import math
def p_hit(total, marked, drawn):
if drawn > total - marked:
return 1.0
miss = 1.0
for i in range(marked):
miss = miss * (total - drawn - i) / (total - i)
return 1.0 - miss
if __name__ == "__main__":
N = 5000
print("trap pages h fetch 50 fetch 500 fetch 2,500")
for h in (5, 20, 50):
print("{:>12} {:>10.4f} {:>11.4f} {:>13.4f}".format(
h, p_hit(N, h, 50), p_hit(N, h, 500), p_hit(N, h, 2500)))
e, sessions = 0.0005, 2000
fmt = "people: {:,} sessions a day x e = {} -> {:.1f} touches a day"
print(fmt.format(sessions, e, sessions * e))
print("P(some person touches a trap in a day) = {:.4f}".format(
1.0 - (1.0 - e) ** sessions))
M = 100000
print("canaries c copy 1,000 copy 10,000 copy 50,000")
for c in (10, 50, 200):
print("{:>10} {:>12.4f} {:>13.4f} {:>13.4f}".format(
c, p_hit(M, c, 1000), p_hit(M, c, 10000), p_hit(M, c, 50000)))
need = [c for c in range(1, 2001) if p_hit(M, c, 1000) >= 0.95][0]
print("canaries needed so a 1,000-row copy shows one with 0.95: {}"
.format(need))
print("expected canaries in that copy: {:.3f}".format(need * 1000 / M))Single source and citation
Fan, Y. (2026). Zero-Trust Cybersecurity for a One-Commander Silicon Empire: Origin Cloaking, Secret Hygiene and Anti-Scraper Defense (Version 1.0.0), Chapter 5: Anti-Scraper Defence: Token Buckets and Trap Pages. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-336 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026336,
author = {Fan, Yafu},
title = {Zero-Trust Cybersecurity for a One-Commander Silicon Empire: Origin Cloaking, Secret Hygiene and Anti-Scraper Defense},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · The Attack Surface: Beyond the Ports, Credentials Are the Front Door
- Chapter 2 · Blast Radius: the Cage of Least Privilege
- Chapter 3 · Credential Hygiene: Format Checks and Revocation Lists
- Chapter 4 · Token Lifetime: the Exposure Window and the Ceiling on Loss
- Chapter 6 · Ransomware: Common-Cause Failure and the Ten-Second Stop
- Chapter 7 · The Classics Examined: Sunzi and Kerckhoffs
- Chapter 8 · Closing the Loop: a Monthly Check-up and Pre-Registered Tests