|
|
||
|---|---|---|
| .gitignore | ||
| README.md | ||
| custom-teams | ||
| custom-teams.py | ||
README.md
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 d’alerte ou
full_log) - Formatage des infos utiles (agent, rule, level, timestamp, etc.)
- Ne transmet pas
full_logvolontairement (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 :
/var/ossec/framework/python/bin/python3 --version
---
## Installation
1) Installer les dépendances Python dans l’environnement 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 d’inté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```