Files
vesti/openspec/changes/archive/2026-11-14-edge-basic-auth-fail2ban/tasks.md
T

27 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 1. Подготовка
- [x] 1.1: бэкапы: `/opt/caddy/Caddyfile.bak-vesti-basic-20261114-095051`,
`/etc/fail2ban/filter.d/caddy-vesti.conf.bak-*`, `/etc/fail2ban/jail.d/caddy-vesti.local.bak-*`
- [x] 1.2: bcrypt-хэш `ADMIN_PASSWORD` посчитан на vps02, plaintext в файлы/логи не попал
- [x] 1.3: watchdog ходит на `127.0.0.1:8400/login` (200 без basic auth) — правки не нужны
## 2. Caddy
- [x] 2.1: в блок `vesti.nixg.ru` добавлены `basic_auth /*` (admin) и `X-Robots-Tag: noindex, nofollow`
- [x] 2.2: `caddy validate` → `Valid configuration`
- [x] 2.3: применено `docker restart caddy` (reload читал старый inode bind-mount'а — см. WALKTHROUGH)
- [x] 2.4: пробы: без креды `401`, неверный пароль `401`, с кредой `/login` `200`, `/` `303`
## 3. Fail2ban
- [x] 3.1: фильтр `caddy-vesti` — альтернатива `status:401` | `POST /login → 302 /login?error=1`
- [x] 3.2: `fail2ban-client reload caddy-vesti` → OK, джейл активен
- [x] 3.3: `fail2ban-regex` на реальном логе: 5 совпадений по 401 + 6 по историческим 302
- [x] 3.4: сквозной тест с vps03: 5×401 → бан `77.67.89.154` (REJECT на 80,443), `unbanip` вернул доступ;
`ignoreip` (localhost, 10.8.0.0/24, 178.176.197.2) в бане не участвует
## 4. Документация
- [x] 4.1: `vesti-ops` — раздел «Защита периметра» дополнен basic auth, питфол bind-mount записан
- [x] 4.2: STATUS.md/WALKTHROUGH.md/TODO.md — записи о периметре