|
|
3 months ago | |
|---|---|---|
| .. | ||
| appserver/static | 3 months ago | |
| bin | 3 months ago | |
| certs | 3 months ago | |
| default | 3 months ago | |
| local | 3 months ago | |
| metadata | 3 months ago | |
| README.md | 3 months ago | |
README.md
đ Git Pusher for Splunk
Version 2.0 | Application Splunk pour déployer vos applications vers Git
đ Table des matiĂšres
- Présentation
- Fonctionnalités
- Architecture
- Installation
- Configuration
- Configuration HTTPS
- SystĂšme de Licence
- Utilisation
- Sécurité
- Personnalisation du Dashboard
- Dépannage
- API Reference
- Changelog
- Support
đŻ PrĂ©sentation
Git Pusher est une application Splunk Enterprise qui permet de versionner et déployer vos applications Splunk vers un repository Git en quelques clics.
Idéal pour :
- đŠ Sauvegarder vos configurations Splunk
- đ Versionner vos dashboards et applications
- đ„ Collaborer en Ă©quipe sur les dĂ©veloppements Splunk
- đ Mettre en place un workflow CI/CD pour Splunk
⚠Fonctionnalités
| Fonctionnalité | Description |
|---|---|
| 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 |
đ Architecture
pusher_app_prem/
âââ bin/
â âââ 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
â âââ start_git_pusher.sh # Script de dĂ©marrage
âââ appserver/static/
â âââ git_pusher.js # Logique JavaScript principale
â âââ license_validation.js # Interface de gestion des licences
âââ default/data/ui/views/
â âââ git_pusher_-_deploy_applications.xml # Dashboard principal
âââ local/
â âââ license.lic # Fichier de licence (aprĂšs activation)
â âââ .credentials # Credentials chiffrĂ©s
â âââ .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)â
âââââââââââââââââââââââ
đ„ Installation
Prérequis
- Splunk Enterprise 8.x ou supérieur
- Python 3.7+
- Git installé sur le serveur (
yum install gitouapt install git) - OpenSSL (pour la génération des certificats HTTPS)
- AccÚs réseau vers votre repository Git
Ătapes d'installation
1. Extraire l'application
# Copier l'application dans Splunk
cp -r pusher_app_prem /opt/splunk/etc/apps/
# Définir les permissions
chown -R splunk:splunk /opt/splunk/etc/apps/pusher_app_prem
chmod +x /opt/splunk/etc/apps/pusher_app_prem/bin/*.sh
2. Configurer les credentials Splunk
cd /opt/splunk/etc/apps/pusher_app_prem/bin/
./start_git_pusher.sh credentials setup
==================================================
Git Pusher - Credentials Setup
==================================================
Splunk Username [admin]: admin
Splunk Password: ********
Confirm Password: ********
â Credentials saved securely!
3. Configurer HTTPS (si Splunk est en HTTPS)
Voir la section Configuration HTTPS.
4. Démarrer le serveur Git Pusher
./start_git_pusher.sh start
5. Ouvrir le firewall (si nécessaire)
# FirewallD
sudo firewall-cmd --add-port=9999/tcp --permanent
sudo firewall-cmd --reload
# UFW
sudo ufw allow 9999/tcp
6. Redémarrer Splunk
/opt/splunk/bin/splunk restart
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
Commandes du script de gestion
# Démarrer le serveur
./start_git_pusher.sh start
# ArrĂȘter le serveur
./start_git_pusher.sh stop
# Redémarrer le serveur
./start_git_pusher.sh restart
# Voir le statut
./start_git_pusher.sh status
# Voir les logs
./start_git_pusher.sh logs
./start_git_pusher.sh logs -f # Mode follow
# Gestion des credentials
./start_git_pusher.sh credentials setup
./start_git_pusher.sh credentials status
./start_git_pusher.sh credentials delete
Variables d'environnement (optionnel)
Si vous préférez ne pas utiliser le credentials manager :
export SPLUNK_USERNAME=admin
export SPLUNK_PASSWORD=your_password
export SPLUNK_HOME=/opt/splunk
Fichiers de configuration
| Fichier | Description |
|---|---|
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
# 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
./start_git_pusher.sh restart
3. Vérifier que HTTPS fonctionne
curl -k https://127.0.0.1:9999/health
Vous devriez voir :
{"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.
- Ouvrez un nouvel onglet
- Allez sur :
https://VOTRE_IP_SPLUNK:9999/health - Cliquez sur "Avancé" puis "Accepter le risque et continuer"
- Retournez sur le dashboard Splunk et rafraĂźchissez (Ctrl+Shift+R)
5. (Optionnel) Désactiver HTTPS
Si vous souhaitez forcer le mode HTTP :
cd /opt/splunk/etc/apps/pusher_app_prem/bin/
python3 git_pusher.py --no-ssl
Vérification dans les logs
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)
đ SystĂšme de Licence
Git Pusher utilise un systÚme de licence par fichier .lic pour activer les fonctionnalités.
Types de licences
| Type | Durée | Apps max | Pushes/jour | Fonctionnalités |
|---|---|---|---|---|
| Trial | 14 jours | 3 | 5 | Push basique |
| Starter | 1 an | 10 | 50 | + Push programmé |
| Professional | 1 an | Illimité | Illimité | + Multi-repo, Support prioritaire |
| Enterprise | 1 an | Illimité | Illimité | + Branding personnalisé, API |
Obtenir une licence
-
Récupérer votre hostname Splunk
- Visible dans le dashboard Git Pusher lors de l'activation
- Ou via la commande :
hostname
-
Contacter le support avec :
- Votre hostname Splunk
- Votre email
- Le type de licence souhaité
-
Recevoir votre fichier
.lic -
Activer la licence
- Ouvrir le dashboard Git Pusher
- Glisser-déposer le fichier
.lic - Cliquer sur "Activer"
Structure du fichier de licence
# =============================================
# Git Pusher License File
# =============================================
# Customer: Acme Corp
# Email: admin@acme.com
# Type: Professional
# Hostname: splunk-prod-01
# Expires: 2026-01-30
# License ID: A1B2C3D4E5F6
# =============================================
# DO NOT MODIFY THIS FILE
# =============================================
eyJsaWNlbnNlIjogey4uLn0sICJzaWduYXR1cmUiOiAiLi4uIn0=
# =============================================
# END OF LICENSE
# =============================================
Génération de licences (Vendeur uniquement)
# Mode interactif
python3 license_generator.py
# Mode rapide
python3 license_generator.py quick "Client Name" "email@client.com" "hostname" "professional"
# Valider une licence
python3 license_generator.py validate
đ Utilisation
Pousser des applications vers Git
-
Ouvrir le dashboard Git Pusher
-
Configurer Git
- Repository URL :
https://github.com/user/repo.gitouhttps://gitlab.com/user/repo.git - Branch :
main,master, ou votre branche - Token : Personal Access Token avec droits
write
- Repository URL :
-
Sélectionner les applications
- Cocher les applications à déployer
- Utiliser "Select All" pour tout sélectionner
-
Ăcrire le message de commit
- Décrivez les changements effectués
-
Cliquer sur "Deploy to Git"
Obtenir un token Git
GitHub
- Settings â Developer settings â Personal access tokens â Tokens (classic)
- Generate new token
- Cocher :
repo(Full control)
GitLab
- Preferences â Access Tokens
- Create personal access token
- Scopes :
write_repository
Gitea
- Settings â Applications â Generate New Token
- Permissions :
repository: write
đ SĂ©curitĂ©
Credentials Splunk
Les credentials Splunk sont :
- Chiffrés avec une clé dérivée de l'ID machine
- Stockés dans un fichier avec permissions
600 - Jamais visibles en clair dans les logs ou scripts
# Les credentials sont stockés ici (chiffrés)
/opt/splunk/etc/apps/pusher_app_prem/local/.credentials
# La clé de chiffrement (unique par machine)
/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
- Il est transmis uniquement lors de l'opération de push
- Option "Save credentials" stocke en localStorage du navigateur (encodé)
Licence
- Signature HMAC-SHA256 anti-falsification
- Binding au hostname Splunk
- Vérification de l'expiration
Recommandations
- â Utiliser HTTPS pour Splunk et Git Pusher
- â Utiliser des tokens Git avec permissions minimales
- â Renouveler les tokens rĂ©guliĂšrement
- â Utiliser HTTPS pour les repositories Git
- â 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 :
nano /opt/splunk/etc/apps/pusher_app_prem/default/data/ui/views/git_pusher_-_deploy_applications.xml
Modifiez la premiĂšre ligne :
<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
rm -rf /opt/splunk/var/run/splunk/appserver/*
/opt/splunk/bin/splunk restart
đ§ DĂ©pannage
Le serveur ne démarre pas
# Vérifier les logs
tail -f /opt/splunk/var/log/splunk/git_pusher.log
# Vérifier si le port est utilisé
ss -tlnp | grep 9999
# Vérifier les permissions
ls -la /opt/splunk/etc/apps/pusher_app_prem/bin/
Erreur "Connexion refusée"
# Vérifier que le serveur tourne
ps aux | grep git_pusher
# Vérifier le firewall
sudo firewall-cmd --list-ports
# Ouvrir le port
sudo firewall-cmd --add-port=9999/tcp --permanent
sudo firewall-cmd --reload
Erreur CORS
Les fichiers JavaScript doivent utiliser l'adresse IP du serveur automatiquement.
Vérifier :
head -10 /opt/splunk/etc/apps/pusher_app_prem/appserver/static/license_validation.js
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é :
- Ouvrez
https://VOTRE_IP:9999/healthdans un nouvel onglet - Acceptez le certificat
- Retournez sur Splunk et rafraĂźchissez
Erreur SSL "wrong version number"
Le serveur n'a pas activé SSL. Vérifiez :
# 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
# Vérifier les logs
tail -50 /opt/splunk/var/log/splunk/git_pusher.log
# Tester manuellement
curl -k https://localhost:9999/health
Erreur de licence
# Vérifier le hostname
hostname
# Vérifier la licence
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 :
rm -rf /opt/splunk/var/run/splunk/appserver/*
/opt/splunk/bin/splunk restart
Puis dans le navigateur : Ctrl+Shift+R
Vider le cache Splunk
rm -rf /opt/splunk/var/run/splunk/appserver/*
/opt/splunk/bin/splunk restart
đĄ API Reference
Endpoints
| Méthode | Endpoint | Description |
|---|---|---|
GET |
/health |
Health check |
GET |
/license |
Statut de la licence |
GET |
/license/hostname |
Hostname Splunk |
POST |
/license/upload |
Uploader une licence |
POST |
/push |
Pousser les applications |
Exemple : Health Check
curl -k https://localhost:9999/health
{
"status": "ok",
"service": "git_pusher",
"timestamp": "2026-01-31T12:00:00.000000"
}
Exemple : Statut de licence
curl -k https://localhost:9999/license
{
"status": "valid",
"hostname": "splunk-server",
"license": {
"license_id": "A1B2C3D4E5F6",
"type": "professional",
"type_name": "Professional",
"expires": "2027-01-30",
"days_remaining": 365
}
}
Exemple : Push
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"
{
"status": "success",
"message": "Successfully pushed 1 application(s) to Git",
"apps_pushed": 1,
"license_type": "Professional"
}
đ Changelog
Version 2.0.0 (Février 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
- Push d'applications vers Git
- Interface basique
đ Support
Obtenir de l'aide
- đ§ Email : support@gitpusher.com
- đ Site web : https://gitpusher.com
- đ Documentation : https://docs.gitpusher.com
Signaler un bug
Incluez dans votre rapport :
- Version de Git Pusher
- Version de Splunk
- Configuration (HTTP/HTTPS)
- Logs (
/opt/splunk/var/log/splunk/git_pusher.log) - Erreurs de la console navigateur (F12)
- Ătapes pour reproduire le problĂšme
đ Licence
Git Pusher est un logiciel propriétaire. Une licence valide est requise pour son utilisation.
© 2026 Git Pusher - Tous droits réservés
Made with â€ïž for Splunk administrators