Compare commits
2 Commits
1d74c6142b
...
322f5161cb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
322f5161cb | ||
|
|
4e80b5148d |
@@ -34,7 +34,7 @@ archives:
|
||||
nfpms:
|
||||
- id: banforge
|
||||
package_name: banforge
|
||||
file_name_template: "{{ .PackageName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||
file_name_template: "banforge"
|
||||
homepage: https://gitea.d3m0k1d.ru/d3m0k1d/BanForge
|
||||
description: BanForge IPS log-based system
|
||||
maintainer: d3m0k1d <contact@d3m0k1d.ru>
|
||||
|
||||
@@ -11,19 +11,22 @@ Example:
|
||||
|
||||
[[service]]
|
||||
name = "nginx"
|
||||
logging = "file"
|
||||
log_path = "/home/d3m0k1d/test.log"
|
||||
enabled = true
|
||||
|
||||
[[service]]
|
||||
name = "nginx"
|
||||
log_path = "/var/log/nginx/access.log"
|
||||
logging = "journald"
|
||||
log_path = "nginx"
|
||||
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.
|
||||
|
||||
logging require in format "file" or "journald"
|
||||
if you use journald logging, log_path require in format "service_name"
|
||||
|
||||
## rules.toml
|
||||
Rules configuration file for BanForge.
|
||||
|
||||
@@ -46,8 +46,7 @@ func NewScannerTail(path string) (*Scanner, error) {
|
||||
}
|
||||
|
||||
func NewScannerJournald(unit string) (*Scanner, error) {
|
||||
cmd := exec.Command("journalctl", "-u", unit, "-f", "-n", "0", "-o", "cat", "--no-pager")
|
||||
|
||||
cmd := exec.Command("journalctl", "-u", unit, "-f", "-n", "0", "-o", "short", "--no-pager")
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user