# failed logins from a single address before ban
# uncomment to override conf.bfd trig value
# TRIG="10"

# file must exist for rule to be active
REQ="/usr/sbin/vsftpd"

if [ -f "$REQ" ]; then
 LP="$AUTH_LOG_PATH"
 TLOG_TF="vsftpd"

 ## VSFTPD
 ARG_VAL=`$TLOG_PATH $LP $TLOG_TF | sed -e 's/::ffff://' | grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sed -e 's/::ffff://' | grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sed -n -e '/vsftpd:/s/.*authentication failure.* \([^ ]*\)\(.*\)ruser=\([^ ]*\).*rhost=/\3:\1/p' | tr ':' ' ' | awk '{print$2":"$1}'`
fi
