Merge branch 'main' of https://git.cci17.fr/l.bourdin/Wazuh-Teams-Workflow
This commit is contained in:
commit
aca6289ffa
|
|
@ -0,0 +1,13 @@
|
||||||
|
# secrets / configs locales
|
||||||
|
config.json
|
||||||
|
.env
|
||||||
|
|
||||||
|
# python
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
|
||||||
|
# editor
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
.DS_Store
|
||||||
|
|
@ -0,0 +1,81 @@
|
||||||
|
# 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
|
||||||
|
|
||||||
|
## Synthèse
|
||||||
|
|
||||||
|
Cette intégration permet de router les alertes Wazuh vers Microsoft Teams (Workflows) sous forme d'Adaptive Card pour améliorer la visibilité sécurité côté SOC.
|
||||||
|
|
||||||
|
En pratique, `custom-teams` exécute `custom-teams.py`, qui lit l'alerte Wazuh, extrait les informations prioritaires (agent, règle, niveau, horodatage, IP source), puis les envoie au webhook Teams.
|
||||||
|
|
||||||
|
Le design est volontairement sobre : le champ `full_log` n'est pas relayé afin de limiter le bruit et d'éviter l'exposition de données sensibles dans Teams.
|
||||||
|
|
||||||
|
## 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_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 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```
|
||||||
|
|
||||||
Loading…
Reference in New Issue