docs: Add new docs and fix rule command
All checks were successful
CI.yml / build (push) Successful in 1m53s
All checks were successful
CI.yml / build (push) Successful in 1m53s
This commit is contained in:
@@ -29,7 +29,11 @@ var AddCmd = &cobra.Command{
|
|||||||
fmt.Printf("Rule name can't be empty\n")
|
fmt.Printf("Rule name can't be empty\n")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
if service == "" && path == "" && status == "" && method == "" {
|
if service == "" {
|
||||||
|
fmt.Printf("Service name can't be empty\n")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
if path == "" && status == "" && method == "" {
|
||||||
fmt.Printf("At least 1 rule field must be filled in.")
|
fmt.Printf("At least 1 rule field must be filled in.")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|||||||
51
docs/cli.md
Normal file
51
docs/cli.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# CLI commands BanForge
|
||||||
|
BanForge provides a command-line interface (CLI) to manage IP blocking,
|
||||||
|
configure detection rules, and control the daemon process.
|
||||||
|
## Commands
|
||||||
|
### init - create a deps file
|
||||||
|
|
||||||
|
```shell
|
||||||
|
banfogre init
|
||||||
|
```
|
||||||
|
|
||||||
|
**Description**
|
||||||
|
This command creates the necessary directories and base configuration files
|
||||||
|
required for the daemon to operate.
|
||||||
|
### daemon - Starts the BanForge daemon process
|
||||||
|
|
||||||
|
```shell
|
||||||
|
banforge daemon
|
||||||
|
```
|
||||||
|
|
||||||
|
**Description**
|
||||||
|
This command starts the BanForge daemon process in the background.
|
||||||
|
The daemon continuously monitors incoming requests, detects anomalies,
|
||||||
|
and applies firewall rules in real-time.
|
||||||
|
|
||||||
|
### firewall - Manages firewall rules
|
||||||
|
```shell
|
||||||
|
banforge ban <ip>
|
||||||
|
banforge unban <ip>
|
||||||
|
```
|
||||||
|
|
||||||
|
**Description**
|
||||||
|
These commands provide an abstraction over your firewall. If you want to simplify the interface to your firewall, you can use these commands.
|
||||||
|
|
||||||
|
### rule - Manages detection rules
|
||||||
|
|
||||||
|
```shell
|
||||||
|
banforge rule add -n rule.name -m 403
|
||||||
|
banforge rule list
|
||||||
|
```
|
||||||
|
|
||||||
|
**Description**
|
||||||
|
These command help you to create and manage detection rules in CLI interface.
|
||||||
|
|
||||||
|
| Flag | Required |
|
||||||
|
| ----------- | -------- |
|
||||||
|
| -n -name | + |
|
||||||
|
| -s -service | + |
|
||||||
|
| -p -path | - |
|
||||||
|
| -m -method | - |
|
||||||
|
| -c -status | - |
|
||||||
|
You must specify at least 1 of the optional flags to create a rule.
|
||||||
0
docs/config.md
Normal file
0
docs/config.md
Normal file
Reference in New Issue
Block a user