Skip to content

infrastructure-alexson/ldap-web-manager

Repository files navigation

LDAP Web Manager v2.0.0

Complete infrastructure management platform for 389 Directory Service with integrated IPAM, DNS, DHCP, and user/group management.

Version Status

License Python React NGINX


🌟 Overview

LDAP Web Manager is a comprehensive web application for managing your entire network infrastructure through a unified interface. Built with modern web technologies and designed to run on NGINX.

Architecture

graph TB
    subgraph "Web Browser"
        UI[React Frontend<br/>Modern SPA]
    end
    
    subgraph "NGINX Server :443"
        NGINX[NGINX<br/>Static Files + Reverse Proxy]
    end
    
    subgraph "Backend API :8000"
        API[FastAPI Backend<br/>Python 3.9+]
    end
    
    subgraph "LDAP Infrastructure"
        LDAP1[389 DS Primary<br/>ldap1.svc.eh168.alexson.org<br/>192.168.1.1]
        LDAP2[389 DS Secondary<br/>ldap2.svc.eh168.alexson.org<br/>192.168.1.2]
    end
    
    subgraph "Integrated Services"
        KEA[Kea DHCP<br/>dhcp1/dhcp2<br/>192.168.1.6-7]
        BIND[BIND 9 DNS<br/>ns0/ns1<br/>192.168.1.4-5]
        SSSD[SSSD Clients<br/>Linux Hosts]
    end
    
    UI -->|HTTPS| NGINX
    NGINX -->|Static Files| UI
    NGINX -->|API Proxy :8000| API
    API -->|LDAPS :636| LDAP1
    API -->|LDAPS :636| LDAP2
    LDAP1 -.->|Replication| LDAP2
    LDAP1 -->|Backend| KEA
    LDAP1 -->|DLZ| BIND
    LDAP1 -->|Auth| SSSD
Loading

✨ Features

πŸ“‹ User & Group Management βœ… COMPLETE

  • βœ… User Management: Create, edit, delete, and search users
  • βœ… Group Management: Manage POSIX groups and memberships
  • βœ… Password Management: Reset passwords, enforce complexity policies
  • βœ… Service Accounts: View and manage dedicated service accounts
  • βœ… Automatic UID/GID: Auto-generation of unique identifiers
  • βœ… Full POSIX Support: Home directories, shells, gecos fields
  • βœ… Search & Pagination: Fast access to users and groups
  • βœ… Permission-Based UI: Role-based action visibility

🌍 DNS Management (BIND 9) βœ… COMPLETE

  • βœ… Zone Management: Create, edit, delete forward and reverse zones
  • βœ… SOA Records: Full SOA parameter control with auto-increment serial
  • βœ… Record Management: Support for A, AAAA, CNAME, MX, TXT, PTR, SRV, NS records
  • βœ… DLZ Integration: Native 389 DS LDAP backend for BIND 9
  • βœ… Zone Statistics: View zone counts and details
  • βœ… Validation: Real-time syntax checking for DNS records
  • βœ… Search & Pagination: Fast zone lookup

πŸ”Œ DHCP Management (Kea) βœ… COMPLETE

  • βœ… Subnet Management: Configure IPv4 subnets with CIDR notation
  • βœ… Static Reservations: MAC-to-IP mappings for hosts
  • βœ… DHCP Options: Configure DNS servers, gateways, domain names
  • βœ… DHCP Ranges: Define dynamic IP address pools
  • βœ… Statistics: View subnet counts, static hosts, IP utilization
  • βœ… Kea LDAP Backend: Full integration with Kea DHCP server
  • βœ… Search & Pagination: Fast subnet lookup
  • βœ… Dashboard Integration: Real-time DHCP statistics

🌐 IPAM (IP Address Management) βœ… COMPLETE (API)

  • βœ… IP Pool Management: Create and manage IP address pools (CIDR)
  • βœ… IP Allocation Tracking: Track static, DHCP, reserved, infrastructure IPs
  • βœ… IP Search: Find allocations by IP, hostname, or MAC address
  • βœ… Conflict Detection: Prevent duplicate IP assignments
  • βœ… Utilization Tracking: Monitor used vs. available addresses per pool
  • βœ… VLAN Support: Associate pools with VLANs
  • βœ… Gateway & DNS: Configure per-pool network settings
  • βœ… Statistics API: Comprehensive IPAM metrics
  • πŸ“‹ Visual UI: Planned for v2.1.0 (API fully functional)

