Go to file
Sean DuBois f8b218fc9a Add manpage 2014-10-27 03:08:29 -05:00
init-scripts Better comment for Debian init scripts, remove trailing white space in Ubuntu init file 2014-07-21 22:31:03 +00:00
CONTRIBUTING.md Start contributing.md 2014-07-24 05:09:15 +00:00
README.md Fix init scripts path in README.md 2014-07-21 07:09:14 +00:00
config.json Update config.json so fail2rest only bind to loopback 2014-06-18 06:30:02 +00:00
error.go Implement single error handler, start moving functions that discarded errors over to it 2014-07-07 23:43:30 +00:00
fail2rest.1 Add manpage 2014-10-27 03:08:29 -05:00
fail2rest.go Implement endpoint for running WHOIS queries 2014-07-10 00:54:26 +00:00
global.go Implement global/bans returns the contents of the Bans table from the persistent database introduced in 0.9.0 2014-07-16 05:20:33 +00:00
jail.go All fail2go communication now has error handling, JSON casting still has no error handling 2014-07-08 05:28:30 +00:00
whois.go Implement endpoint for running WHOIS queries 2014-07-10 00:54:26 +00:00

README.md

#fail2rest

##Overview fail2rest is a small REST server that aims to allow full administration of a fail2ban server via HTTP

fail2rest will eventually be used as a backend to a small web app to make fail2ban administration and reporting easier.

##Requirements fail2rest is written in Golang, so it requires a working Golang installation. If you have never used Golang before install it from your package manager, and then follow these instructions to setup your enviroment.

Some libraries currently are not building on older versions of Go, I recommend running the newest stable of Golang.

##Installing Once you have a working Golang installation all you need to do is run

go get -v github.com/Sean-Der/fail2rest
go install -v github.com/Sean-Der/fail2rest

fail2rest will now be available as a binary in your GOPATH, you can run 'fail2rest' from the command line, or copy it somewhere else to make it available to all users.

Use whereis fail2rest to locate your fail2rest binary. Next you need to configure fail2rest, and then finally make it a system service.

##Configuration fail2rest is configured via config.json, the default is located here. To load your config.json you use the --config flag fail2rest --config=my_config.json

fail2rest has two options that be configured via config.json

  • Fail2banSocket - The path to the fail2ban socket, can usually be found via grep socket /etc/fail2ban/fail2ban.conf you also have to run fail2rest as a user who has permissions to use this socket
  • Addr - The address that fail2rest is served upon, it is usually best so serve to the loopback, and then allow access via nginx see an example config in the fail2web repository

##Running Once you have a config.json all you need to do is run fail2rest --config config.json

However, fail2rest is designed to run as a service, so init scripts are provided that allow easy management of fail2rest. They can be found here Download the appropriate init file your Distribution. You may need to customize your init script to load your config.json, but most scripts default to /etc/fail2rest.json

##License The MIT License (MIT)

Copyright (c) 2014 Sean DuBois

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.