Fail2ban integration

Is it possible to integrate something like fail2ban so that any attempt to login fails etc can be added to ip ban list.