- Setup stack Prometheus + Grafana trên server LAB Monitor
- Setup OpenSearch Exporter + Node Exporter trên hệ thống LAB siem (soc_lab_wazuh_ao1)
- Setup AlertManager notify Telegram: Hardware + healthcheck Opensearch
-
Download, unzip và cài đặt:
Prometheus here
Grafana here
Node-Exporter here
-
Cấu hình và khởi động dịch vụ:
Prometheus as a service (Lưu ý tạo file log và phân quyền trước khi start service). Di chuyển folder prometheus vừa unzip bước trên vào /usr/local/bin. Chuyển file prometheus.yml ra folder mới để tiện config /etc/prometheus/prometheus.yml. Đồng thời thêm các alert rules vào cùng folder đó.
Sau khi khởi chạy node-exporter và prometheus thì vào web Grafana add data source prometheus. Sau đó import ID dashboard node-exporter 11074 để check hardware server.
- Tạo folder exporter rồi tạo file docker-compose.yml để chạy exporter gồm 2 service opensearch-exporter và node-exporter.
-
Telegram Bot
Tạo bot mới trên Telegram bằng BotFather (tự search các tạo). Add bot vào group sau đó chat lần đầu để lấy chat id check trên https://api.telegram.org/bot(token)/getUpdates.
Tạo folder cho service telegram_bot gồm 2 phần:
-
File docker-compose.yml
-
Folder con tên telegrambot chứa 2 file: config + template.
-
-
AlertManager
Download và unzip: AlertManager here
AlertManager as a service (Lưu ý tạo file log và phân quyền trước khi start service). Di chuyển folder alertmanager vừa unzip bước trên vào /usr/local/bin. Chuyển file alertmanager.yml ra folder mới để tiện config /etc/alertmanager/alertmanager.yml (lưu ý trong url webhook_configs sửa chat id đã lấy được từ bước tạo telegram bot).
-
Sau khi khởi động xong 2 dịch vụ trên chúng ta sẽ lên web Grafana rồi import template để hiển thị Dashboard OpenSearch
- Dashboard Opensearch
- Nofify Telegram
-
Các thông số cảnh báo về Telegram:
Node-exporter:
- RAM
- CPU
- Disk Space (Write, Read)
- Network (IN, OUT)
OpenSearch-exporter:
- Missing node
- Missing data node
- Heap Too High
- Cluster YELLOW, RED
- Unassigned Shards
- Pending Tasks (*)
- JVM Heap Use High
- Process CPU High
-
Khắc phục định dạng alert bot trả kết quả:
Một số chỗ còn chưa rõ ràng do template rules alert chưa chuẩn
Tối ưu lại description và summary
-
Tích hợp thêm Blackbox exporter để cải thiện các thông báo trùng lặp trong rules Opensearch exporter