| title | Dashboards Suricata & CrowdSec dans UTMStack | DoIt4Everyone |
|---|---|
| description | Création des dashboards UTMStack v11.2.8 pour Suricata et CrowdSec. Visualisations OpenSearch, threat map, géolocalisation, index v11-log-suricata-*. |
| lang | fr |
L'intégration native Suricata (port 7019) crée l'index v11-log-suricata-* avec les champs parsés automatiquement par UTMStack :
| Champ | Contenu | Exemple |
|---|---|---|
log.eventType |
Type d'événement EVE | alert, http, anomaly, dns |
log.alert.signature |
Nom de la règle Suricata | ET SCAN Zmap User-Agent |
log.alert.severity |
Sévérité (1=High, 3=Low) | 1 |
log.alert.category |
Catégorie de l'alerte | Network Scan |
origin.ip |
IP source de l'attaque | 40.124.175.174 |
origin.geolocation.country |
Pays d'origine | United States |
origin.geolocation.city |
Ville | Des Moines |
origin.geolocation.countryCode |
Code ISO pays | US |
origin.geolocation.latitude |
Latitude | 41.6021 |
origin.geolocation.longitude |
Longitude | -93.6124 |
target.ip |
IP cible | 10.100.1.254 |
ℹ️ La géolocalisation est enrichie automatiquement par UTMStack — aucune configuration supplémentaire nécessaire.
New Visualization → Metric
- Source :
v11-log-suricata-* - Filter :
log.eventType.keywordisalert - Aggregation :
Count - Custom label :
Total Alertes Suricata - Save →
Suricata - Total Alertes
New Visualization → Bar horizontal
- Source :
v11-log-suricata-* - Buckets → Split axis :
- Aggregation :
Terms - Field :
log.eventType.keyword - Size :
10 - Order : Descending
- Aggregation :
- Save →
Suricata - Types d'événements
Types attendus : alert, http, anomaly, dns, flow
New Visualization → Bar horizontal
- Source :
v11-log-suricata-* - Filter :
log.eventType.keywordisalert - Buckets → Split axis :
- Aggregation :
Terms - Field :
log.alert.signature.keyword - Size :
10 - Order : Descending
- Aggregation :
- Save →
Suricata - Top Signatures
New Visualization → Table
- Source :
v11-log-suricata-* - Filter :
log.eventType.keywordisalert - Buckets → Split rows :
- Aggregation :
Terms - Field :
log.alert.signature.keyword - Size :
100 - Order : Descending
- Aggregation :
- Save →
Suricata - Top Signatures Table
New Visualization → Line
- Source :
v11-log-suricata-* - Filter :
log.eventType.keywordisalert - Buckets → X-axis :
- Aggregation :
Date Histogram - Field :
@timestamp - Minimum interval :
Hour
- Aggregation :
- Save →
Suricata - Timeline Alertes
New Visualization → Bar horizontal
- Source :
v11-log-suricata-* - Filter :
log.eventType.keywordisalert - Buckets → Split axis :
- Aggregation :
Terms - Field :
origin.ip.keyword - Size :
10 - Order : Descending
- Aggregation :
- Save →
Suricata - Top Source IPs
New Visualization → Bar horizontal
- Source :
v11-log-suricata-* - Filter :
log.eventType.keywordisalert - Buckets → Split axis :
- Aggregation :
Terms - Field :
origin.geolocation.country.keyword - Size :
10 - Order : Descending
- Aggregation :
- Save →
Suricata - Top Pays
ℹ️ La visualisation Region map (carte monde) n'est pas fonctionnelle dans UTMStack v11.2.8 — utiliser le Bar horizontal pays à la place.
ℹ️ Ce widget utilise
origin.geolocation.country.keyword(nom complet : "United States") pour le Dashboard Suricata. Le widget "Top Pays — Alertes Suricata" dans le Dashboard CrowdSec utiliseorigin.geolocation.countryCode.keyword(code ISO : "US") pour une meilleure lisibilité côte à côte avec les bans CrowdSec.
Dashboards → New Dashboard → Add Visualization — ajouter les 7 visualisations :
[ Suricata - Total Alertes ] [ Suricata - Types d'événements ]
[ Suricata - Top Signatures ] [ Suricata - Timeline Alertes ]
[ Suricata - Top Signatures Table ]
[ Suricata - Top Source IPs ] [ Suricata - Top Pays ]
Save dashboard → Dashboard Suricata
Les décisions CrowdSec arrivent dans l'index v11-log-syslog-*. Les données sont filtrées par la présence de CROWDSEC_BAN dans le champ raw.
Format d'un événement dans raw (format JSON depuis la mise à jour de soar_ban.sh) :
<169>May 28 18:16:31 ms.bsculier.ch crowdsec[33276]: CROWDSEC_BAN {"event_type":"ban","ip":"45.67.246.120","reason":"utmstack","country":"ES","as":"214678","type":"ban"}
Le champ country dans le JSON est extrait automatiquement par un ingest pipeline OpenSearch et indexé comme champ structuré crowdsec_country :
# Création de l'ingest pipeline (à effectuer une seule fois)
docker exec $(docker ps -q -f name=utmstack_node1) curl -sk \
-u 'admin:<password>' \
-X PUT "https://localhost:9200/_ingest/pipeline/crowdsec-country" \
-H "Content-Type: application/json" \
-d '{
"description": "Extract country from CROWDSEC_BAN syslog",
"processors": [
{
"script": {
"lang": "painless",
"source": "if (ctx.raw != null && ctx.raw.contains(\"CROWDSEC_BAN\")) { def m = /country[=:\\\"]([A-Z]{2})/.matcher(ctx.raw); if (m.find()) { ctx.crowdsec_country = m.group(1); } }"
}
}
]
}'
# Application du pipeline à l'index du jour courant (remplacer la date)
docker exec $(docker ps -q -f name=utmstack_node1) curl -sk \
-u 'admin:<password>' \
-X PUT "https://localhost:9200/v11-log-syslog-$(date +%Y-%m-%d)/_settings" \
-H "Content-Type: application/json" \
-d '{"index.default_pipeline": "crowdsec-country"}'
# Template pour tous les futurs index v11-log-syslog-* (automatique dès le lendemain)
docker exec $(docker ps -q -f name=utmstack_node1) curl -sk \
-u 'admin:<password>' \
-X PUT "https://localhost:9200/_index_template/utmstack-syslog-crowdsec" \
-H "Content-Type: application/json" \
-d '{
"index_patterns": ["v11-log-syslog-*"],
"priority": 1,
"template": {
"settings": {
"index.default_pipeline": "crowdsec-country"
}
}
}'ℹ️ Le pipeline s'applique automatiquement aux nouveaux index
v11-log-syslog-*via le template OpenSearch. Vérification :curl ... "https://localhost:9200/v11-log-syslog-$(date +%Y-%m-%d)/_settings" | grep pipeline
| Champ | Contenu | Exemple |
|---|---|---|
raw |
Message syslog brut complet | CROWDSEC_BAN {"event_type":"ban","ip":"45.67.246.120",...} |
crowdsec_country |
Code ISO pays extrait par le pipeline | ES, US, MX |
New Visualization → Metric
- Source :
v11-log-syslog-* - Filter :
rawcontainsCROWDSEC_BAN - Aggregation :
Count - Custom label :
Bans CrowdSec - Save →
CrowdSec - Total Bans
New Visualization → Line
- Source :
v11-log-syslog-* - Filter :
rawcontainsCROWDSEC_BAN - Buckets → X-axis :
- Aggregation :
Date Histogram - Field :
@timestamp - Minimum interval :
Hour
- Aggregation :
- Save →
CrowdSec - Timeline Bans
New Visualization → Table
- Source :
v11-log-syslog-* - Filter :
rawcontainsCROWDSEC_BAN - Buckets → Split rows :
- Aggregation :
Terms - Field :
raw.keyword - Size :
50 - Order : Descending
- Aggregation :
- Save →
CrowdSec - Derniers Bans
New Visualization → Bar horizontal
- Source :
v11-log-syslog-* - Filter :
rawcontainCROWDSEC_BAN - Buckets → Split axis :
- Aggregation :
Terms - Field :
crowdsec_country.keyword - Size :
10 - Order : Descending
- Aggregation :
- Save →
Top Pays — Bans CrowdSec
ℹ️ Nécessite l'ingest pipeline
crowdsec-countryactif (voir section précédente). Le champcrowdsec_countryn'est indexé que sur les événements arrivés après la mise en place du pipeline.
New Visualization → Bar horizontal
- Source :
v11-log-suricata-* - Filter :
log.eventTypecontainalert - Buckets → Split axis :
- Aggregation :
Terms - Field :
origin.geolocation.countryCode.keyword - Size :
10 - Order : Descending
- Aggregation :
- Save →
Top Pays — Alertes Suricata
ℹ️ Ce widget est placé dans le Dashboard CrowdSec pour avoir une vue consolidée des menaces géographiques — bans vs alertes côte à côte.
New Visualization → Metric
- Source :
v11-log-suricata-* - Filter :
log.eventTypeisdrop - Aggregation :
Count - Custom label :
Drops IPS - Save →
Suricata - Drops IPS
ℹ️ Les événements
dropsont les paquets bloqués silencieusement par Suricata en mode IPS. Ils ne génèrent pas d'alerte UTMStack — uniquement comptabilisables via ce widget.
New Visualization → Metric
- Source :
v11-log-suricata-* - Filter :
log.alert.actionisblocked - Aggregation :
Count - Custom label :
Blocked - Save →
Suricata - Blocked
New Visualization → Metric
- Source :
v11-log-suricata-* - Filter :
log.alert.actionisallowed - Aggregation :
Count - Custom label :
Allowed - Save →
Suricata - Allowed
ℹ️
Allowed > Blockedsignifie qu'il reste des règles en modealertà passer endrop(Spamhaus résiduel, CINS, ETN Aggressive).
New Visualization → Bar horizontal
- Source :
v11-log-suricata-* - Filter :
log.alert.actionisblocked - Buckets → Split axis :
- Aggregation :
Terms - Field :
log.alert.signature.keyword - Size :
10 - Order : Descending
- Aggregation :
- Save →
Top 10 blocked Suricata
[ Drops IPS ] [ Blocked ] [ Allowed ]
[ Top 10 blocked Suricata ]
[ Total Alertes ] [ Types événements ]
[ Top Signatures ] [ Top Pays ]
[ Threat Map ]
Résultats observés (24h) :
- Drops IPS : ~1 200 (BinaryEdge, Stretchoid, ShadowServer, Onyphe...)
- Blocked : ~1 600 (Dshield, Spamhaus DROP, NF-Scanners)
- Allowed : ~1 600 (CINS, ETN Aggressive, règles alert → candidats pour drop)
Dashboards → New Dashboard → Add Visualization :
[ CrowdSec - Total Bans ]
[ CrowdSec - Timeline Bans ]
[ CrowdSec - Derniers Bans ]
[ Top Pays — Bans CrowdSec ] [ Top Pays — Alertes Suricata ]
Save dashboard → Dashboard CrowdSec
Test Suricata :
logger -p local5.info -t suricata '{"event_type":"alert","timestamp":"now","src_ip":"1.2.3.4","alert":{"signature":"TEST RULE","severity":1}}'Test CrowdSec :
logger -p local5.alert -t crowdsec 'CROWDSEC_BAN {"event_type":"ban","ip":"1.2.3.4","reason":"test","country":"CH","as":"AS0","type":"ban"}'Les événements apparaissent dans les dashboards dans les 30 secondes.
ℹ️ Testé sur UTMStack v11.2.8, OpenSearch 2.x intégré