Stealth sen:// port, random cert names, external Prometheus card
The subscription port answered every request with signed JSON: one probe told a scanner what it had found, and the public key from any sen:// link pinned the exact server. It now speaks the protocol only to those who prove a secret — peek and register with the link's master secret, everything else with a valid device signature — and gives Go's plain "404 page not found" to the rest. A deleted device still gets its 410, but only when the request is signed with its key, kept in the new revoked_devices table. The migration freeze answers only proven clients too. Self-signed certs for the subscription (SUB_TLS=on) and the node hub got fixed names (sen, awg-node); new ones get a random host-like name. Clients and nodes pin the key, so existing certs keep working. The panel could already issue a metrics-only token, but nothing in the UI used it. The Monitor tab gets an "External Prometheus" card: issue, reissue and revoke the token, with a ready prometheus.yml fragment whose address is taken from the page, so it carries the secret path or the nginx subfolder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013bNGYiDst62wH3ZGTRPFLJ
This commit is contained in:
@@ -92,6 +92,25 @@ iptables, заголовки ядра) остаются. Ноду после у
|
||||
путь, и путь старой (`UI_PREFIX_MOVED`) — закладки и API через ретранслятор продолжают
|
||||
работать. Пока выдан код переноса, `POST /migrate/v1/import` принимается и без пути.
|
||||
|
||||
### Порт подписки sen://
|
||||
|
||||
Подписка отвечает по протоколу только тем, кто доказал знание секрета: `peek`/`register` —
|
||||
с секретом мастер-ключа из ссылки, остальные запросы — с подписью ключом устройства. На всё
|
||||
прочее (другие пути и методы, битое тело, чужой секрет, подобранный id устройства, неверная
|
||||
подпись) — `404 page not found`, как пустой веб-сервер. Удалённому устройству `410` уходит,
|
||||
только если запрос подписан его ключом (они хранятся в `revoked_devices`); устройства,
|
||||
удалённые до этой версии, получают тот же тихий 404. Самоподписанные сертификаты подписки
|
||||
(`SUB_TLS=on`) и хаба нод создаются со случайным именем вместо общих `sen` / `awg-node`:
|
||||
клиенты и ноды сверяют ключ, а не имя, так что прежние сертификаты продолжают работать.
|
||||
|
||||
### Внешний Prometheus
|
||||
|
||||
Вкладка «Монитор» → «Внешний Prometheus»: выдать токен «только метрики» и скопировать готовый
|
||||
фрагмент `prometheus.yml`. Адрес в нём берётся от страницы панели, поэтому уже содержит
|
||||
секретный путь (`metrics_path: /<путь>/metrics`) или подпапку nginx. Без пути `/metrics`
|
||||
снаружи отвечает 404. Панель по голому HTTP передаёт токен и метрики открытым текстом —
|
||||
внешний скрейп лучше вести через nginx с TLS или по VPN.
|
||||
|
||||
### Панель за nginx
|
||||
|
||||
Панель работает и в корне домена, и в любой подпапке — пути в ней относительные,
|
||||
|
||||
Reference in New Issue
Block a user