n8nsoarautomation
MDstable
NoteSnippetChecklistPlaybook
n8n — Automatisation de Workflows SOC
n8n comme SOAR léger : workflows d'automatisation SOC, intégration Wazuh/TheHive/MISP, alertes et réponses automatisées
snippetbeginner 2026-06-19 4 min read
n8nsoarautomationworkflowsoclow-code
n8n vs Shuffle
n8n Low-code/no-code gnral 400 intgrations UI trs accessibleShuffle SOAR spcialis scu apps security natives VQL supportUsage SOCn8n Workflows simples notifications enrichissement rapideShuffle Orchestration complexe rponse automatise avanceLes deux peuvent coexister dans un SOC
Déploiement Docker
yaml
# docker-compose.ymlservices:n8n:image: n8nio/n8n:latestports:- "5678:5678"environment:- N8N_BASIC_AUTH_ACTIVE=true- N8N_BASIC_AUTH_USER=admin- N8N_BASIC_AUTH_PASSWORD=ChangeMe!2026- N8N_HOST=localhost- N8N_PORT=5678- N8N_PROTOCOL=http- WEBHOOK_URL=http://localhost:5678/- GENERIC_TIMEZONE=Europe/Paris- N8N_ENCRYPTION_KEY=votre_cle_32_chars_aleatoirevolumes:- n8n_data:/home/node/.n8nvolumes:n8n_data:
# Accès : http://localhost:5678# Login : admin / ChangeMe!2026
Concepts n8n
Workflow Squence de nodes connectsNode Bloc daction HTTP request IF Webhook EmailTrigger Node de dpart Webhook Schedule EmailCredential Config scurise daccs aux APIs
Workflow 1 — Alerte Wazuh → Slack + TheHive
Trigger WebhookURL http//n8n5678/webhook/wazuh-alertsMethod POSTNode IF ConditionLevel > 10Oui NonNode TheHive HTTP Node Slack message simplePOST /api/v1/case #soc-infotitle Alert "ℹ️ Alerte niveau {{level}}"Node Slack #soc-alerts)"🚨 Case créé #{{case_id}}"
json
// Configuration node HTTP Request → TheHive{"method": "POST","url": "http://thehive:9000/api/v1/case","authentication": "predefinedCredentialType","nodeCredentialType": "httpHeaderAuth","sendHeaders": true,"headerParameters": {"Authorization": "Bearer {{$credentials.token}}"},"sendBody": true,"contentType": "json","body": {"title": "Wazuh: {{$json.rule.description}}","severity": 2,"tags": ["wazuh", "auto"],"description": "Agent: {{$json.agent.name}}\nRule: {{$json.rule.id}}\nLevel: {{$json.rule.level}}"}}
Workflow 2 — Schedule : Rapport quotidien SOC
Trigger Schedule tous les joursNode HTTP Request Wazuh APIGET /security/eventslimit100&level10alertes niveau 10 des derniresNode HTTP Request TheHive APIGET /api/v1/casestatusOpencases ouvertsNode HTTP Request MISP APIGET /events/restSearchlastnouveaux events MISPNode Code JavaScriptAssembler le rapportRapport SOC $today}Alertes Wazuh lvl 10 alerteslengthCases TheHive ouverts caseslengthNouveaux events MISP misplengthNode Email SlackEnvoyer le rapport #soc-daily
Workflow 3 — Enrichissement IOC automatique
Trigger Webhook TheHive cre un observableNode Switch type dobservableip AbuseIPDB VirusTotaldomain URLScanio VirusTotalhash VirusTotalNode HTTP Request API enrichissementNode Code Calculer score de risquescore 0if vt_positifs > 5 score 50if abuse_score > 70 score 30if urlscan_malicious score 20Node IF score > 60Oui NonTheHive Update observable TheHive Add tag "benign"tag "malicious"note "Score: {{score}}"Slack "#soc-ioc — IOC {{value}} score {{score}}/100"
Credentials — Configuration sécurisée
# Dans n8n : Settings > Credentials > Add CredentialTheHiveType Header AuthName X-Organisation-API-Key ou AuthorizationValue Bearer THEHIVE_API_KEYMISPType Header AuthName AuthorizationValue MISP_API_KEYWazuhType Basic AuthUser wazuh-wuiPassword WAZUH_PASSWORDSlackType OAuth2 ou Webhook URLWebhook URL https//hooks.slack.com/services/XXXVirusTotalType Header AuthName x-apikeyValue VT_API_KEY
Workflow 4 — Réponse phishing automatisée
Trigger Email IMAP bote phishingcompanycomNode Extract Email Datafrom subject body attachments URLsNode HTTP URLScanio analyser chaque URLNode IF URL malveillanteOuiNode MISP Crer event domain malveillantNode TheHive Crer case "Phishing signalé"Node Email Rpondre lutilisateurMerci pour le signalement Email confirm malveillantNe pas cliquer sur les liens Rapport en coursNonNode Email Rpondre"Merci. Email analysé, aucune menace détectée."
Templates de nodes utiles
javascript
// Node Code — Parser une alerte Wazuhconst alert = $input.first().json;return [{json: {title: `Wazuh Alert: ${alert.rule?.description}`,agent: alert.agent?.name || 'unknown',ip: alert.data?.srcip || alert.agent?.ip,level: alert.rule?.level,ruleId: alert.rule?.id,timestamp: alert.timestamp,severity: alert.rule?.level >= 12 ? 3 : alert.rule?.level >= 8 ? 2 : 1,}}];
javascript
// Node Code — Formatter rapport Markdownconst alerts = $('Wazuh-Alerts').all();const cases = $('TheHive-Cases').all();const report = `## 📊 Rapport SOC — ${new Date().toLocaleDateString('fr-FR')}**Alertes critiques (24h):** ${alerts.length}**Cases ouverts:** ${cases.length}### Top alertes:${alerts.slice(0,5).map(a =>`- [${a.json.rule?.level}] ${a.json.rule?.description}`).join('\n')}`;return [{ json: { report } }];
OPS·BRAIN v1.092 notes · Securitylocal