@@ -7,6 +7,10 @@ InfraGuard sits between the internet and your C2 teamserver, validating every in
77![ Mythic Callbacks Xenon] ( /images/xenon_callback.png )
88![ InfraGuard Dashboard] ( /images/infraguard_dashboard.png )
99
10+ ## Architecture
11+
12+ ![ Architecture Diagram] ( /images/InfraGuard%20Infrastructure%20Diagram.drawio.png )
13+
1014## Features
1115
1216- ** Multi-domain proxying** -- proxy multiple domains simultaneously, each with independent C2 profiles, upstreams, and rules
@@ -25,6 +29,7 @@ InfraGuard sits between the internet and your C2 teamserver, validating every in
2529- ** Webhook alerts** -- built-in plugins for Discord (embeds), Slack (Block Kit), and generic webhook (Rocket.Chat, Mattermost, Teams)
2630- ** Plugin system** -- event-driven architecture with ` on_event ` hooks, per-plugin config, event filtering (only_blocked, min_score, domain include/exclude)
2731- ** Backend config generation** -- generate Nginx, Caddy, or Apache configs with full operator customization (TLS, IP filtering, header checks, aliases, custom headers)
32+ - ** Edge proxies** -- lightweight Cloudflare Worker and AWS Lambda for domain fronting through CDN infrastructure, edge country blocking, and host rewriting
2833- ** Docker deployment** -- Dockerfile + docker-compose with optional Let's Encrypt, GeoIP downloader, and PwnDrop payload server
2934- ** GeoIP support** -- all three GeoLite2 databases (City, ASN, Country) with Docker auto-download
3035- ** Self-signed TLS fallback** -- auto-generates certificates when configured paths don't exist
@@ -637,6 +642,56 @@ When running with `infraguard dashboard`, the following REST API is available:
637642
638643All API endpoints require an ` Authorization: Bearer <token> ` header when ` auth_token ` is configured.
639644
645+ ## Cloudflare Worker Deployment
646+
647+ InfraGuard includes a lightweight Cloudflare Worker that acts as an edge reverse proxy, providing domain fronting through Cloudflare's CDN.
648+
649+ ```
650+ Internet → [Cloudflare Edge Worker] → [InfraGuard Server on VPS] → [C2 Teamserver]
651+ ```
652+
653+ From a network observer's perspective, all traffic goes to Cloudflare's IPs -- your server is never exposed.
654+
655+ ``` bash
656+ cd workers/infraguard-edge
657+ npm install -g wrangler
658+ wrangler login
659+
660+ # Edit wrangler.toml with your InfraGuard backend URL and domains
661+ npx wrangler deploy
662+ ```
663+
664+ The Worker handles:
665+ - ** Domain fronting** -- traffic appears to go to Cloudflare
666+ - ** Edge country blocking** -- drop requests from banned countries at the edge
667+ - ** Host rewriting** -- map Cloudflare domains to C2 profile Host headers
668+ - ** Client IP injection** -- ` X-Real-IP ` / ` X-Forwarded-For ` with the real client IP
669+
670+ See [ workers/infraguard-edge/README.md] ( workers/infraguard-edge/README.md ) for full configuration.
671+
672+ ## AWS Lambda Deployment
673+
674+ InfraGuard also includes an AWS Lambda edge proxy for domain fronting through CloudFront or Lambda Function URLs.
675+
676+ ``` bash
677+ cd workers/infraguard-lambda
678+
679+ # Deploy with SAM CLI
680+ sam build
681+ sam deploy --guided \
682+ --parameter-overrides \
683+ InfraGuardBackend=https://your-server:443 \
684+ AllowedHosts=cdn.example.com \
685+ BlockedCountries=CN,RU,KP
686+ ```
687+
688+ Supports three deployment modes:
689+ - ** Lambda Function URL** -- standalone HTTPS endpoint, simplest setup
690+ - ** CloudFront + Lambda@Edge** -- full CDN with global edge distribution
691+ - ** API Gateway + Lambda** -- HTTP API endpoint
692+
693+ Zero external dependencies (stdlib only). See [ workers/infraguard-lambda/README.md] ( workers/infraguard-lambda/README.md ) for full configuration.
694+
640695## Docker Deployment
641696
642697### Quick start
@@ -680,7 +735,7 @@ Requirements for Let's Encrypt:
680735# Download all three GeoLite2 databases (City, ASN, Country)
681736docker compose --profile geoip up geoip-update
682737
683- # Then start normally — databases are mounted at /app/geoip/
738+ # Then start normally - databases are mounted at /app/geoip/
684739docker compose up -d proxy dashboard
685740```
686741
@@ -768,6 +823,7 @@ infraguard/
768823| Anti-replay | SQLite hash | In-memory with configurable window |
769824| Drop actions | redirect, reset, proxy | redirect, reset, proxy, tarpit |
770825| TLS management | Manual only | Auto self-signed + Let's Encrypt integration |
826+ | Edge deployment | None | Cloudflare Worker + AWS Lambda edge proxies with domain fronting |
771827| Deployment | Manual | Docker Compose with health checks |
772828| Logging | Custom colored output | Structured JSON (structlog) |
773829| Async | Tornado callbacks | Native async/await (ASGI + uvicorn) |
0 commit comments