mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-11 13:47:05 +02:00
b88023dd8d8b5fdf5e3b7c02e264e01f9d243dd5
Fail2ban UI
A Swissmade, management interface for Fail2ban. It provides a modern dashboard to currently:
- View all Fail2ban jails and banned IPs
- Unban IP addresses directly
- Edit and save jail/filter configs
- Reload Fail2ban when needed
- See recent ban events
- More to come...
Built by Swissmakers GmbH.
Features
-
Basic Real-time Dashboard
- Automatically loads all jails, banned IPs, and last 5 ban events on page load.
-
Unban IPs
- Unban any blocked IP without needing direct CLI access.
-
Edit Fail2ban Configs
- Click on any jail name to open a modal with raw config contents (from
/etc/fail2ban/filter.d/*.confby default). - Save changes, then reload Fail2ban.
- Click on any jail name to open a modal with raw config contents (from
-
Responsive UI
- Built with Bootstrap 5.
-
Loading Overlay & Reload Banner
- Displays a loading spinner for all operations.
- Shows a reload banner when configuration changes occur.
Requirements
- Go 1.22.9+ (module-compatible)
- Fail2ban installed and running
- Linux environment with permissions to run
fail2ban-clientand read/write config files (e.g.,/etc/fail2ban/filter.d/) - Sufficient privileges to reload Fail2ban (run as
sudoor configure your system accordingly)
Installation & Usage
-
Clone the repository:
git clone https://github.com/swissmakers/fail2ban-ui.git cd fail2ban-ui -
Initialize or tidy Go modules (optional if you already have them):
go mod tidy -
Run the server (with
sudoif necessary):sudo go run ./cmd/serverBy default, it listens on port
:8080. -
Open the UI:
- Visit http://localhost:8080/ (or replace
localhostwith your server IP).
- Visit http://localhost:8080/ (or replace
-
Manage Fail2ban:
- See jails and banned IPs on the main dashboard
- Unban IPs via the “Unban” button
- Edit jail configs by clicking the jail name
- Save your changes, then reload Fail2ban using the top banner prompt
Security Considerations
- Running this UI typically requires root or sudo privileges to execute
fail2ban-clientand manipulate config files. - Consider restricting network access or using authentication (e.g., reverse proxy with Basic Auth or a firewall rule) to ensure only authorized users can access the dashboard.
- Make sure your Fail2ban logs and configs aren’t exposed publicly.
Contributing
We welcome pull requests and issues! Please open an issue if you find a bug or have a feature request.
- Fork this repository
- Create a new branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/my-feature - Open a pull request
License
GNU GENERAL PUBLIC LICENSE, Version 3
Languages
Go
49.5%
JavaScript
27.4%
HTML
14.6%
CSS
6.9%
Shell
1.4%
Other
0.2%