diff --git a/openspec/changes/edge-basic-auth-fail2ban/design.md b/openspec/changes/edge-basic-auth-fail2ban/design.md index 2eab458..a58de15 100644 --- a/openspec/changes/edge-basic-auth-fail2ban/design.md +++ b/openspec/changes/edge-basic-auth-fail2ban/design.md @@ -43,6 +43,9 @@ action = iptables-multiport[name=vesti, port="http,https", protocol=tcp] failregex = ^.*"remote_ip":"".*"status":401.*$ ^.*"remote_ip":"".*"method":"POST","host":"vesti\.nixg\.ru","uri":"/login".*"status":302.*"Location":\["/login\?error=1"\].*$ ignoreregex = +# Caddy пишет ts как epoch с дробной частью; без datepattern fail2ban брал «сейчас» +# и писал `Found a match but no valid date/time found` на КАЖДОЕ совпадение. +datepattern = ^\{"level":"[^"]*","ts":{EPOCH} ``` Важно: 401-строка от Caddy не содержит `"method":"POST"...` — общий префикс только `remote_ip`; порядок полей в JSON-логе стабилен (`level`, `ts`, `logger`, `msg`, `request{remote_ip,...}`), это