A professional, enterprise-grade framework designed to standardize, automate, and orchestrate IPsec tunnel configurations across heterogeneous operating systems (Windows, Linux, and macOS).
graph TD
subgraph "External Control"
Admin[System Admin] --> Swagger[Swagger UI / API Docs]
end
subgraph "Cloud Infrastructure (Render/Docker)"
Swagger --> Orchestrator[FastAPI Orchestrator]
Orchestrator --> DB[(PostgreSQL)]
end
subgraph "Local Endpoints"
AgentWin[Windows Agent] -- "Polls Policy (REST)" --> Orchestrator
AgentLin[Linux Agent] -- "Polls Policy (REST)" --> Orchestrator
AgentWin --> DriverWin[Windows Driver]
DriverWin --> WFP[Windows Filtering Platform]
AgentLin --> DriverLin[strongSwan Driver]
DriverLin --> IPsec[Linux IPsec Stack]
end
style Orchestrator fill:#f9f,stroke:#333,stroke-width:2px
style DB fill:#66f,stroke:#333,stroke-width:2px
style Swagger fill:#dfd,stroke:#333,stroke-width:2px
- Core Orchestrator: FastAPI backend with PostgreSQL persistence
- Containerization: Full Docker support for cloud deployment (Render, Vercel)
- Platform Drivers: Native Windows (PowerShell) and Linux (strongSwan) support
- Admin Dashboard: React.js frontend with policy management
- Phase 1 - Compliance & Telemetry (β
Complete):
- Heartbeat monitoring (device health & connectivity)
- Compliance reporting (policy adherence verification)
- Security Association (SA) monitoring (IPsec tunnel tracking)
- Leak detection (unauthorized data flow alerts)
- Audit logs with immutable chain integrity (SHA-512)
- Phase 2 - Full Zero Trust Security (β
Complete):
- Internal Certificate Authority (CA) for device certificates
- mTLS communication (mutual TLS authentication)
- Device fingerprint attestation (HMAC-SHA512)
- JWT token management with automatic rotation
- Admin TOTP MFA (Time-based One-Time Passwords)
- Behavioral trust scoring (continuous device evaluation)
- Zero Trust middleware (threshold-based access control)
- Rate limiting on all endpoints (DoS protection)
- Phase 3 - Policy Routing & Driver Dispatch (β
Complete):
- Policy parser with alias normalization and validation
- Per-OS policy config generation (Linux / Windows / macOS)
- OS-specific device config delivery
- Native driver dispatch on agents
- macOS Support: Upcoming integration with native IPsec APIs
- Windows policy application now uses a staged PowerShell driver flow with explicit step logging.
- PSK IKEv2 Windows tunnels now skip Phase 2 auth set creation when it is not applicable.
- Quick mode proposal generation now uses Windows-supported parameters only.
- The policy parser now normalizes crypto values into Windows-accepted names before dispatch.
- The documentation set now includes the Windows runbook, policy routing guide, and a navigation index.
Deploy the Central Orchestrator to Render in minutes:
- Render Deployment: DEPLOYMENT_VERCEL.md
- Linux Deployment: DEPLOYMENT_LINUX.md
- Interactive API Docs: Access
/docson your orchestrator to manage policies
Set up agents on your local machines:
- Complete Usage Guide: USAGE_GUIDE.md - Start here for step-by-step instructions
- Agent Enrollment: AGENT_REGISTRATION.md - How to register new devices
- Windows Agent Runbook: AGENT_WINDOWS_RUNBOOK.txt - Exact env vars and commands for a fresh PowerShell session
- Zero Trust Architecture: ZERO_TRUST_SETUP.md - Complete Zero Trust implementation
- Compliance & Monitoring: COMPLIANCE_AND_MONITORING.md - Heartbeat, SA monitoring, leak detection
- Policy Routing & Drivers: POLICY_ROUTING_AND_DRIVERS.md - Policy parsing and OS-specific dispatch
- Security Architecture: SECURITY_ARCHITECTURE.md - Cryptography, threat models, incident response
- Windows dispatcher now applies tunnel policy using a staged PowerShell flow with explicit step logging.
- For PSK IKEv2 tunnels, Phase 2 auth set creation is skipped.
- Quick mode proposal uses Windows-supported parameters (
Encapsulation,ESPHash,Encryption). - Rule creation enforces inbound and outbound security requirements.
- See AGENT_WINDOWS_RUNBOOK.txt for exact terminal commands and verification steps.
- Framework: Python 3.10+, FastAPI 0.100+, SQLAlchemy ORM
- Database: PostgreSQL (cloud deployments), SQLite (local dev)
- Deployment: Docker, Render, Vercel
- API Docs: OpenAPI/Swagger at
/docs
- Encryption: AES-GCM-256 (IPsec), AES-256-GCM (TLS), RSA-4096 (device certs)
- Hashing: SHA-512 (audit trail, fingerprints), SHA-256 (JWT)
- Authentication:
- Admin: Username + Password + TOTP MFA
- Devices: Fingerprint + HMAC-SHA512 + X.509 certificate
- mTLS: Client certificate verification on all device endpoints
- Rate Limiting: slowapi (DoS protection on all endpoints)
- Token Management: RS256 JWT (15-min access + 7-day refresh)
- Password Security: bcrypt with work factor 12
- Lightweight: Python residents with minimal dependencies
- Platforms: Windows (PowerShell), Linux (strongSwan)
- Compliance: Heartbeat, SA monitoring, leak detection, OS-specific policy enforcement
- Communication: mTLS client with automatic retry + backoff
- Dashboard: React.js with Vite bundler
- UI Framework: Modern responsive design
- Features:
- Device management and enrollment
- Policy creation and assignment
- Real-time monitoring (heartbeat, SA status)
- Compliance dashboard
- Audit log viewer
- Admin security settings (TOTP MFA setup)
βββ agent/ # Device Agent logic
β βββ client.py # Orchestrator API client
β βββ main.py # Agent main loop with mTLS support
β βββ config.py # Environment-driven configuration
β βββ security/ # Security modules
β β βββ device_fingerprint.py # Device identity & attestation
β β βββ mtls_client.py # Secure mTLS HTTP client
β βββ verification/ # Compliance verification
β β βββ sa_monitor.py # IPsec SA monitoring & leak detection
β βββ platforms/ # OS-specific drivers
β β βββ base.py # Base platform interface
β β βββ windows.py # Windows PowerShell integration
β β βββ linux.py # Linux strongSwan integration
β βββ utils/ # Utility functions
β
βββ orchestrator/ # Central Orchestrator service
β βββ main.py # FastAPI app initialization
β βββ models.py # SQLAlchemy ORM models
β βββ schemas.py # Pydantic request/response schemas
β βββ auth.py # Authentication & authorization
β βββ config.py # Configuration management
β βββ database.py # Database connection pooling
β βββ security/ # Security modules
β β βββ certificate_authority.py # Internal CA for device certs
β β βββ token_manager.py # JWT access & refresh tokens
β β βββ totp_manager.py # Admin TOTP MFA
β β βββ trust_evaluator.py # Zero Trust scoring
β βββ middleware/ # Request middleware
β β βββ zero_trust.py # mTLS verification & trust enforcement
β βββ routers/ # API endpoint handlers
β β βββ auth.py # User authentication endpoints
β β βββ devices.py # Device enrollment & management
β β βββ policies.py # IPsec policy management
β β βββ compliance.py # Compliance & monitoring endpoints
β βββ services/ # Business logic services
β βββ models/ # Database model extensions
β β βββ certificate.py # Device certificate ORM tables
β βββ schemas/ # Extended Pydantic schemas
β β βββ compliance.py # Compliance request/response schemas
β βββ frontend/ # React.js admin dashboard
β β βββ src/ # React components
β β βββ index.html # HTML entry point
β β βββ package.json # Node dependencies
β β βββ vite.config.js # Vite build config
β βββ generate_keys.py # Key pair generation utility
β
βββ docs/ # Documentation
β βββ INDEX.md # Documentation navigation index
β βββ USAGE_GUIDE.md # Complete usage guide (START HERE)
β βββ ZERO_TRUST_SETUP.md # Zero Trust architecture deep dive
β βββ COMPLIANCE_AND_MONITORING.md # Phase 1 telemetry & monitoring
β βββ SECURITY_ARCHITECTURE.md # Cryptography & threat models
β βββ POLICY_ROUTING_AND_DRIVERS.md # Policy parser and native driver behavior
β βββ API_TESTING_GUIDE.md # API validation and endpoint testing
β βββ AGENT_REGISTRATION.md # Device enrollment guide
β βββ AGENT_WINDOWS_RUNBOOK.txt # Windows agent env vars and command sequence
β βββ DEPLOYMENT_LINUX.md # Linux deployment instructions
β βββ DEPLOYMENT_VERCEL.md # Vercel/Render deployment
β
βββ keys/ # Cryptographic keys (not in repo)
β βββ ca.crt # CA public certificate
β βββ ca.key # CA private key (KEEP SECURE!)
β
βββ shared/ # Shared utilities
βββ Dockerfile # Container definition for Orchestrator
βββ render.yaml # Render infrastructure-as-code
βββ LICENSE # MIT License
βββ README.md # This file
βββ TEST_PLAN.md # Comprehensive test strategies
Contributions are welcome! Please follow the standard fork/PR workflow.
Distributed under the MIT License. See LICENSE for details.