mirror of
https://github.com/pldubouilh/blockfast.git
synced 2026-08-27 20:36:34 -04:00
json & generic parser support
also added verbose flag and configurable HTTP statuses
This commit is contained in:
@@ -6,7 +6,9 @@ build::
|
||||
run::
|
||||
touch /tmp/sshdtest
|
||||
touch /tmp/clftest
|
||||
cargo run -- -s=/tmp/sshdtest -c=/tmp/clftest
|
||||
touch /tmp/jsontest
|
||||
touch /tmp/generictest
|
||||
cargo run -- -v -s=/tmp/sshdtest -c=/tmp/clftest -j=/tmp/jsontest --generic-logpath=/tmp/generictest --generic-ip='from ([0-9a-fA-F:.]+) port' --generic-positive='Failed password'
|
||||
|
||||
ci:: test
|
||||
cargo fmt --all -- --check
|
||||
@@ -33,9 +35,21 @@ hit-sshd::
|
||||
ok-sshd::
|
||||
echo "Sep 26 06:25:19 livecompute sshd[23246]: successful login 8.124.36.195 port 41883 ssh2" >> /tmp/sshdtest
|
||||
|
||||
hit-generic::
|
||||
echo "Sep 26 06:25:19 livecompute sshd[23246]: Failed password for root from 179.124.36.195 port 41883 ssh2" >> /tmp/generictest
|
||||
|
||||
ok-generic::
|
||||
echo "Sep 26 06:25:19 livecompute sshd[23246]: Successful login for root from 179.124.36.195 port 41883 ssh2" >> /tmp/generictest
|
||||
|
||||
hit-clf::
|
||||
echo "1.124.36.195 - p [25/Sep/2021:13:49:56 +0200] \"POST /some/rpc HTTP/2.0\" 401 923" >> /tmp/clftest
|
||||
|
||||
ok-clf::
|
||||
echo "2.124.36.195 - p [25/Sep/2021:13:49:56 +0200] \"POST /some/rpc HTTP/2.0\" 200 23012" >> /tmp/clftest
|
||||
|
||||
hit-json::
|
||||
echo "{\"request\":{\"remote_ip\":\"1.124.36.19\"}, \"status\": 400}" >> /tmp/jsontest
|
||||
|
||||
ok-json::
|
||||
echo "{\"request\":{\"remote_ip\":\"2.124.36.19\"}, \"status\": 200}" >> /tmp/jsontest
|
||||
|
||||
|
||||
Reference in New Issue
Block a user