# Filter to prevent DOS attacks from AI bots on my FosWIKI server
# Charles Shapiro 25 Aug 2025
# [INCLUDES]
# before = apache-common.conf

[Definition]
# datepattern = \[Day(?P<_sep>[-/])MON(?P=_sep)ExYear[ :]?24hour:Minute:Second(?:\.Microseconds)?(?: Zone offset)?\]
datepattern = ^[^\[]*\[({DATE})
               {^LN-BEG}
# prefregex = 

bots = (Bytespider|ClaudeBot|iboubot)
yourhost = tomshiro.org
foswikiroot = /foswiki

# failregex=^%(yourhost)s:(80|443) <IP4> - - \[\] "GET %(foswikiroot)s.+ HTTP/[0-9]+\.[0-9]+" 200 [0-9]{4,5} "-" ".+ %(bots)s.+"
failregex=^%(yourhost)s:(80|443) <IP4> - - \[\] "GET %(foswikiroot)s.+ HTTP/[0-9]+\.[0-9]+" [0-9]{3} [0-9]{3,5} .+%(bots)s.+$

# failregex=^.+ <HOST> .+$
# failregex = ^%(yourhost)s:(80|443) <IP4> - - \[\] "GET .+$