πŸ” Security & Authentication

  • βœ… LDAPS: Encrypted connections to 389 DS
  • βœ… Role-Based Access Control (RBAC): Admin, Operator, Read-Only roles
  • βœ… Session Management: Secure JWT-based authentication
  • βœ… Audit Trail: Complete change history
  • βœ… API Security: Rate limiting and input validation

🎨 User Experience

  • βœ… Modern UI: Responsive design with Tailwind CSS
  • βœ… Dark Mode: Toggle between light and dark themes
  • βœ… Search & Filter: Quick access to any resource
  • βœ… Dashboard: Overview of infrastructure health
  • βœ… Real-Time Updates: Live status indicators
  • βœ… Mobile Friendly: Works on tablets and smartphones

πŸš€ Quick Start

Prerequisites

  • NGINX 1.24+ installed on Rocky Linux 8 or similar
  • Python 3.9+ for the backend API
  • Node.js 18+ and npm/yarn for frontend development (production uses pre-built files)
  • 389 Directory Service deployed and accessible
  • TLS Certificates for HTTPS (Let's Encrypt, self-signed, or corporate CA)

Installation

Option 1: Automated Deployment (Recommended)

# Clone the repository
git clone https://github.com/infrastructure-alexson/ldap-web-manager.git
cd ldap-web-manager

# Configure settings
cp config/app-config.example.yaml config/app-config.yaml
nano config/app-config.yaml  # Edit LDAP connection details

# Run the deployment script
sudo ./scripts/deploy-full.sh

# Access the web interface
firefox https://ldap-manager.svc.eh168.alexson.org

Option 2: Manual Deployment

See: doc/INSTALLATION.md


πŸ“ Project Structure

ldap-web-manager/
β”œβ”€β”€ frontend/                      # React SPA frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/           # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ Users/            # User management UI
β”‚   β”‚   β”‚   β”œβ”€β”€ Groups/           # Group management UI
β”‚   β”‚   β”‚   β”œβ”€β”€ DNS/              # DNS zone/record management
β”‚   β”‚   β”‚   β”œβ”€β”€ DHCP/             # DHCP subnet/pool management
β”‚   β”‚   β”‚   β”œβ”€β”€ IPAM/             # IP address management
β”‚   β”‚   β”‚   └── Dashboard/        # Overview dashboard
β”‚   β”‚   β”œβ”€β”€ api/                  # API client
β”‚   β”‚   β”œβ”€β”€ hooks/                # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ utils/                # Helper functions
β”‚   β”‚   └── App.jsx               # Main application
β”‚   β”œβ”€β”€ public/                   # Static assets
β”‚   └── package.json              # Frontend dependencies
β”‚
β”œβ”€β”€ backend/                       # Python FastAPI backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/                  # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ users.py          # User management endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ groups.py         # Group management endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ dns.py            # DNS management endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ dhcp.py           # DHCP management endpoints
β”‚   β”‚   β”‚   └── ipam.py           # IPAM endpoints
β”‚   β”‚   β”œβ”€β”€ models/               # Data models (Pydantic)
β”‚   β”‚   β”œβ”€β”€ ldap/                 # LDAP connection & operations
β”‚   β”‚   β”œβ”€β”€ auth/                 # Authentication & authorization
β”‚   β”‚   └── main.py               # FastAPI application
β”‚   β”œβ”€β”€ tests/                    # Unit and integration tests
β”‚   └── requirements.txt          # Python dependencies
β”‚
β”œβ”€β”€ config/                        # Configuration files
β”‚   β”œβ”€β”€ app-config.yaml           # Application settings
β”‚   β”œβ”€β”€ nginx.conf                # NGINX configuration
β”‚   └── systemd/                  # Systemd service files
β”‚
β”œβ”€β”€ scripts/                       # Deployment scripts
β”‚   β”œβ”€β”€ deploy-full.sh            # Complete deployment
β”‚   β”œβ”€β”€ deploy-backend.sh         # Deploy API backend
β”‚   β”œβ”€β”€ deploy-frontend.sh        # Build and deploy frontend
β”‚   β”œβ”€β”€ setup-nginx.sh            # Configure NGINX
β”‚   └── backup-config.sh          # Backup configurations
β”‚
β”œβ”€β”€ doc/                           # Documentation
β”‚   β”œβ”€β”€ INSTALLATION.md           # Detailed installation guide
β”‚   β”œβ”€β”€ NGINX-SETUP.md            # NGINX configuration guide
β”‚   β”œβ”€β”€ DEVELOPMENT.md            # Developer guide
β”‚   β”œβ”€β”€ PROJECT-SUMMARY.md        # Complete feature overview
β”‚   └── V2-COMPLETION-SUMMARY.md  # v2.0.0 release summary
β”‚
β”œβ”€β”€ nginx/                         # NGINX-specific files
β”‚   β”œβ”€β”€ sites-available/          # NGINX site configs
β”‚   β”‚   └── ldap-manager.conf     # Main site configuration
β”‚   └── ssl/                      # TLS certificate location
β”‚
└── README.md                      # This file

πŸ–₯️ Technology Stack

Frontend

  • React 18 - Modern UI framework
  • Vite - Fast build tool
  • Tailwind CSS - Utility-first CSS framework
  • React Router - Client-side routing
  • Axios - HTTP client
  • React Query - Data fetching and caching
  • Formik + Yup - Form handling and validation
  • Chart.js - Data visualization

Backend

  • FastAPI - Modern Python web framework
  • Python-LDAP - LDAP client library
  • Pydantic - Data validation
  • Uvicorn - ASGI server
  • JWT - Authentication tokens
  • SQLite - Local cache and audit logs

Web Server

  • NGINX - High-performance web server and reverse proxy
  • Certbot - Let's Encrypt SSL certificate management

πŸ”§ Configuration

LDAP Connection

Edit config/app-config.yaml:

ldap:
  servers:
    primary: ldaps://ldap1.svc.eh168.alexson.org:636
    secondary: ldaps://ldap2.svc.eh168.alexson.org:636
  base_dn: dc=eh168,dc=alexson,dc=org
  bind_dn: cn=webmanager,ou=ServiceAccounts,dc=eh168,dc=alexson,dc=org
  bind_password: ${LDAP_PASSWORD}  # Use environment variable
  
  # Organizational Units
  users_ou: ou=People,dc=eh168,dc=alexson,dc=org
  groups_ou: ou=Groups,dc=eh168,dc=alexson,dc=org
  dns_ou: ou=DNS,ou=Services,dc=eh168,dc=alexson,dc=org
  dhcp_ou: ou=DHCP,ou=Services,dc=eh168,dc=alexson,dc=org

NGINX Configuration

Served by NGINX on port 443 with reverse proxy to FastAPI backend on port 8000.

See: doc/NGINX-SETUP.md


πŸ“Š Dashboard Features

The main dashboard provides:

  • Infrastructure Health: Status of LDAP, DNS, and DHCP services
  • Quick Stats: User count, group count, DNS zones, DHCP subnets
  • Recent Activity: Latest changes and operations
  • IP Utilization: Visual representation of address pool usage
  • Alerts: Warnings for conflicts, expiring certificates, replication issues

πŸ”’ Security Considerations

  1. LDAPS Only: All LDAP connections use TLS encryption
  2. Service Account: Web manager uses dedicated read/write service account
  3. HTTPS Required: Frontend served only over HTTPS
  4. RBAC: Role-based access control for different user types
  5. Input Validation: All API inputs validated and sanitized
  6. Audit Logging: All operations logged with user, timestamp, and changes
  7. Rate Limiting: API rate limiting to prevent abuse

πŸ“– Documentation


🀝 Related Projects

This project integrates with:


πŸ“ License

MIT License - See LICENSE file for details


πŸ› οΈ Support


Built for the eh168.alexson.org infrastructure πŸš€

Version: 2.0.0
Release Date: 2025-11-03
Status: Production Ready
Repository: https://github.com/infrastructure-alexson/ldap-web-manager

About

Modern web-based management interface for 389 Directory Service with integrated IPAM, BIND 9 DNS, Kea DHCP, and SSSD user/group management. React frontend with FastAPI backend, deployed on NGINX for Rocky Linux 8.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors