Hassio + fail2ban

Anyone have a guide for setting up fail2ban with hassio?
The docker part of hassio makes me think if I followed a rpi3 guide it won’t be the same.

Actually looking to see if
install fail2ban on the host then map the access log file from the hass container to the host.

Not familiar with docker commands

Hi, did you have any success with this? Thanks :slight_smile:

I’d love the same… pity no one is responding.
Curious did either of you folks manage to muddle your way through and get it going?
Is there a guide that’s been created since posting this?

Hi, I’m running Home Assistant (former hassio) and i found out that fail2ban is included without the need of any external add-on. Search for this option

ip_ban_enabledboolean(optional, default: false)
Flag indicating whether additional IP filtering is enabled.

in the http module: https://www.home-assistant.io/integrations/http/

1 Like

Thanks so much @kitus for replying!
I tried that previously I was lost my front end.
I had to go in via the CLI on the host machine and exec into docker to modify my configuration.yaml file to comment out the lines…
This is what I had

  base_url: https://somethinghere.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
# ip_ban_enabled: true
# login_attempts_threahold: 5

When I removed the #'s and restarted HA, no front end either web or app…
I had kittens for around 30 minutes while I traced my steps back.

Am I missing something silly?

I’m on my phone but I think your config looks good (once the # have been removed). Before enabling this I suggest you look for the lock file this creates and make sure your ip is not listed there (when ip ban flags an ip, it will list it in that file). I would also suggest to log in during testing from an incognito window, just in case.

okay, I’ve configured things a bit better now.
I’ll test it.
Good trick with the incognito browser too. :wink:
I think I might be okay now.
Makes be feel a little better.
Thanks so much!

My pleasure. Happy to see I’ve been helpful!!

1 Like