Sean-Der / fail2rest

REST server for fail2ban
107 stars 24 forks source link

interface conversion fail2go.(*Conn).JailStatus #41

Closed yura-mdj closed 2 years ago

yura-mdj commented 2 years ago

Hi all, here is what is in the logs:

fail2rest[2897]: 2022/06/01 10:01:29 http: panic serving 127.0.0.1:35724: interface conversion: interface {} is ogórek.Call, not string fail2rest[2897]: goroutine 405 [running]: fail2rest[2897]: net/http.(conn).serve.func1(0xc000076c80) fail2rest[2897]: /usr/lib/go-1.15/src/net/http/server.go:1801 +0x147 fail2rest[2897]: panic(0x878fa0, 0xc000176540) fail2rest[2897]: /usr/lib/go-1.15/src/runtime/panic.go:975 +0x47a fail2rest[2897]: github.com/Sean-Der/fail2go.interfaceSliceToStringSlice(0xc00040a490, 0x1, 0x1, 0xc00040a4f0, 0x1, 0x1) fail2rest[2897]: /root/go/src/github.com/Sean-Der/fail2go/utils.go:5 +0x16f fail2rest[2897]: github.com/Sean-Der/fail2go.(Conn).JailStatus(0xc000090dd0, 0xc0003bc06a, 0x4, 0x4, 0xc000072088, 0x30, 0x8a9960, 0xc00003a9a0, 0x414fb0, 0xc0000f6360, ...) fail2rest[2897]: /root/go/src/github.com/Sean-Der/fail2go/jail.go:24 +0x3b7 fail2rest[2897]: main.jailGetHandler(0x944200, 0xc00011e0e0, 0xc000053000, 0xc000090dd0) fail2rest[2897]: /root/go/src/github.com/Sean-Der/fail2rest/jail.go:16 +0x91 fail2rest[2897]: main.jailHandler.func10(0x944200, 0xc00011e0e0, 0xc000053000) fail2rest[2897]: /root/go/src/github.com/Sean-Der/fail2rest/jail.go:255 +0x48 fail2rest[2897]: net/http.HandlerFunc.ServeHTTP(0xc000091830, 0x944200, 0xc00011e0e0, 0xc000053000) fail2rest[2897]: /usr/lib/go-1.15/src/net/http/server.go:2042 +0x44 fail2rest[2897]: github.com/gorilla/mux.(Router).ServeHTTP(0xc0000f8000, 0x944200, 0xc00011e0e0, 0xc000052b00) fail2rest[2897]: /root/go/src/github.com/gorilla/mux/mux.go:212 +0xd3 fail2rest[2897]: net/http.(ServeMux).ServeHTTP(0xb74140, 0x944200, 0xc00011e0e0, 0xc000052b00) fail2rest[2897]: /usr/lib/go-1.15/src/net/http/server.go:2417 +0x1ad fail2rest[2897]: net/http.serverHandler.ServeHTTP(0xc00011e000, 0x944200, 0xc00011e0e0, 0xc000052b00) fail2rest[2897]: /usr/lib/go-1.15/src/net/http/server.go:2843 +0xa3 fail2rest[2897]: net/http.(conn).serve(0xc000076c80, 0x944d00, 0xc0000a6740) fail2rest[2897]: /usr/lib/go-1.15/src/net/http/server.go:1925 +0x8ad fail2rest[2897]: created by net/http.(Server).Serve fail2rest[2897]: /usr/lib/go-1.15/src/net/http/server.go:2969 +0x36c

this happens when the address gets banned

~$ fail2ban-client status sshd Status for the jail: sshd |- Filter | |- Currently failed: 0 | |- Total failed: 5 | - File list: /var/log/auth.log - Actions |- Currently banned: 1 |- Total banned: 2 `- Banned IP list: BAN-IP-ADDR

~$ go version go version go1.15.15 linux/amd64 ~$ cat /etc/debian_version 11.2 ~$ fail2ban-server --version Fail2Ban v0.11.2