diff --git a/docs/architecture/evidence/T04/T04-allowlist.diff b/docs/architecture/evidence/T04/T04-allowlist.diff new file mode 100644 index 0000000..cdceece --- /dev/null +++ b/docs/architecture/evidence/T04/T04-allowlist.diff @@ -0,0 +1,27 @@ +--- a/cloudflare/tunnel-ingress ++++ b/cloudflare/tunnel-ingress +@@ proposed default-deny @@ +- [{hostname: "*.buryans.ru", service: "http://192.168.1.10:80"}] ++ [{hostname: "buryans.ru", service: "http://192.168.1.10:80"}, ++ {hostname: "www.buryans.ru", service: "http://192.168.1.10:80"}, ++ {hostname: "media.buryans.ru", service: "http://192.168.1.10:80"}, ++ {hostname: "home.buryans.ru", service: "http://192.168.1.10:80"}, ++ {hostname: "docs.buryans.ru", service: "http://192.168.1.10:80"}, ++ {hostname: "jump.buryans.ru", service: "http://192.168.1.10:80"}] ++ # tailscale-only: vault, git, admin, backup, grafana, n8n, hub, status, files, news, chat, ns1 ++ # plex: отдельное решение — SSO или tailscale-only ++ [{service: "http_status:404"}] + +--- a/nginx/default-server ++++ b/nginx/default-server +@@ proposed catch-all deny @@ ++ server { ++ listen 80 default_server; ++ listen 443 ssl default_server; ++ ssl_certificate /etc/letsencrypt/live/buryans.ru/fullchain.pem; ++ ssl_certificate_key /etc/letsencrypt/live/buryans.ru/privkey.pem; ++ server_name _; ++ return 444; ++ } ++ ++ # существующие server_name остаются; неизвестный Host → 444 diff --git a/docs/architecture/evidence/T04/T04-exposure-map.md b/docs/architecture/evidence/T04/T04-exposure-map.md new file mode 100644 index 0000000..eb4dc98 --- /dev/null +++ b/docs/architecture/evidence/T04/T04-exposure-map.md @@ -0,0 +1,57 @@ +# T04 — публичная поверхность (read-only) + +Дата: 2026-12-02 20:25 MSK +Статус: **ok**, изменения не применялись. + +## Факты + +- Cloudflare: **19 CNAME** на tunnel `cb04...cfargotunnel.com`; A-записей 0. +- Tunnel ingress: `*.buryans.ru` → `http://192.168.1.10:80`, apex → тот же, fallback 404. +- Nginx server_name: **48 имён**, из них публично доступны только 19 CNAME. +- `plex.buryans.ru` → **200**, без SSO, в инвентаре 48 доменов отсутствует. +- `git.buryans.ru` → 200 (страница логина Gitea, не SSO-обёртка). +- `jump.buryans.ru` → 200. +- `apex` → 200. + +## Карта + +| Имя | Код | Auth | Предлагаемый режим | +|---|---|---|---| +| buryans.ru | 200 | нет | public (лендинг) | +| www | 301 → home | — | public redirect | +| media | 302 /web | Jellyfin login | public | +| plex | **200** | **нет** | **tailscale-only / SSO** | +| home | 302 Authentik | SSO | public | +| backup | 302 Authentik | SSO | tailscale-only | +| docs | 302 Authentik | SSO | public или tailscale-only | +| files | 302 /login | app login | tailscale-only | +| news | 302 Authentik | SSO | tailscale-only | +| chat | 301 → element | — | public redirect / убрать | +| git | 200 | Gitea login | tailscale-only | +| grafana | 301 | нет SSO | tailscale-only | +| hub | 302 Authentik | SSO | tailscale-only | +| n8n | 302 hub-login | app login | tailscale-only | +| status | 302 Authentik | SSO | tailscale-only | +| vault | 302 Authentik | SSO | tailscale-only | +| admin | 302 own flow | app | tailscale-only | +| jump | 200 | нет | tailscale-only | +| ns1 | 301 adguard | нет | убрать/переименовать | + +## Plex + +`plex.buryans.ru` — публичный 200, отсутствует в 48-доменном инвентаре и не за Authentik. +Это самый высокий риск публичной поверхности: либо Tailscale-only, либо SSO-прокси. + +## Что подготовлено + +```text +allowlist.diff — явный ingress без wildcard + nginx default 444 +``` + +Diff **не применялся**. + +## Ограничения + +- `matrix`/`element` сейчас нет в Cloudflare CNAME; публичного DNS нет. +- 48 nginx-имён ≠ 19 CNAME: источник дрейфа, требует T07. +- `grafana` 301 может быть редиректом без SSO. diff --git a/docs/architecture/evidence/T04/T04-report.json b/docs/architecture/evidence/T04/T04-report.json new file mode 100644 index 0000000..ae7d7f6 --- /dev/null +++ b/docs/architecture/evidence/T04/T04-report.json @@ -0,0 +1,34 @@ +{ + "task_id": "T04", + "status": "ok", + "facts": [ + {"source": "Cloudflare DNS API", "value": "19 CNAME to tunnel, A=0", "observed_at": "2026-12-02T20:25:00+03:00"}, + {"source": "tunnel configurations API", "value": "ingress wildcard *.buryans.ru + apex -> 192.168.1.10:80, fallback 404", "observed_at": "2026-12-02T20:25:00+03:00"}, + {"source": "nginx -T on pve", "value": "48 server_name; only 19 have public CNAME", "observed_at": "2026-12-02T20:25:00+03:00"}, + {"source": "curl public names", "value": "plex 200 no SSO; git 200; jump 200; admin 302 own flow; vault/status/home/hub/backup/news/docs 302 Authentik; grafana 301", "observed_at": "2026-12-02T20:25:00+03:00"} + ], + "hypotheses": [ + {"claim": "plex is intentionally public", "why_unverified": "not in 48-domain inventory; no owner statement", "how_to_verify": "owner decision"}, + {"claim": "grafana 301 is not SSO", "why_unverified": "only status code captured", "how_to_verify": "follow redirect and inspect auth"} + ], + "actions": [ + {"action": "read DNS/ingress/nginx/HTTP; prepare diff", "reversibility": "R", "approval": "T04", "result": "no changes applied"} + ], + "artifacts": [ + "docs/architecture/evidence/T04/T04-exposure-map.md", + "docs/architecture/evidence/T04/T04-allowlist.diff", + "docs/architecture/evidence/T04/T04-report.json" + ], + "acceptance_check": [ + {"criterion": "exposure table public/SSO/needed/target", "met": true, "proof": "T04-exposure-map.md"}, + {"criterion": "plex explained", "met": true, "proof": "public 200, no SSO, absent from inventory"}, + {"criterion": "diff explicit ingress + nginx default 444", "met": true, "proof": "T04-allowlist.diff"}, + {"criterion": "tailscale-only list", "met": true, "proof": "vault/git/admin/backup/grafana/n8n/hub/status"} + ], + "metrics_delta": {"public_names": {"before": 19, "after": 19}, "wildcard_ingress": {"before": 1, "after": 1}}, + "decision": "T04 complete; no apply. P0 exposure: plex public 200 no SSO.", + "next": "T05 latency measurement (read-only), or T09 default-deny after approval/T04 review.", + "rollback_ready": true, + "stop_line_triggered": null, + "confidence": "high" +} diff --git a/docs/architecture/evidence/T05/T05-report.json b/docs/architecture/evidence/T05/T05-report.json new file mode 100644 index 0000000..cf6ffde --- /dev/null +++ b/docs/architecture/evidence/T05/T05-report.json @@ -0,0 +1,30 @@ +{ + "task_id": "T05", + "status": "ok", + "facts": [ + {"source": "100 probes /tmp/t05_probes.csv", "value": "/status n=100 bad=1 p50=0.001 p95=0.001 max=5.002", "observed_at": "2026-12-02T20:30:00+03:00"}, + {"source": "100 probes", "value": "/status.json n=100 bad=0 p50=0.001 max=0.001", "observed_at": "2026-12-02T20:30:00+03:00"}, + {"source": "100 probes", "value": "/health n=100 bad=0 p50=0.010 p95=0.016 max=0.021", "observed_at": "2026-12-02T20:30:00+03:00"}, + {"source": "pre-commit smoke", "value": "hub-core /status.json timed out before probe; not reproduced during probe", "observed_at": "2026-12-02T20:29:00+03:00"} + ], + "hypotheses": [ + {"claim": "intermittent stall in hub-core status path", "why_unverified": "no trace/log correlation yet", "how_to_verify": "capture py-spy/log during next timeout"} + ], + "actions": [ + {"action": "100 sequential GET probes", "reversibility": "R", "approval": null, "result": "done"} + ], + "artifacts": [ + "docs/architecture/evidence/T05/probes.csv", + "docs/architecture/evidence/T05/T05-report.json" + ], + "acceptance_check": [ + {"criterion": "p50/p95/max and non-200 share", "met": true, "proof": "1/100 bad, max 5.002s"}, + {"criterion": "verdict", "met": true, "proof": "intermittent degradation, not single case"} + ], + "metrics_delta": {"status_bad_ratio": {"before": null, "after": 0.01}, "status_max_s": {"before": null, "after": 5.002}}, + "decision": "T05 done: intermittent /status timeout; /status.json timeout seen in pre-commit, not reproduced in probe.", + "next": "Instrument hub-core timeout (py-spy/log) or proceed T07 read-only.", + "rollback_ready": true, + "stop_line_triggered": null, + "confidence": "medium" +} diff --git a/docs/architecture/evidence/T05/probes.csv b/docs/architecture/evidence/T05/probes.csv new file mode 100644 index 0000000..57bd0cd --- /dev/null +++ b/docs/architecture/evidence/T05/probes.csv @@ -0,0 +1,301 @@ +i,path,code,time +1,/status,000,5.002368 +1,/status.json,200,0.001015 +1,/health,200,0.020798 +2,/status,200,0.003353 +2,/status.json,200,0.000700 +2,/health,200,0.011258 +3,/status,200,0.001186 +3,/status.json,200,0.000839 +3,/health,200,0.009787 +4,/status,200,0.000664 +4,/status.json,200,0.000722 +4,/health,200,0.010640 +5,/status,200,0.000629 +5,/status.json,200,0.000557 +5,/health,200,0.014614 +6,/status,200,0.000698 +6,/status.json,200,0.000676 +6,/health,200,0.012157 +7,/status,200,0.000911 +7,/status.json,200,0.000909 +7,/health,200,0.010776 +8,/status,200,0.000827 +8,/status.json,200,0.000708 +8,/health,200,0.010239 +9,/status,200,0.000830 +9,/status.json,200,0.000951 +9,/health,200,0.012591 +10,/status,200,0.000690 +10,/status.json,200,0.000841 +10,/health,200,0.013698 +11,/status,200,0.000787 +11,/status.json,200,0.000898 +11,/health,200,0.010579 +12,/status,200,0.000938 +12,/status.json,200,0.000854 +12,/health,200,0.009740 +13,/status,200,0.000759 +13,/status.json,200,0.000838 +13,/health,200,0.013011 +14,/status,200,0.000605 +14,/status.json,200,0.000805 +14,/health,200,0.010436 +15,/status,200,0.000705 +15,/status.json,200,0.000701 +15,/health,200,0.016678 +16,/status,200,0.000796 +16,/status.json,200,0.000724 +16,/health,200,0.011738 +17,/status,200,0.000861 +17,/status.json,200,0.000834 +17,/health,200,0.011339 +18,/status,200,0.001307 +18,/status.json,200,0.000912 +18,/health,200,0.013011 +19,/status,200,0.000871 +19,/status.json,200,0.000729 +19,/health,200,0.011951 +20,/status,200,0.000798 +20,/status.json,200,0.000856 +20,/health,200,0.011506 +21,/status,200,0.001033 +21,/status.json,200,0.001016 +21,/health,200,0.015839 +22,/status,200,0.000841 +22,/status.json,200,0.001366 +22,/health,200,0.011391 +23,/status,200,0.000967 +23,/status.json,200,0.000864 +23,/health,200,0.015472 +24,/status,200,0.001106 +24,/status.json,200,0.000671 +24,/health,200,0.010701 +25,/status,200,0.000962 +25,/status.json,200,0.001297 +25,/health,200,0.009324 +26,/status,200,0.000580 +26,/status.json,200,0.000756 +26,/health,200,0.010531 +27,/status,200,0.000845 +27,/status.json,200,0.000857 +27,/health,200,0.012187 +28,/status,200,0.000773 +28,/status.json,200,0.000662 +28,/health,200,0.008880 +29,/status,200,0.000816 +29,/status.json,200,0.000684 +29,/health,200,0.009730 +30,/status,200,0.000752 +30,/status.json,200,0.000786 +30,/health,200,0.010489 +31,/status,200,0.001446 +31,/status.json,200,0.000984 +31,/health,200,0.009098 +32,/status,200,0.000849 +32,/status.json,200,0.000794 +32,/health,200,0.012553 +33,/status,200,0.000736 +33,/status.json,200,0.000801 +33,/health,200,0.016768 +34,/status,200,0.000783 +34,/status.json,200,0.000816 +34,/health,200,0.009512 +35,/status,200,0.000759 +35,/status.json,200,0.001049 +35,/health,200,0.010985 +36,/status,200,0.000790 +36,/status.json,200,0.000801 +36,/health,200,0.009990 +37,/status,200,0.000869 +37,/status.json,200,0.000935 +37,/health,200,0.009276 +38,/status,200,0.000685 +38,/status.json,200,0.000861 +38,/health,200,0.015095 +39,/status,200,0.000938 +39,/status.json,200,0.000815 +39,/health,200,0.014953 +40,/status,200,0.000874 +40,/status.json,200,0.000795 +40,/health,200,0.009975 +41,/status,200,0.000896 +41,/status.json,200,0.001322 +41,/health,200,0.017267 +42,/status,200,0.000847 +42,/status.json,200,0.000664 +42,/health,200,0.011680 +43,/status,200,0.000864 +43,/status.json,200,0.000715 +43,/health,200,0.015458 +44,/status,200,0.000739 +44,/status.json,200,0.000754 +44,/health,200,0.009314 +45,/status,200,0.000786 +45,/status.json,200,0.000773 +45,/health,200,0.010701 +46,/status,200,0.000766 +46,/status.json,200,0.000702 +46,/health,200,0.014068 +47,/status,200,0.000746 +47,/status.json,200,0.000799 +47,/health,200,0.010020 +48,/status,200,0.000876 +48,/status.json,200,0.000675 +48,/health,200,0.010070 +49,/status,200,0.001703 +49,/status.json,200,0.000819 +49,/health,200,0.017085 +50,/status,200,0.000666 +50,/status.json,200,0.000685 +50,/health,200,0.009444 +51,/status,200,0.000697 +51,/status.json,200,0.000641 +51,/health,200,0.009706 +52,/status,200,0.000824 +52,/status.json,200,0.000867 +52,/health,200,0.010988 +53,/status,200,0.000850 +53,/status.json,200,0.000909 +53,/health,200,0.011308 +54,/status,200,0.000853 +54,/status.json,200,0.000802 +54,/health,200,0.012527 +55,/status,200,0.000600 +55,/status.json,200,0.000725 +55,/health,200,0.008903 +56,/status,200,0.000684 +56,/status.json,200,0.000684 +56,/health,200,0.009231 +57,/status,200,0.000676 +57,/status.json,200,0.000790 +57,/health,200,0.011428 +58,/status,200,0.000643 +58,/status.json,200,0.000608 +58,/health,200,0.009801 +59,/status,200,0.000780 +59,/status.json,200,0.000770 +59,/health,200,0.010480 +60,/status,200,0.000771 +60,/status.json,200,0.000647 +60,/health,200,0.010553 +61,/status,200,0.000606 +61,/status.json,200,0.000604 +61,/health,200,0.009497 +62,/status,200,0.000635 +62,/status.json,200,0.000761 +62,/health,200,0.010448 +63,/status,200,0.000650 +63,/status.json,200,0.000717 +63,/health,200,0.009389 +64,/status,200,0.000648 +64,/status.json,200,0.000795 +64,/health,200,0.009533 +65,/status,200,0.000740 +65,/status.json,200,0.000735 +65,/health,200,0.009836 +66,/status,200,0.000653 +66,/status.json,200,0.000567 +66,/health,200,0.011323 +67,/status,200,0.000742 +67,/status.json,200,0.000760 +67,/health,200,0.009960 +68,/status,200,0.001893 +68,/status.json,200,0.000758 +68,/health,200,0.014012 +69,/status,200,0.000640 +69,/status.json,200,0.000651 +69,/health,200,0.015233 +70,/status,200,0.000716 +70,/status.json,200,0.000723 +70,/health,200,0.011007 +71,/status,200,0.000861 +71,/status.json,200,0.000646 +71,/health,200,0.011535 +72,/status,200,0.000837 +72,/status.json,200,0.000788 +72,/health,200,0.010716 +73,/status,200,0.000907 +73,/status.json,200,0.000734 +73,/health,200,0.010793 +74,/status,200,0.000848 +74,/status.json,200,0.001470 +74,/health,200,0.010651 +75,/status,200,0.000775 +75,/status.json,200,0.000684 +75,/health,200,0.009850 +76,/status,200,0.000691 +76,/status.json,200,0.000608 +76,/health,200,0.008714 +77,/status,200,0.000611 +77,/status.json,200,0.000605 +77,/health,200,0.008940 +78,/status,200,0.000670 +78,/status.json,200,0.000784 +78,/health,200,0.009467 +79,/status,200,0.000658 +79,/status.json,200,0.000644 +79,/health,200,0.011528 +80,/status,200,0.000578 +80,/status.json,200,0.000549 +80,/health,200,0.011943 +81,/status,200,0.000719 +81,/status.json,200,0.000620 +81,/health,200,0.008938 +82,/status,200,0.000584 +82,/status.json,200,0.000640 +82,/health,200,0.008485 +83,/status,200,0.000641 +83,/status.json,200,0.000609 +83,/health,200,0.008476 +84,/status,200,0.000571 +84,/status.json,200,0.000519 +84,/health,200,0.008192 +85,/status,200,0.000618 +85,/status.json,200,0.000653 +85,/health,200,0.010880 +86,/status,200,0.000821 +86,/status.json,200,0.000659 +86,/health,200,0.008574 +87,/status,200,0.000693 +87,/status.json,200,0.000656 +87,/health,200,0.008975 +88,/status,200,0.000514 +88,/status.json,200,0.000652 +88,/health,200,0.008385 +89,/status,200,0.000654 +89,/status.json,200,0.000628 +89,/health,200,0.008393 +90,/status,200,0.000674 +90,/status.json,200,0.000635 +90,/health,200,0.008696 +91,/status,200,0.000655 +91,/status.json,200,0.000722 +91,/health,200,0.008382 +92,/status,200,0.000544 +92,/status.json,200,0.000583 +92,/health,200,0.008957 +93,/status,200,0.000585 +93,/status.json,200,0.000752 +93,/health,200,0.007959 +94,/status,200,0.000690 +94,/status.json,200,0.000465 +94,/health,200,0.009194 +95,/status,200,0.000642 +95,/status.json,200,0.000552 +95,/health,200,0.009771 +96,/status,200,0.000535 +96,/status.json,200,0.000726 +96,/health,200,0.008321 +97,/status,200,0.000602 +97,/status.json,200,0.000475 +97,/health,200,0.008048 +98,/status,200,0.000620 +98,/status.json,200,0.000474 +98,/health,200,0.007877 +99,/status,200,0.000639 +99,/status.json,200,0.000534 +99,/health,200,0.007787 +100,/status,200,0.000691 +100,/status.json,200,0.000604 +100,/health,200,0.007938