# luci-app-client-guardian **Version:** 0.4.0 **Last Updated:** 2025-12-28 **Status:** Active **Network Access Control & Captive Portal Dashboard for OpenWrt** πŸ›‘οΈ Client Guardian est un systΓ¨me de contrΓ΄le d'accΓ¨s rΓ©seau (NAC) nouvelle gΓ©nΓ©ration pour OpenWrt avec portail captif, surveillance en temps rΓ©el, gestion des zones et alertes SMS/Email. ![Client Guardian Dashboard](https://cybermind.fr/images/client-guardian-hero.png) ## ✨ FonctionnalitΓ©s ### πŸ” Surveillance Temps RΓ©el - DΓ©tection automatique des nouveaux clients (MAC + DHCP hostname) - Statut en ligne/hors ligne en temps rΓ©el - Historique de trafic par client (RX/TX) - PremiΓ¨re connexion / DerniΓ¨re activitΓ© ### 🏠 Gestion des Zones | Zone | Description | Internet | Local | Isolation | |------|-------------|----------|-------|-----------| | **LAN PrivΓ©** | RΓ©seau de confiance | βœ… | βœ… | ❌ | | **IoT** | Objets connectΓ©s | βœ… | ❌ | βœ… | | **Enfants** | AccΓ¨s filtrΓ© | βœ… FiltrΓ© | βœ… | ❌ | | **InvitΓ©s** | AccΓ¨s limitΓ© | βœ… LimitΓ© | ❌ | βœ… | | **Quarantaine** | Non approuvΓ©s | ❌ Portal | ❌ | βœ… | | **BloquΓ©** | Bannis | ❌ | ❌ | βœ… | ### ⏳ Politique par DΓ©faut : Quarantaine - Tout nouveau client non reconnu β†’ **Quarantaine automatique** - AccΓ¨s uniquement au portail captif - Approbation manuelle requise pour accΓ¨s complet - Protection contre les intrusions ### πŸšͺ Portail Captif Nouvelle GΓ©nΓ©ration - Interface moderne et personnalisable - Authentification par mot de passe / inscription - Conditions d'utilisation acceptΓ©es - DurΓ©e de session configurable - Logo et couleurs personnalisables ### πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ ContrΓ΄le Parental - **Plages horaires** : Blocage nocturne, heures scolaires - **Filtrage de contenu** : Adulte, violence, jeux d'argent - **SafeSearch forcΓ©** : Google, Bing, YouTube - **YouTube Mode Restreint** - **Listes blanches/noires** d'URLs personnalisΓ©es - **Quotas journaliers** de temps d'Γ©cran ### πŸ”” Alertes SMS & Email - Nouveau client dΓ©tectΓ© - Tentative de client banni - Quota dΓ©passΓ© - ActivitΓ© suspecte (scan de ports, etc.) - Templates personnalisables - Fournisseurs SMS : Twilio, Nexmo, OVH ## πŸ“¦ Installation ### PrΓ©requis ```bash opkg update opkg install luci-base rpcd dnsmasq-full iptables uhttpd ``` ### Optionnels ```bash # Pour les notifications opkg install msmtp curl # Pour le filtrage DNS opkg install adblock # Pour les quotas de bande passante opkg install sqm-scripts ``` ### Installation du package ```bash # Depuis les sources git clone https://github.com/gkerma/luci-app-client-guardian.git cd luci-app-client-guardian make install # RedΓ©marrer rpcd /etc/init.d/rpcd restart ``` ## 🎯 Utilisation ### Workflow Typique 1. **Nouveau client se connecte** β†’ Automatiquement en quarantaine 2. **Alerte envoyΓ©e** β†’ SMS/Email Γ  l'admin 3. **Admin vΓ©rifie** β†’ Dans le dashboard LuCI 4. **DΓ©cision** : - βœ… **Approuver** β†’ Assigner Γ  une zone (LAN, IoT, Enfants...) - 🚫 **Bannir** β†’ Bloquer dΓ©finitivement ### Actions sur les Clients | Action | Description | |--------|-------------| | βœ… Approuver | Sortir de quarantaine, assigner zone | | 🚫 Bannir | Bloquer tout accΓ¨s rΓ©seau | | ⏳ Quarantaine | Remettre en isolation | | ✏️ Modifier | Changer nom, zone, quota | ## πŸ”§ Configuration ### Fichier UCI `/etc/config/client-guardian` ```bash # Configuration globale config client-guardian 'config' option enabled '1' option default_policy 'quarantine' option scan_interval '30' option portal_enabled '1' # Alertes Email config email 'email' option enabled '1' option smtp_server 'smtp.gmail.com' option smtp_port '587' option smtp_user 'user@gmail.com' list recipients 'admin@example.com' # Alertes SMS (Twilio) config sms 'sms' option enabled '1' option provider 'twilio' option api_key 'ACxxxxx' option api_secret 'xxxxx' list recipients '+33612345678' # Zone personnalisΓ©e config zone 'gaming' option name 'Gaming' option network 'lan' option internet_access '1' option bandwidth_limit '0' option time_restrictions '0' # Client connu config client 'mon_pc' option name 'PC Bureau' option mac 'AA:BB:CC:DD:EE:FF' option zone 'lan_private' option status 'approved' option static_ip '192.168.1.10' ``` ## πŸ—οΈ Architecture ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ LuCI Web Interface β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Overview β”‚ Clients β”‚ Zones β”‚ Portal β”‚ Parental β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ RPCD Backend β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ status | clients | zones | approve | ban | quarantine β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ System Integration β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ dnsmasq β”‚ iptables β”‚ arptables β”‚ uhttpd (portal) β”‚ β”‚ β”‚ β”‚ (DHCP) β”‚ (firewall)β”‚ (MAC) β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Alert System β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Email (msmtp) β”‚ SMS (Twilio/Nexmo/OVH) β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## πŸ“Š API RPCD | MΓ©thode | Description | ParamΓ¨tres | |---------|-------------|------------| | `status` | Γ‰tat global du systΓ¨me | - | | `clients` | Liste tous les clients | - | | `zones` | Liste toutes les zones | - | | `parental` | Config contrΓ΄le parental | - | | `portal` | Config portail captif | - | | `alerts` | Config alertes | - | | `logs` | Journal d'Γ©vΓ©nements | `limit`, `level` | | `approve_client` | Approuver un client | `mac`, `name`, `zone` | | `ban_client` | Bannir un client | `mac`, `reason` | | `quarantine_client` | Mettre en quarantaine | `mac` | | `update_client` | Modifier un client | `section`, `name`, `zone`... | | `update_zone` | Modifier une zone | `id`, `name`, `bandwidth_limit`... | | `update_portal` | Modifier le portail | `title`, `subtitle`... | | `send_test_alert` | Envoyer alerte test | `type` (email/sms) | ## πŸ” SΓ©curitΓ© - **Quarantaine par dΓ©faut** : Aucun accΓ¨s sans approbation - **Isolation des zones** : IoT isolΓ© du LAN - **DΓ©tection d'intrusion** : Alertes en temps rΓ©el - **Historique complet** : Logs de toutes les connexions - **ACL** : Permissions granulaires pour l'API ## 🎨 ThΓ¨me - **Couleur principale** : Rouge sΓ©curitΓ© (#ef4444) - **Fond** : Dark mode (#0f0a0a) - **Zones** : Couleurs distinctes par type - **Animations** : Pulse pour quarantaine, glow pour alertes ## πŸ“ Structure du Package ``` luci-app-client-guardian/ β”œβ”€β”€ Makefile β”œβ”€β”€ README.md β”œβ”€β”€ htdocs/luci-static/resources/ β”‚ β”œβ”€β”€ client-guardian/ β”‚ β”‚ β”œβ”€β”€ api.js β”‚ β”‚ └── dashboard.css β”‚ └── view/client-guardian/ β”‚ β”œβ”€β”€ overview.js β”‚ β”œβ”€β”€ clients.js β”‚ β”œβ”€β”€ zones.js β”‚ β”œβ”€β”€ portal.js β”‚ β”œβ”€β”€ parental.js β”‚ β”œβ”€β”€ alerts.js β”‚ └── logs.js └── root/ β”œβ”€β”€ etc/ β”‚ └── config/client-guardian └── usr/ β”œβ”€β”€ libexec/rpcd/client-guardian └── share/ β”œβ”€β”€ luci/menu.d/luci-app-client-guardian.json └── rpcd/acl.d/luci-app-client-guardian.json ``` ## πŸ›£οΈ Roadmap - [x] Surveillance temps rΓ©el - [x] Gestion des zones - [x] Portail captif - [x] ContrΓ΄le parental - [x] Alertes Email/SMS - [ ] IntΓ©gration Pi-hole - [ ] Statistiques graphiques (historique) - [ ] Application mobile - [ ] API REST externe - [ ] IntΓ©gration Home Assistant ## πŸ“„ Licence Apache-2.0 - Voir [LICENSE](LICENSE) ## πŸ‘€ Auteur **Gandalf** - [CyberMind.fr](https://cybermind.fr) --- *ProtΓ©gez votre rΓ©seau avec Client Guardian* πŸ›‘οΈ