关于「攻击面:端口之外,凭据才是大门」,《单兵零信任母典》给出的定量结论是什么?

结论:再看令牌会泄露。每年泄露机会取 0.05,开放布局合计 33.600,隧道布局 24.350,令牌份额从 0.415 升到 0.572。泄露机会取 0.20,两者合计 37.400 与 28.150,令牌份额 0.474 与 0.630。泄露机会越高,隧道削减比例越小:从 0.286,降到 0.275,再降到 0.247。

数据口径:全书只写防守,不写任何攻击、入侵、绕过或规避检测手法;书中主机、域名、令牌全为合成,参数为示意,全部计算由书中程序生成;本书为非个人化经营分析,不构成安全审计或法律意见,任何生产变更须经人工复核放行。 书中以标注框区分已发表之证据、可运行之 Python 计算(20 段程序)、原典与作者之假说。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.05, 0.20, 0.247, 0.275, 0.286, 0.415

design method chan data token total tok/all
yearly leak probability per token q0.00
open12.000 6.000 1.667 12.667 32.333 0.392
tunnel8.500 0.250 1.667 12.667 23.083 0.549
tunnel cuts total by 0.286; token part unchanged
yearly leak probability per token q0.05
open12.000 6.000 1.667 13.933 33.600 0.415
tunnel8.500 0.250 1.667 13.933 24.350 0.572
tunnel cuts total by 0.275; token part unchanged
yearly leak probability per token q0.20
open12.000 6.000 1.667 17.733 37.400 0.474
tunnel8.500 0.250 1.667 17.733 28.150 0.630
tunnel cuts total by 0.247; token part unchanged
tunnel + scoped tokens, q0.05: total 17.750, token 7.333
one token leaked, root scope: der rises 1.6675.000
查看完整验算程序
# Chapter 1. p11: attack surface of open ports versus a tunnel, with tokens.
# Structure follows Manadhata and Wing (2011): the surface is a triple of
# sums over methods, channels and data items; each term is a damage
# potential divided by the attacker effort it needs (der ratio).
# Numeric scales are illustrative: privilege root 5, app 3, read 1;
# access rights anonymous 1, signed-in 3, admin 4. Host names synthetic.
# Tokens are data items: while secret they need signed-in effort (3);
# once leaked they need none beyond holding them (1). q = yearly leak
# probability per token, illustrative.
import math

PRIV = {"root": 5.0, "app": 3.0, "read": 1.0}
RIGHT = {"anon": 1.0, "user": 3.0, "admin": 4.0}

OPEN_METHODS = [("web", "app", "anon"), ("api", "app", "anon"),
                ("ssh", "root", "user"), ("db-panel", "root", "user"),
                ("metrics", "read", "anon"), ("ctl-ui", "root", "user")]
OPEN_CHANNELS = [("tcp", 1.0, "anon")] * 6
TUNNEL_METHODS = [("web", "app", "anon"), ("api", "app", "anon"),
                  ("ssh", "root", "admin"), ("db-panel", "root", "admin")]
TUNNEL_CHANNELS = [("tunnel-out", 1.0, "admin")]
DATA = [("db", 4.0, "user"), ("files", 1.0, "user")]
TOKENS = [("tok_deploy", "root"), ("tok_db", "root"), ("tok_ci", "root"),
          ("tok_dns", "root"), ("tok_mail", "app"), ("tok_pay", "app"),
          ("tok_store", "app"), ("tok_cdn", "app"), ("tok_ai", "app"),
          ("tok_log", "read"), ("tok_mon", "read"), ("tok_map", "read")]


def method_sum(ms):
    return math.fsum(PRIV[p] / RIGHT[r] for _, p, r in ms)


def channel_sum(cs):
    return math.fsum(w / RIGHT[r] for _, w, r in cs)


def data_sum(ds):
    return math.fsum(w / RIGHT[r] for _, w, r in ds)


DOWN = {"root": "app", "app": "read", "read": "read"}


def token_sum(q, scoped=False):
    return math.fsum(PRIV[DOWN[p] if scoped else p] *
                     ((1.0 - q) / RIGHT["user"] + q / RIGHT["anon"])
                     for _, p in TOKENS)


def report(name, ms, cs, q):
    m, c = method_sum(ms), channel_sum(cs)
    d, t = data_sum(DATA), token_sum(q)
    total = math.fsum([m, c, d, t])
    fmt = "{:<7} {:>6.3f} {:>6.3f} {:>6.3f} {:>6.3f} {:>7.3f} {:>6.3f}"
    print(fmt.format(name, m, c, d, t, total, t / total))
    return total, t


if __name__ == "__main__":
    print("design  method  chan   data   token  total   tok/all")
    for q in (0.0, 0.05, 0.20):
        print("yearly leak probability per token q = {:.2f}".format(q))
        a, ta = report("open", OPEN_METHODS, OPEN_CHANNELS, q)
        b, tb = report("tunnel", TUNNEL_METHODS, TUNNEL_CHANNELS, q)
        print("  tunnel cuts total by {:.3f}; token part unchanged".format(
            1.0 - b / a))
    m = method_sum(TUNNEL_METHODS)
    c = channel_sum(TUNNEL_CHANNELS)
    d = data_sum(DATA)
    t = token_sum(0.05, scoped=True)
    print("tunnel + scoped tokens, q = 0.05: total {:.3f}, token {:.3f}"
          .format(math.fsum([m, c, d, t]), t))
    print("one token leaked, root scope: der rises {:.3f} -> {:.3f}".format(
        PRIV["root"] / RIGHT["user"], PRIV["root"] / RIGHT["anon"]))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《单兵硅基帝国零信任网安架构、源站隧道隐身与反爬虫防勒索母典》第 1 章「攻击面:端口之外,凭据才是大门」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 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}
}

本书其他章节结论