通过Grafana Alerting/API 添加防火墙规则,实现自定义的拦截外网扫描功能
1.1K
防火墙策略接口,通过Grafana Alerting/API 添加防火墙规则,实现自定义的拦截外网扫描功能。只测试并实现了H3C
Alerting-> Contact pointshttp://your_docker_ip:80/banByGrafana{{- if gt (len .Alerts.Firing) 0 -}}
{{- range $index, $alert := .Alerts.Firing -}}
{{ index $alert.Annotations "description" }}
{{- end }}
{{- end }}
Alert rules, 在Description中填入
{{ range $k, $v := $values }}
{{ $v.Labels.ClientHost }}
{{ end }}
Notification policies, 将Alert rules与Contact points关联用户密码防火墙ip:portIP白名单(通过逗号分割) 1.1.1.1,2.2.2.0/24docker run -d --name firewall-policy-api --restart=always \
-p 80:80 \
-e SSH_USER=admin \
-e SSH_PASSWORD=your_password \
-e SSH_IP_PORT=192.168.0.1:22 \
-e IP_WHITE_LIST=1.1.1.1,2.2.2.0/24 \
jeessy/firewall-policy-api
curl http://your_docker_ip:80/banByIP?ip=1.1.1.1 配置Content type
Image
Digest
sha256:943bf5695…
Size
8.7 MB
Last updated
over 1 year ago
docker pull jeessy/firewall-policy-api