Suricata là gì?
Suricata là công cụ IDS/IPS/NSM (Intrusion Detection/Prevention System & Network Security Monitoring) mã nguồn mở, hiệu năng cao, đa luồng (multi-threaded), được phát triển bởi Open Information Security Foundation (OISF). Thay thế/thêm cho Snort.
Cách hoạt động
- Capture: Thu gói tin qua libpcap, AF_PACKET, NFQUEUE, netmap, DPDK...
- Decode & Pre-process: Giải mã lớp 2-7, reassembly stream, normalize
- Detection Engine: So khớp signature (rules), anomaly detection, file extraction
- Output: Alert (EVE JSON, unified2), log pcap, drop packet (IPS mode)
Khả năng phát hiện
- Signature-based: Rules Emerging Threats (ET), ET Pro, Snort rules, custom rules
- Protocol detection (Layer 7): HTTP, TLS/SSL, FTP, SMB, DNS, SSH, SMTP...
- File identification/extraction: Magic bytes, MD5/SHA256 checksums, lưu file đáng ngờ
- Anomaly detection: Kết hợp Isolation Forest, machine learning (tùy cấu hình)
- TLS/SSL inspection: JA3 fingerprinting, certificate validation, SNI analysis
Triển khai thực tế
Chế độ IDS (Passive)
Mirror traffic (SPAN/TAP) → Suricata phân tích → Alert → SIEM (Elastic, Splunk, Graylog)
Chế độ IPS (Inline)
NFQUEUE/iptables hoặc AF_PACKET IPS mode → Suricata drop/block gói tin độc hại real-time
Cài đặt nhanh trên Ubuntu/Debian
sudo apt update
sudo apt install suricata
sudo suricata-update # cập nhật rules ET Open
sudo systemctl enable --now suricata
Cấu hình quan trọng (/etc/suricata/suricata.yaml)
HOME_NET: dải IP nội bộ cần bảo vệEXTERNAL_NET: không gian IP bên ngoàirule-files: bật/tắt bộ rulesoutputs.eve-log: bật JSON output cho SIEMaf-packet / nfqueue: cấu hình capture mode
So sánh Suricata vs Snort
| Tiêu chí | Suricata | Snort |
|---|---|---|
| Kiến trúc | Multi-threaded | Single-threaded (v2), multi-threaded (v3+) |
| Hiệu năng | Cao hơn trên đa nhân | Thấp hơn trên cùng phần cứng |
| Protocol parsing | Mạnh (Rust-based app-layer) | Tốt, nhưng chậm hơn |
| File extraction | Built-in, mạnh | Cần OpenAppID/extra |
| Rules compatibility | Hỗ trợ Snort rules | Native |
Ai đang dùng Suricata?
- Code42, Carnegie Mellon University, các ISP, SOC, MSSP
- AWS Network Firewall (hỗ trợ Suricata rules)
- Nhiều giải pháp NDR/XDR thương mại nhúng Suricata engine
Kết luận
Suricata là lựa chọn hàng đầu cho giám sát mạng mã nguồn mở, hiệu năng cao, hỗ trợ rules Snort, trích xuất file, phân tích TLS, và triển khai IDS/IPS linh hoạt. Phù hợp cho doanh nghiệp, SOC, nhà nghiên cứu bảo mật.