envoy-proxy-bouncer

command module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 1 Imported by: 0

README

Go Build License

CrowdSec Envoy Proxy Bouncer

A lightweight CrowdSec bouncer for Envoy Proxy using the ext_authz filter.

Features

  • Block malicious IPs streamed via CrowdSec decisions
  • Bouncer metrics reporting
  • Request inspection via CrowdSec AppSec
  • CAPTCHA challenges for suspicious IPs with support for:
    • Google reCAPTCHA v2
    • Cloudflare Turnstile

How It Works

The bouncer integrates with Envoy Proxy as an external authorization service, sitting between Envoy and your backend applications. It evaluates every request through a multi-stage security pipeline:

Request Processing Flow
  1. IP Extraction
    • Extracts the real client IP from forwarded headers, respecting trusted proxy configuration
  2. Bouncer Check
    • Queries the local decision cache for IP-based actions (ban or captcha)
    • Decisions are streamed in real-time from CrowdSec via the Stream API
    • Low-latency lookups using in-memory cache
  3. WAF Analysis
    • If enabled and no blocking decision exists then the request is forwarded to Crowdsec AppSec for inspection
  4. Decision Enforcement
    • Allow - Request proceeds to backend
    • Ban - Returns configurable status code (defaults to 403) with ban page
    • Captcha - Creates session and redirects to challenge
Ban Flow

When a banned IP attempts access, they receive a 403 response with a ban page:

Ban Page

CAPTCHA Flow

When CAPTCHA is enabled and a suspicious request is detected:

  1. Bouncer creates a secure session and redirects to /captcha/challenge?session=<id>
  2. User completes the CAPTCHA challenge (reCAPTCHA v2 or Cloudflare Turnstile)
  3. Challenge response is verified at /captcha/verify
  4. On success, the IP is allowlisted and user is redirected to their original destination

Documentation

Examples

Kubernetes manifest examples can be found below:

Acknowledgments

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
components/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL