关于「权限图与最小覆盖:一人公司的爆炸半径」,《口令熵与最小权限》给出的定量结论是什么?
结论:第六章用最小角色覆盖与找回关系图说明,示意公司期望每年失守 0.4972 个账户,只加固主邮箱就降到 0.1899。
数据口径:书中的公司、账户与概率参数均为示意,全部计算由书中程序生成;本书不是个性化的经营、法律、财务或合规建议,审计流程与小工具不接触任何真实口令。 第六章用最小角色覆盖与找回关系图说明,示意公司期望每年失守 0.4972 个账户,只加固主邮箱就降到 0.1899。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.1899, 0.4972
| k | best set (exhaustive) | loss/yr | covers jewels |
|---|---|---|---|
| 0 | - | 0.4972 | False |
| 1 | 0.1899 | True | |
| 2 | mail+social | 0.1409 | True |
| 3 | cloud+mail+social | 0.1019 | True |
| greedy order: mail > social > cloud | |||
| smallest cover of the jewels: mail |
查看完整验算程序
# Chapter 6. p63: the smallest set of accounts to harden first.
# Hardening an account (phishing-resistant second factor, recovery
# locked) cuts its outgoing reset edges and divides its direct chance by
# 50 (illustrative). Exhaustive search over all sets of size k on the
# p62 graph minimises expected accounts lost per year; a greedy pick is
# shown for comparison. A "cover" is a set that leaves the crown jewels
# (bank, domain) reachable only from themselves.
import math
from itertools import combinations
EDGES = {
"phone": ["mail"], "domain": ["mail"],
"mail": ["bank", "store", "cloud", "books", "social", "domain"],
"cloud": ["store"], "store": [], "bank": [], "books": [],
"social": [],
}
P = {"phone": 0.01, "domain": 0.01, "mail": 0.03, "cloud": 0.02,
"store": 0.03, "bank": 0.01, "books": 0.02, "social": 0.05}
JEWELS = ("bank", "domain")
FACTOR = 50.0
def reach(edges, start):
seen, stack = {start}, [start]
while stack:
u = stack.pop()
for v in edges.get(u, []):
if v not in seen:
seen.add(v)
stack.append(v)
return seen
def harden(hard):
e = {u: ([] if u in hard else vs) for u, vs in EDGES.items()}
p = {u: (x / FACTOR if u in hard else x) for u, x in P.items()}
return e, p
def loss(hard):
e, p = harden(hard)
nodes = sorted(p)
r = {u: reach(e, u) for u in nodes}
return math.fsum(1.0 - math.prod(1.0 - p[u] for u in nodes
if v in r[u]) for v in nodes)
def covers(hard):
e, _ = harden(hard)
return all(not any(j in reach(e, u) for u in P if u != j)
for j in JEWELS)
nodes = sorted(P)
print("k best set (exhaustive) loss/yr covers jewels")
print("0 {:<27s} {:.4f} {}".format("-", loss(()), covers(())))
for k in (1, 2, 3):
best = min((loss(c), c) for c in combinations(nodes, k))
print("{} {:<27s} {:.4f} {}".format(
k, "+".join(best[1]), best[0], covers(best[1])))
chosen = []
for _ in range(3):
nxt = min((loss(tuple(chosen) + (u,)), u) for u in nodes
if u not in chosen)
chosen.append(nxt[1])
print("greedy order: {}".format(" > ".join(chosen)))
small = min((len(c), c) for k in range(1, len(nodes) + 1)
for c in combinations(nodes, k) if covers(c))
print("smallest cover of the jewels: {}".format("+".join(small[1])))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《口令熵与撞库攻击、强制改密反安全悖论与一人公司账号最小权限母典》第 6 章「权限图与最小覆盖:一人公司的爆炸半径」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-218 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026218,
author = {Fan, Yafu},
title = {Password Entropy and Credential Stuffing, the Forced-Rotation Paradox and Least-Privilege Accounts for One-Person Firms},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}