pistasjis / ListenCaddy

A Caddy plugin that checks for scrapers who try to find sensitive files and reports them to AbuseIPDB.
Apache License 2.0
10 stars 1 forks source link

Store abusive IPs somewhere, and prevent them from making requests #4

Open pistasjis opened 1 year ago

pistasjis commented 1 year ago

I am thinking maybe making a sqlite database or something like that would be good. Or a csv.

pistasjis commented 1 year ago

I am thinking maybe making a sqlite database or something like that would be good. Or a csv.

Main issue is that it could get quite slow if your database is massive.

pistasjis commented 1 year ago

However, sqlite is pretty reliable and easy to use for things like this. I don't know how to do stuff with csv, never really used it. But sql is something I definitely know.

pistasjis commented 1 year ago

Read something on the internet, sqlite is definitely faster than csv. So I will go with that

pistasjis commented 1 year ago

I talked to a Caddy developer and he told me Redis might be a good choice, because sqlite drivers for Go require cgo which will disqualify ListenCaddy from being listed on caddyserver.com. So Redis it is.

codesplode commented 8 months ago

You might also consider a simple key value store for this. It should be faster than sqlite and redis, and this implementation is entirely go, backed by the CoreOS team: https://github.com/etcd-io/bbolt

There is also an incredibly fast implementation by DGraph worth considering: https://github.com/dgraph-io/badger

codesplode commented 8 months ago

I found your project while looking for a module to make custom subrequests (notifying something like a web hook) when certain requests to caddy are made so your source so far has inspired me to consider making it due to the similar base needs.