Wazuh-Teams-Workflow/README.md

74 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Wazuh → Microsoft Teams (Workflows) Integration
Intégration Wazuh qui envoie des alertes vers Microsoft Teams via **Workflows** (webhook) en **Adaptive Card**.
Basé sur le template : https://github.com/jayzielinski/wazuh-teams-workflows/tree/main
## Fonctionnalités
- Envoi d'une Adaptive Card à Teams (Workflows webhook)
- Ajout d'un champ **IP Source** (extrait depuis le JSON dalerte ou `full_log`)
- Formatage des infos utiles (agent, rule, level, timestamp, etc.)
- **Ne transmet pas `full_log`** volontairement (privacy / bruit)
---
## Contenu
- custom-teams : Wrapper (Execute le script)
- custom-teams.py : Script workflow
---
prout
## Prérequis
- Wazuh Manager (intégrations dans `/var/ossec/integrations/`)
- Python fourni par Wazuh (framework)
- Accès à un webhook Teams (Workflows)
Pour vérifier la version de Python Wazuh :
```bash
/var/ossec/framework/python/bin/python3 --version
---
## Installation
1) Installer les dépendances Python dans lenvironnement Wazuh
```bash
/var/ossec/framework/python/bin/python3 -m pip install --upgrade pip
/var/ossec/framework/python/bin/python3 -m pip install -r requirements.txt```
2) Déployer les fichiers dintégration
Copier les fichiers
```bash
sudo cp custom-teams custom-teams.py /var/ossec/integrations/```
Mettre les droits
```bash
sudo chown root:wazuh /var/ossec/integrations/custom-teams /var/ossec/integrations/custom-teams.py
sudo chmod 750 /var/ossec/integrations/custom-teams
sudo chmod 750 /var/ossec/integrations/custom-teams.py```
---
##Test
Créer un log test
```bash
cat > /tmp/test.alert <<'EOF'
{"rule":{"level":15,"id":"999","description":"TEST"},"agent":{"name":"wazuh-manager"},"timestamp":"2026-01-22T16:30:00+0100","full_log":"hello"}
EOF```
Lancer le test
```bash
/var/ossec/framework/python/bin/python3 /var/ossec/integrations/custom-teams.py /tmp/test.alert "<URL_WEBHOOK>" 15```