has anyone an easy way to harden self hosted Bitwarden with Fail2Ban?
I have tried in vain. I have read many posts but Fail2Ban never blocked.
The filter was correct and trying with
fail2ban-regex /root/bwdata/logs/identity/Identity/log.txt /etc/fail2ban/filter.d/bitwarden seemed to catch the correct lines. But the Jail never worked.
This is the standard self hosted BW running on Dietpi (debian).
running fail2ban-client status bitwarden I always get
Status for the jail: bitwarden
- Filter
- Currently failed: 0
- Total failed: 0
- Journal matches:`
- Actions`
- Currently banned: 0
- Total banned: 0
- Banned IP list:`
I think this is your problem, @manilx - your server is using RPi hardware, right? That can’t be a Bitwarden standard server install. That software does not run on ARM devices. You must be running server software created and distributed by someone other than Bitwarden. Could you please take your questions to their support community?
I believe just from the naming of the Distro itself, there are so many too many to know them all
But from what I can tell Dietpi is specialized to run on something even lightweight as a rRaspberry Pi and has ARM support, though if yours is on a Proxmox VM (hey another Proxmox homelabber) then it’s most likely running on the x86 which is also provided.
I believe David was just confused from the naming, as Bitwarden’s standard installer does not support ARM (but their new Unified beta does), though there has been much confusion on the topic as before the Unified beta, there are other 3rd party server software designed to look like an run Bitwarden clients.
Many articles incorrectly label these as being the same, but they are not and developers from both sides have attempted to make this clear, unfortunately there is still much confusion about it in the official community here.
Though steps are being taken to make the distinctions clearer as well for their respective communities. If you have any issues with the official product anyone in this community is glad to help. Even in the 3rd party communities, I have seen much engagement and support just wanting to be sure each product is being supported probably.
No problem.
I do use dietpi ontop of standard Debian11 on a X86 VM.
It removes A LOT of unneeded stuff and has build-in commands/scripts for 90% of daily admin jobs (backup, drive manager etc). So much easier than fiddling with bare bones Debian.
Anyway I install Fail2Ban via their software install (again because its easy and you can uninstall it). It blocks ssh etc just fine.
But Bitwarden is escaping me.
Adam from Bitwarden support suggested I post here if someone has tackled this:
" While our support channel is primarily intended to support Bitwarden installations, I appreciate that fail2ban is a popular tool in the self-hosting community, and having a viable configuration would be useful for our users."
Sounds good, and I think that’s a smart idea to use this distro for a lightweight VM.
This is a bit off-topic, so I hope you don’t mind, but why run the full BW docker stack rather than the BW unified docker container if you are trying to minimize your resource footprint on Proxmox? I recognize that the unified server is still in Beta, but it appears to be getting good reviews so far.
David
no special reason at all! I actually was using BW cloud (paid) and moved to Vaultwarden self-hosted because dietpi has an install for it and its one-click. I also had fail2ban working fine and blocking all false login attempts.
But then I saw a video from Lawrence Systems with howto install BW via Docker and I am a paying customer of BW. This is what I’ve done. Not that difficult also once I had that help.
I’ve seen the beta but as there was no hand holding I haven’t done that one.
I’m no Docker specialist or fan, need step by step info on that…
Hard to say what the issue is - did you check that your database is running and that the docker container is up and healthy? What do you get when you run docker ps in the host vm?
2143f8c410fe bitwarden/self-host:beta "/entrypoint.sh" 2 minutes ago Up 2 minutes 0.0.0.0:80->8080/tcp, :::80->8080/tcp root-bitwarden-1
4e1aebc4916e mariadb:10 "docker-entrypoint.s…" 19 minutes ago Up 19 minutes 3306/tcp root-db-1
4c76cb908d37 portainer/portainer-ce "/portainer" 44 minutes ago Up 20 minutes 8000/tcp, 9443/tcp, 0.0.0.0:9002->9000/tcp, :::9002->9000/tcp portainer
Seems all OK
Site entry is at port 80, ssl not working as I have no certs. I use Cloudflare tunnel from outside.
Have copied env vars from my other BW install (mail etc)
If that’s the case, you might try restarting the container. That may ‘kickstart’ things. Otherwise, you may have missed configuring something when you performed the initial setup. Did you follow the install instructions on Bitwarden.com? If so, I would be tempted to remove the container and just try again.
Not sure how long this is all taking, but if it doesn’t complete within a few minutes, there could be an issue. I would double-check all the config settings to be sure.
Hey @manilx feel free to share the issue you ran into with Unified, on the Github repo as a bug report:
While the Bitwarden unified deployment remains in beta release, we encourage you to report issues and give feedback via GitHub. Please use this issue template to report anything related to your Bitwarden unified deployment and check out this page to track known issues or join the discussion.