diff --git a/docs/cli.md b/docs/cli.md index 510fe87..1bb5405 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -57,4 +57,5 @@ These command help you to create and manage detection rules in CLI interface. | -m -method | - | | -c -status | - | | -t -ttl | -(if not used default ban 1 year) | + You must specify at least 1 of the optional flags to create a rule. diff --git a/docs/config.md b/docs/config.md index e69de29..89c7c64 100644 --- a/docs/config.md +++ b/docs/config.md @@ -0,0 +1,45 @@ +# Configs + +## config.toml +Main configuration file for BanForge. + +Example: +```toml +[firewall] + name = "nftables" + config = "/etc/nftables.conf" + +[[service]] + name = "nginx" + log_path = "/home/d3m0k1d/test.log" + enabled = true + +[[service]] + name = "nginx" + log_path = "/var/log/nginx/access.log" + enabled = false +``` +**Description** +The [firewall] section defines firewall parameters. The banforge init command automatically detects your installed firewall (nftables, iptables, ufw, firewalld). For firewalls that require a configuration file, specify the path in the config parameter. + +The [[service]] section is configured manually. Currently, only nginx is supported. To add a service, create a [[service]] block and specify the log_path to the nginx log file you want to monitor. + + +## rules.toml +Rules configuration file for BanForge. + +If you wanna configure rules by cli command see [here](https://github.com/d3m0k1d/BanForge/blob/main/docs/cli.md) + +Example: +```toml +[[rule]] + name = "304 http" + service = "nginx" + path = "" + status = "304" + method = "" + ban_time = "1m" +``` +**Description** +The [[rule]] section require name and one of the following parameters: service, path, status, method. To add a rule, create a [[rule]] block and specify the parameters. +ban_time require in format "1m", "1h", "1d", "1M", "1y"