Edge node for distributed DDoS protection and GeoDNS routing. Written in Go.
- DNS Server (port 53) - Geographic routing based on client location
- HTTP/HTTPS Proxy (ports 80/443) - Reverse proxy with SSL termination
- Lua WAF - Web Application Firewall with scriptable rules
- TCP/UDP Proxy - Custom protocol forwarding
- L4 DDoS Protection - Connection limits, rate limiting, iptables integration
Get your connection token from Defenra Core dashboard, then run:
curl -sSL https://raw.githubusercontent.com/Defenra/DefenraAgent/main/quick-install.sh | \
sudo CONNECT_URL="https://your-core.com/api/agent/connect/TOKEN" bashThis downloads the binary, registers the agent, and starts the systemd service.
Download the binary for your platform:
# Linux x64
wget https://github.com/Defenra/DefenraAgent/releases/latest/download/defenra-agent-linux-amd64.tar.gz
tar -xzf defenra-agent-linux-amd64.tar.gz
sudo mv defenra-agent-linux-amd64 /usr/local/bin/defenra-agent
sudo chmod +x /usr/local/bin/defenra-agent
# Verify checksum
sha256sum -c defenra-agent-linux-amd64.tar.gz.sha256Available platforms: linux-amd64, linux-arm64, darwin-amd64, darwin-arm64, freebsd-amd64, freebsd-arm64
Set environment variables:
export AGENT_ID=agent_xxx
export AGENT_KEY=your_secret_key
export CORE_URL=https://core.defenra.com
export POLLING_INTERVAL=60Or create /etc/defenra-agent/.env:
AGENT_ID=agent_xxx
AGENT_KEY=your_secret_key
CORE_URL=https://core.defenra.com
POLLING_INTERVAL=60
defenra-agentFor systemd service setup, see INSTALL_GUIDE.md.
Check for new releases:
defenra-agent check-updateUpdate to latest version:
sudo defenra-agent updateThe updater downloads the binary, verifies checksums, and replaces the current version. Restart the service after updating.
Requirements: Go 1.21+
git clone https://github.com/Defenra/DefenraAgent.git
cd DefenraAgent
go mod download
go build -o defenra-agent .docker run -d \
--name defenra-agent \
-p 53:53/udp \
-p 53:53/tcp \
-p 80:80 \
-p 443:443 \
-p 8080:8080 \
-e AGENT_ID=agent_xxx \
-e AGENT_KEY=xxx \
-e CORE_URL=https://core.defenra.com \
defenra/agent:latestThe agent polls Defenra Core every 60 seconds for configuration updates (domains, DNS records, proxy rules, WAF scripts). When a client makes a request:
- DNS Query - GeoDNS returns the IP of the nearest agent based on client's country
- HTTP/HTTPS Request - Proxy forwards to origin, applying WAF rules and rate limits
- DDoS Protection - L4 firewall blocks malicious traffic, bans IPs via iptables
Configuration is stored in memory. No local database required.
Routes clients to the nearest agent by country code. If no exact match exists, falls back to geographically close countries.
Example: Client from Ukraine → Ukrainian agent, or if unavailable → Poland, Russia, or Turkey.
Supported regions: Americas, Europe, Asia, Oceania, Africa. See ARCHITECTURE.md for full country list.
Health check:
curl http://localhost:8080/healthStatistics:
curl http://localhost:8080/statsTested on 2-core VPS:
- DNS: 10,000+ queries/sec
- HTTP: 5,000+ requests/sec
- Memory: ~200MB idle, <512MB under load
- Startup: <5 seconds
- Quick Start - Step-by-step setup
- Installation Guide - Advanced installation scenarios
- Architecture - Component design and data flows
- Testing - Running tests and benchmarks
- Update Guide - Self-update documentation
MIT