A sophisticated network security management platform that enables natural language control of virtual network topologies. LLMGuard combines the power of Docker containerization, intelligent AI-driven command processing, and intuitive web visualization to create a safe, interactive environment for network security experimentation and education.
- Natural Language Interface: Control complex network configurations using plain English commands
- Intelligent Command Translation: Automatically converts natural language requests into precise iptables/nftables rules
- Context-Aware Processing: Maintains conversation history for coherent, multi-step network configurations
- Real-Time Topology Visualization: Dynamic network diagrams showing nodes, connections, and traffic flow
- Interactive Node Management: Drag-and-drop interface for network topology manipulation
- Live Status Monitoring: Real-time updates of network state and security rule changes
- Docker-Based Infrastructure: Isolated, reproducible network environments
- Multi-Container Topologies: Support for complex network architectures with firewalls, routers, and endpoints
- Safe Sandbox Environment: Risk-free experimentation without affecting production systems
- Automated Rule Validation: Test and verify security configurations before deployment
- Traffic Flow Analysis: Monitor and analyze network traffic patterns
- Security Policy Enforcement: Implement and test various security policies and rules
- Next.js 15 - Modern React framework with server-side rendering
- TypeScript - Type-safe development experience
- Tailwind CSS - Utility-first CSS framework
- React Flow - Interactive network topology visualization
- Framer Motion - Smooth animations and transitions
- Ollama - Local LLM integration for natural language processing
- Python 3.12 - Network automation and Docker orchestration
- Docker - Containerized network simulation environment
- iptables/nftables - Linux firewall rule management
Before installing LLMGuard, ensure you have the following installed:
- Node.js (v18 or higher)
- Python (v3.8 or higher)
- Docker (v20.10 or higher)
- Ollama (for AI functionality)
git clone https://github.com/FamALouiz/LLMGuard.git
cd LLMGuardnpm installpip install virtualenv
python3 -m venv .venv # if python3 does not work try python
source .venv/bin/activate # for linux
.venv\Scripts\activate # for windowspip install -r requirements.txt# Install and start Ollama
curl -fsSL https://ollama.ai/install.sh | sh
ollama serve
# Pull a compatible model (recommended)
ollama pull qwen3:4bEnsure Docker daemon is running and your user has Docker permissions:
docker --version
docker psnpm run devpython3 commands/init_network.py --state-file ./public/simplified_state.jsonOpen your browser and navigate to http://localhost:3000
- Use the chat interface to give natural language commands
- Interact with the network topology visualization
- Monitor real-time changes and logs
LLMGuard understands natural language commands for network management:
"Block all traffic from 192.168.1.0/24 to the web server"
"Allow SSH access only from the admin subnet"
"Create a DMZ for the web servers with limited access"
"Show me the current firewall rules"
"Test connectivity between nodes A and B"
LLMGuard/
├── app/ # Next.js application
│ ├── api/ # API routes
│ │ ├── chat/ # Chat interface API
│ │ ├── execute-command/ # Command execution
│ │ └── network-state/ # Network state management
│ ├── components/ # React components
│ └── globals.css # Global styles
├── commands/ # Python network management scripts
│ ├── init_network.py # Network initialization
│ └── log/ # Logging utilities
├── data/ # Configuration and keywords
├── public/ # Static assets
└── scripts/ # Utility scripts
# Frontend linting
npm run lint
# Python linting
flake8 commands/npm run build
npm startPOST /api/chat- Natural language command processingPOST /api/execute-command- Direct command executionGET /api/network-state- Current network topology statePUT /api/update-node-position- Update node positions in topology
next.config.ts- Next.js configurationrequirements.txt- Python dependenciesdata/keywords.ts- Command keywords and patterns
- Sandboxed Environment: All network operations run in isolated Docker containers
- Input Validation: All commands are validated before execution
- Access Control: Network access is restricted to defined topologies
- Audit Logging: All operations are logged for security analysis
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch
- Open a Pull Request
- Follow TypeScript best practices
- Write comprehensive tests
- Update documentation for new features
- Ensure Docker compatibility
This project is licensed under the MIT License - see the LICENSE file for details.
- Fam Shihata - @FamALouiz (fam@awadlouis.com)