4 ms·
put a honeypot link in your site that only robots will hit because it’s hidden. make sure it’s not in robots.txt or ban it if you can in robots.txt. setup a rul
by weaksauce 1y ago
put a honeypot link in your site that only robots will hit because it’s hidden. make sure it’s not in robots.txt or ban it if you can in robots.txt. setup a rule that any ip that hits that link will get a 1 day ban in your fail2ban or the like.
- bwb 1y agoGot a good link to something on github that does this? I have to make sure legit bots don't get hit, as a huge percent of our traffic which helps the project stay active is from google, etc.
- subscribed 1y agoI did it manually and got fail2ban to read the access log anyway. The it's the permanent iptables rule, but could be CF API call as well.
- weaksauce 1y agohere's one example using rack attack on a rails app: https://github.com/pinballmap/pbm/blob/302ac638850711878ac618847b323fa7c2d9e3e3/config/initializers/rack_attack.rb#L27 https://github.com/pinballmap/pbm/blob/302ac638850711878ac61... https://github.com/pinballmap/pbm/blob/302ac638850711878ac618847b323fa7c2d9e3e3/config/robots.production.txt#L63 https://github.com/pinballmap/pbm/blob/302ac638850711878ac61... but it only bans for 3 hours. if they don't respect the hidden link and robots.txt they get banned.