@ -11,9 +11,11 @@
- [Architecture ](#-architecture )
- [Installation ](#-installation )
- [Configuration ](#-configuration )
- [Configuration HTTPS ](#-configuration-https )
- [Système de Licence ](#-système-de-licence )
- [Utilisation ](#-utilisation )
- [Sécurité ](#-sécurité )
- [Personnalisation du Dashboard ](#-personnalisation-du-dashboard )
- [Dépannage ](#-dépannage )
- [API Reference ](#-api-reference )
- [Changelog ](#-changelog )
@ -40,6 +42,7 @@ Idéal pour :
| **Push vers Git** | Déployez une ou plusieurs applications Splunk vers votre repository Git |
| **Interface moderne** | Dashboard intuitif avec sélection visuelle des applications |
| **Multi-repository** | Support de GitHub, GitLab, Gitea, Bitbucket et tout serveur Git |
| **Support HTTPS** | Communication sécurisée avec certificats SSL |
| **Système de licence** | Gestion par fichier `.lic` sécurisé |
| **Credentials sécurisés** | Chiffrement des mots de passe Splunk |
| **Logs détaillés** | Traçabilité complète des opérations |
@ -51,7 +54,7 @@ Idéal pour :
```
pusher_app_prem/
├── bin/
│ ├── git_pusher.py # Serveur HTTP principal (port 9999)
│ ├── git_pusher.py # Serveur HTTP/HTTPS principal (port 9999)
│ ├── license_validator.py # Validation des licences
│ ├── license_generator.py # Génération des licences (vendeur)
│ ├── credentials_manager.py # Gestion sécurisée des credentials
@ -64,22 +67,26 @@ pusher_app_prem/
├── local/
│ ├── license.lic # Fichier de licence (après activation)
│ ├── .credentials # Credentials chiffrés
│ └── .key # Clé de chiffrement
│ ├── .key # Clé de chiffrement
│ └── certs/ # Certificats SSL
│ ├── server.crt
│ └── server.key
└── README.md
```
### Flux de données
```
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
┌───────────────── ┐ ┌────── ──────────────┐ ┌─────────────┐
│ Splunk │────▶│ Git Pusher │────▶│ Git Repo │
│ Dashboard │ │ Server:9999 │ │ (Remote) │
└─────────────┘ └──────────────┘ └─────────────┘
│ (HTTPS) │ │ (HTTP/HTTPS) │ │ │
└─────────────────┘ └────────────────────┘ └─────────────┘
│
┌──────┴──────┐
│ /opt/splunk/etc/apps/ │
│ (Applications locales)│
└──── ─────────────────────┘
└─────────────────────┘
```
---
@ -91,6 +98,7 @@ pusher_app_prem/
- Splunk Enterprise 8.x ou supérieur
- Python 3.7+
- Git installé sur le serveur (`yum install git` ou `apt install git` )
- OpenSSL (pour la génération des certificats HTTPS)
- Accès réseau vers votre repository Git
### Étapes d'installation
@ -125,13 +133,17 @@ Confirm Password: ********
✓ Credentials saved securely!
```
#### 3. Démarrer le serveur Git Pusher
#### 3. Configurer HTTPS (si Splunk est en HTTPS)
Voir la section [Configuration HTTPS ](#-configuration-https ).
#### 4. Démarrer le serveur Git Pusher
```bash
./start_git_pusher.sh start
```
#### 4 . Ouvrir le firewall (si nécessaire)
#### 5 . Ouvrir le firewall (si nécessaire)
```bash
# FirewallD
@ -142,19 +154,24 @@ sudo firewall-cmd --reload
sudo ufw allow 9999/tcp
```
#### 5 . Redémarrer Splunk
#### 6 . Redémarrer Splunk
```bash
/opt/splunk/bin/splunk restart
```
#### 6 . Accéder au dashboard
#### 7 . Accéder au dashboard
Ouvrez votre navigateur et allez sur :
```
http://VOTRE_IP_SPLUNK:8000/app/pusher_app_prem/git_pusher_-_deploy_applications
```
Ou en HTTPS :
```
https://VOTRE_IP_SPLUNK:8000/app/pusher_app_prem/git_pusher_-_deploy_applications
```
---
## ⚙️ Configuration
@ -201,6 +218,78 @@ export SPLUNK_HOME=/opt/splunk
| `local/license.lic` | Fichier de licence |
| `local/.credentials` | Credentials Splunk chiffrés |
| `local/.key` | Clé de chiffrement (générée automatiquement) |
| `local/certs/server.crt` | Certificat SSL |
| `local/certs/server.key` | Clé privée SSL |
---
## 🔒 Configuration HTTPS
Si votre Splunk est configuré en HTTPS, le serveur Git Pusher doit également être en HTTPS pour éviter les erreurs "Mixed Content" du navigateur.
### 1. Générer les certificats SSL
```bash
# Créer le dossier des certificats
mkdir -p /opt/splunk/etc/apps/pusher_app_prem/local/certs
# Générer un certificat auto-signé (valide 365 jours)
openssl req -x509 -newkey rsa:4096 \
-keyout /opt/splunk/etc/apps/pusher_app_prem/local/certs/server.key \
-out /opt/splunk/etc/apps/pusher_app_prem/local/certs/server.crt \
-days 365 -nodes -subj "/CN=git-pusher"
# Définir les permissions
chmod 600 /opt/splunk/etc/apps/pusher_app_prem/local/certs/server.key
chown -R splunk:splunk /opt/splunk/etc/apps/pusher_app_prem/local/certs/
```
### 2. Redémarrer le serveur
```bash
./start_git_pusher.sh restart
```
### 3. Vérifier que HTTPS fonctionne
```bash
curl -k https://127.0.0.1:9999/health
```
Vous devriez voir :
```json
{"status": "ok", "service": "git_pusher", "timestamp": "..."}
```
### 4. Accepter le certificat dans le navigateur
Comme le certificat est auto-signé, le navigateur ne lui fait pas confiance par défaut.
1. Ouvrez un nouvel onglet
2. Allez sur : `https://VOTRE_IP_SPLUNK:9999/health`
3. Cliquez sur ** "Avancé"** puis ** "Accepter le risque et continuer"**
4. Retournez sur le dashboard Splunk et rafraîchissez (Ctrl+Shift+R)
### 5. (Optionnel) Désactiver HTTPS
Si vous souhaitez forcer le mode HTTP :
```bash
cd /opt/splunk/etc/apps/pusher_app_prem/bin/
python3 git_pusher.py --no-ssl
```
### Vérification dans les logs
```bash
tail -20 /opt/splunk/var/log/splunk/git_pusher.log
```
Vous devriez voir :
```
SSL enabled using: /opt/splunk/etc/apps/pusher_app_prem/local/certs/server.crt
Git Pusher server listening on 0.0.0.0:9999 (HTTPS)
```
---
@ -328,6 +417,12 @@ Les credentials Splunk sont :
/opt/splunk/etc/apps/pusher_app_prem/local/.key
```
### Communication HTTPS
- Le serveur Git Pusher supporte HTTPS avec certificats SSL
- Les certificats auto-signés sont supportés
- Communication chiffrée entre le navigateur et le serveur
### Token Git
- Le token Git n'est **jamais stocké** sur le serveur
@ -342,10 +437,47 @@ Les credentials Splunk sont :
### Recommandations
1. ✅ Utiliser des tokens Git avec permissions minimales
2. ✅ Renouveler les tokens régulièrement
3. ✅ Utiliser HTTPS pour les repositories Git
4. ✅ Restreindre l'accès au dashboard aux administrateurs
1. ✅ Utiliser HTTPS pour Splunk et Git Pusher
2. ✅ Utiliser des tokens Git avec permissions minimales
3. ✅ Renouveler les tokens régulièrement
4. ✅ Utiliser HTTPS pour les repositories Git
5. ✅ Restreindre l'accès au dashboard aux administrateurs
---
## 🎨 Personnalisation du Dashboard
### Masquer les boutons d'édition
Pour empêcher la modification du dashboard par les utilisateurs, éditez le fichier XML :
```bash
nano /opt/splunk/etc/apps/pusher_app_prem/default/data/ui/views/git_pusher_-_deploy_applications.xml
```
Modifiez la première ligne :
```xml
< dashboard version = "1.1" script = "license_validation.js, git_pusher.js" hideEdit = "true" hideExport = "true" >
```
### Options disponibles
| Attribut | Description |
|----------|-------------|
| `hideEdit="true"` | Masque le bouton "Modifier" |
| `hideExport="true"` | Masque le bouton "Exporter" |
| `hideTitle="true"` | Masque le titre du dashboard |
| `hideSplunkBar="true"` | Masque la barre Splunk en haut |
| `hideAppBar="true"` | Masque la barre de l'application |
| `hideFooter="true"` | Masque le footer |
### Appliquer les changements
```bash
rm -rf /opt/splunk/var/run/splunk/appserver/*
/opt/splunk/bin/splunk restart
```
---
@ -380,7 +512,7 @@ sudo firewall-cmd --reload
### Erreur CORS
Les fichiers JavaScript doivent utiliser l'adresse IP du serveur, pas `127.0.0.1` .
Les fichiers JavaScript doivent utiliser l'adresse IP du serveur automatiquement .
Vérifier :
```bash
@ -392,6 +524,28 @@ Doit contenir :
const LICENSE_API_URL = window.location.protocol + '//' + window.location.hostname + ':9999';
```
### Erreur CORS avec HTTPS
Si vous voyez une erreur CORS avec HTTPS et un certificat auto-signé :
1. Ouvrez `https://VOTRE_IP:9999/health` dans un nouvel onglet
2. Acceptez le certificat
3. Retournez sur Splunk et rafraîchissez
### Erreur SSL "wrong version number"
Le serveur n'a pas activé SSL. Vérifiez :
```bash
# Les certificats existent-ils ?
ls -la /opt/splunk/etc/apps/pusher_app_prem/local/certs/
# Les logs montrent-ils SSL enabled ?
grep -i ssl /opt/splunk/var/log/splunk/git_pusher.log
```
Si les certificats n'existent pas, créez-les (voir section HTTPS).
### Les applications ne sont pas poussées
```bash
@ -399,7 +553,7 @@ const LICENSE_API_URL = window.location.protocol + '//' + window.location.hostna
tail -50 /opt/splunk/var/log/splunk/git_pusher.log
# Tester manuellement
curl -X POST "http://localhost:9999/health"
curl -k https://localhost:9999/health
```
### Erreur de licence
@ -412,6 +566,17 @@ hostname
python3 /opt/splunk/etc/apps/pusher_app_prem/bin/license_validator.py status
```
### Les boutons ne fonctionnent pas
Vérifiez la console du navigateur (F12). Si les fonctions ne sont pas définies, videz le cache :
```bash
rm -rf /opt/splunk/var/run/splunk/appserver/*
/opt/splunk/bin/splunk restart
```
Puis dans le navigateur : **Ctrl+Shift+R**
### Vider le cache Splunk
```bash
@ -436,7 +601,7 @@ rm -rf /opt/splunk/var/run/splunk/appserver/*
### Exemple : Health Check
```bash
curl http://localhost:9999/health
curl -k https ://localhost:9999/health
```
```json
@ -450,7 +615,7 @@ curl http://localhost:9999/health
### Exemple : Statut de licence
```bash
curl http://localhost:9999/license
curl -k https ://localhost:9999/license
```
```json
@ -470,7 +635,7 @@ curl http://localhost:9999/license
### Exemple : Push
```bash
curl -X POST "http://localhost:9999/push?git_url=https://github.com/user/repo.git& git_branch=main& git_token=TOKEN& commit_message=Update& apps=[{\"id\":\"my_app\"}]& user=admin"
curl -k - X POST "https ://localhost:9999/push?git_url=https://github.com/user/repo.git& git_branch=main& git_token=TOKEN& commit_message=Update& apps=[{\"id\":\"my_app\"}]& user=admin"
```
```json
@ -486,13 +651,16 @@ curl -X POST "http://localhost:9999/push?git_url=https://github.com/user/repo.gi
## 📝 Changelog
### Version 2.0.0 (Janv ier 2026)
### Version 2.0.0 (Févr ier 2026)
- ✨ Nouveau système de licence par fichier `.lic`
- 🔐 Credentials Splunk chiffrés
- 🔒 Support HTTPS avec certificats SSL
- 🎨 Interface utilisateur modernisée
- 📊 Badge de licence en temps réel
- 🔧 Script de gestion amélioré
- 🛡️ Options pour masquer les boutons d'édition du dashboard
- 📝 Logs détaillés
- 🐛 Correction des problèmes CORS
### Version 1.0.0
- 🚀 Version initiale
@ -514,8 +682,10 @@ curl -X POST "http://localhost:9999/push?git_url=https://github.com/user/repo.gi
Incluez dans votre rapport :
1. Version de Git Pusher
2. Version de Splunk
3. Logs (`/opt/splunk/var/log/splunk/git_pusher.log`)
4. Étapes pour reproduire le problème
3. Configuration (HTTP/HTTPS)
4. Logs (`/opt/splunk/var/log/splunk/git_pusher.log`)
5. Erreurs de la console navigateur (F12)
6. Étapes pour reproduire le problème
---