corelight/suricata_exporter
GitHub: corelight/suricata_exporter
通过 Unix Socket 采集 Suricata 内部计数器并以 Prometheus 格式暴露运行指标,便于对 Suricata 进行性能监控和运维观测。
Stars: 27 | Forks: 15
# Suricata Prometheus Exporter
这是一个用于 Suricata 的 Prometheus Exporter,通过
[unix socket](https://suricata.readthedocs.io/en/suricata-6.0.0/unix-socket.html#interacting-via-unix-socket)
使用 `dump-counters` 来查询指标。
## 用法
```
$ ./suricata_exporter -h
Usage of ./suricata_exporter:
-suricata.socket-path string
Path to the Suricata Command socket. (default "/var/run/suricata.socket")
-version
Output version information.
-web.listen-address string
Address to listen on (default ":9917")
-quiet
supress logging messages when suricata is not enabled
-totals
Export only the overall global total metrics instead of per-thread metrics. (default false)
```
要验证 exporter 是否在你的 Suricata 设置中正常工作,请使用
以下命令查看部分捕获指标。
```
$ curl -s localhost:9917/metrics | grep kernel_packets_total
# HELP suricata_capture_kernel_packets_total
# TYPE suricata_capture_kernel_packets_total counter
suricata_capture_kernel_packets_total{thread="W#01-eth1"} 7744
suricata_capture_kernel_packets_total{thread="W#02-eth1"} 8435
suricata_capture_kernel_packets_total{thread="W#03-eth1"} 7564
suricata_capture_kernel_packets_total{thread="W#04-eth1"} 9747
```
你现在可以配置一个 [Prometheus server](https://prometheus.io/docs/prometheus/latest/getting_started/)
定期抓取 Suricata exporter 的数据,以便后续的
可视化和分析。
## 指标
目前会为 `decoder`、`flow`、`flow_bypassed`、
`app_layer` 和 `tcp` 生成每个线程的指标。`memuse` 的指标则是全局报告的。
## 兼容性
基于 Suricata 6.0.4 和 af-packet 开发。大多数受支持的指标
是硬编码的。
已针对 Suricata 7.0.0 进行更新,但并未添加所有的新指标。
标签:EVTX分析, Exporter, Golang, PB级数据处理, Suricata, Unix域套接字, 入侵检测系统, 安全可视化, 安全数据湖, 安全编程, 安全运维, 日志审计, 现代安全运营, 监控告警, 监控指标, 网络安全, 网络流量, 自定义请求头, 隐私保护