From 38b295584f4f88b552cd8c4fc88bbdb0af71f901 Mon Sep 17 00:00:00 2001 From: kpa39l Date: Sat, 14 Nov 2026 06:56:31 +0000 Subject: [PATCH] docs(ops): note caddy epoch ts datepattern in fail2ban filter --- openspec/changes/edge-basic-auth-fail2ban/design.md | 3 +++ 1 file changed, 3 insertions(+) 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,...}`), это