Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .tests/haproxy-logs-test/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
parsers:
- crowdsecurity/syslog-logs
- crowdsecurity/dateparse-enrich
- crowdsecurity/haproxy-logs
scenarios:
- ""
# - ./scenarios/crowdsecurity/my-haproxy-http-bf.yaml
postoverflows:
- ""
log_file: haproxy-test-logs.log
log_type: syslog
ignore_parsers: true
25 changes: 25 additions & 0 deletions .tests/haproxy-logs-test/haproxy-test-logs.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
2025-08-26T06:57:46+02:00 OpenWrt haproxy[8178]: 218.207.1.40:47761 [26/Aug/2025:06:57:46.205] https_in/1: Connection closed during SSL handshake
2025-08-26T06:57:46+02:00 OpenWrt haproxy[8178]: 218.207.1.40:55851 [26/Aug/2025:06:57:46.546] https_in/1: Connection closed during SSL handshake
2025-08-26T06:57:46+02:00 OpenWrt haproxy[8178]: 218.207.1.40:17257 [26/Aug/2025:06:57:46.839] https_in/1: Connection closed during SSL handshake
2025-08-26T06:57:47+02:00 OpenWrt haproxy[8178]: 218.207.1.40:22433 [26/Aug/2025:06:57:47.166] https_in/1: Connection closed during SSL handshake
2025-08-26T06:57:47+02:00 OpenWrt haproxy[8178]: 218.207.1.40:48535 [26/Aug/2025:06:57:47.528] https_in/1: Connection closed during SSL handshake
2025-08-26T06:57:55+02:00 OpenWrt haproxy[8178]: 172.68.126.132:23745 [26/Aug/2025:06:57:55.570] https_in/1: Connection closed during SSL handshake
2025-08-26T06:57:55+02:00 OpenWrt haproxy[8178]: 172.68.126.132:42883 [26/Aug/2025:06:57:55.903] https_in/1: Connection closed during SSL handshake
2025-08-26T06:57:56+02:00 OpenWrt haproxy[8178]: 172.68.126.132:41883 [26/Aug/2025:06:57:56.238] https_in/1: Connection closed during SSL handshake
2025-08-26T06:57:56+02:00 OpenWrt haproxy[8178]: 172.68.126.132:22045 [26/Aug/2025:06:57:56.564] https_in/1: Connection closed during SSL handshake
2025-08-26T06:57:56+02:00 OpenWrt haproxy[8178]: 172.68.126.132:48509 [26/Aug/2025:06:57:56.889] https_in/1: Connection closed during SSL handshake
2025-08-26T06:58:03+02:00 OpenWrt haproxy[8178]: 172.68.28.154:26003 [26/Aug/2025:06:58:03.106] https_in/1: Connection closed during SSL handshake
2025-08-26T06:58:03+02:00 OpenWrt haproxy[8178]: 172.68.28.154:10441 [26/Aug/2025:06:58:03.334] https_in/1: Connection closed during SSL handshake
2025-08-26T06:58:03+02:00 OpenWrt haproxy[8178]: 172.68.28.154:25149 [26/Aug/2025:06:58:03.558] https_in/1: Connection closed during SSL handshake
2025-08-26T06:58:03+02:00 OpenWrt haproxy[8178]: 172.68.28.154:50919 [26/Aug/2025:06:58:03.794] https_in/1: Connection closed during SSL handshake
2025-08-26T06:58:04+02:00 OpenWrt haproxy[8178]: 172.68.28.154:16675 [26/Aug/2025:06:58:04.026] https_in/1: Connection closed during SSL handshake
2025-08-26T08:11:47+02:00 OpenWrt haproxy[8178]: 104.152.52.123:34271 [26/Aug/2025:08:11:46.145] https_in/1: Connection closed during SSL handshake
2025-08-26T08:11:55+02:00 OpenWrt haproxy[8178]: 104.152.52.100:55795 [26/Aug/2025:08:11:54.049] https_in/1: Connection closed during SSL handshake
2025-08-26T14:26:19+02:00 OpenWrt haproxy[8178]: 3.143.33.63:38954 [26/Aug/2025:14:26:09.719] https_in/1: Connection closed during SSL handshake
2025-08-26T14:58:38+02:00 OpenWrt haproxy[8178]: 3.134.148.59:46574 [26/Aug/2025:14:58:28.695] https_in/1: Connection closed during SSL handshake
2025-08-26T20:06:21+02:00 OpenWrt haproxy[8178]: 199.30.231.5:49038 [26/Aug/2025:20:06:20.828] https_in/1: Connection closed during SSL handshake
2025-08-26T20:30:11+02:00 OpenWrt haproxy[8178]: 172.68.83.205:40075 [26/Aug/2025:20:30:11.012] https_in/1: Connection closed during SSL handshake
2025-08-26T20:30:11+02:00 OpenWrt haproxy[8178]: 172.68.83.205:25141 [26/Aug/2025:20:30:11.208] https_in/1: Connection closed during SSL handshake
2025-08-26T20:30:11+02:00 OpenWrt haproxy[8178]: 172.68.83.205:21741 [26/Aug/2025:20:30:11.405] https_in/1: Connection closed during SSL handshake
2025-08-26T20:30:11+02:00 OpenWrt haproxy[8178]: 172.68.83.205:31893 [26/Aug/2025:20:30:11.604] https_in/1: Connection closed during SSL handshake
2025-08-26T20:30:11+02:00 OpenWrt haproxy[8178]: 172.68.83.205:11609 [26/Aug/2025:20:30:11.797] https_in/1: Connection closed during SSL handshake
7 changes: 7 additions & 0 deletions parsers/s01-parse/crowdsecurity/haproxy-logs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ nodes:
statics:
- meta: log_type
value: bad_ssl_handshake

- grok:
pattern: '%{IP:client_ip}:%{INT:client_port} \[%{HAPROXYDATE:accept_date}\] %{NOTSPACE:frontend_name}/%{NOTSPACE:server_name}: Connection closed during SSL handshake'
apply_on: message
statics:
- meta: log_type
value: no_ssl_handshake

statics:
#HAPROXYDATE format is unknown to dateparse, let convert it to a format we know to parse
Expand Down