Skip to content
Corslet v0.2.0 · GitHub
  • Self-hosted WAF
  • Envoy dynamic module
  • Helm or kubectl apply

A web application firewall you run yourself.

Corslet runs inside Envoy as a Go extension. It learns what each endpoint normally accepts and stops SQL injection, credential stuffing, scrapers and floods before they reach your apps. On Kubernetes it installs with one Helm command.

helm install corslet oci://ghcr.io/corslet-waf/charts/corslet

Sample traffic, replayed in your browser.

Inside the gateway

Every request runs the same ten checks, in this order, inside Envoy's worker thread. Policy changes are compiled once and swapped in; Envoy never restarts and listeners never drain.

  1. 01Maintenance
  2. 02Bans
  3. 03IP lists & ACL
  4. 04Geo
  5. 05Custom rules
  6. 06Rate limits
  7. 07Bot score
  8. 08Auth gate
  9. 09Attack detection
  10. 10Response inspection
GET /…

01 / Detection

Rules you can read. Models you can check.

OWASP CRS v4 catches the known patterns. Learned endpoint profiles catch whatever does not look like your own traffic.

Attack detectionCoraza · CRS v4 · native detectors

Corslet computes its own anomaly score, so each category gets its own switch and its own action: block, challenge, ban or log. Low, Balanced, Strict and Paranoid presets set the starting point; paranoia level and thresholds can be overridden per site.

  • SQLi
  • XSS
  • RCE
  • LFI / RFI
  • XXE
  • SSRF
  • CRLF
  • Path traversal
  • Webshell upload
  • Log4Shell
  • libinjection
Learned endpoint profilesa positive security model

From clean traffic, Corslet learns each endpoint's methods, content types, parameters, value types, allowed characters, lengths and small enums. Requests that don't fit are scored in their own anomaly category.

Learningobserves clean traffic
Staginglogs deviations only
Enforcescores deviations

Only zero-score, unblocked, non-error requests are learned, and a shape needs at least N distinct clients. No raw values leave the gateways.

False positivesfixed from the event itself

Create an exclusion by path, regex, rule, category or parameter in one click from an attack event. If a learned profile was too narrow, widen it from the same place.

Web ACL & IP listsglobal and per site

Custom rules are OR-of-AND conditions over IP, IP group, path, query, method, host, headers, cookies, arguments, body, user agent, country, content type and more. Actions: allow, block, challenge, auth, log, ban, redirect, tag.

Reusable IP groups, allow and deny lists, and threat-intel feeds such as FireHOL, Spamhaus DROP and Tor exit nodes. Clients are banned automatically after N attacks in M seconds, on every gateway at once.

02 / Traffic & bots

Tell people, crawlers and scripts apart.

Rate limits, bot signals and verified crawler ranges are evaluated per request, with counters shared across every gateway replica.

Bot score0–99, per request

Built from the JA4/JA3 TLS fingerprint against the claimed browser, header consistency (client hints, Sec-Fetch-*), hosting-network ASNs, behaviour such as 404 bursts or crawling without assets, and solved challenges.

0 · pass60 · challenge85 · block

Example thresholds. Both are configurable, with overrides per path. The score is forwarded to your app and usable in rules as bot_score, ja4, asn, verified_bot.

Verified crawlerschecked against published ranges

Googlebot, Bingbot, Applebot, DuckDuckBot, GPTBot, ChatGPT-User, PerplexityBot and others are verified against their operators' IP ranges, refreshed daily, or by forward-confirmed reverse DNS. Allow, challenge or block each category, for example AI training crawlers. Impostors using a crawler's User-Agent are blocked.

Rate limitingsliding window, cluster-wide

Limit per IP, IP and path, IP and User-Agent, header, cookie or globally. Filter by method, path and status code, so repeated 401s count as brute force. Block, challenge or ban.

Automatic attack modefor HTTP floods

Requests per second are counted across all gateways and compared with the learned normal level. When a flood starts, every new visitor gets the challenge, rate limits tighten and the bot-score threshold drops. Allow-listed IPs and verified crawlers are never affected, and hysteresis keeps it from flapping.

There is also a manual "I'm under attack" switch with a time limit, and an incident history with peak, top IPs, countries and paths.

Challengesno third-party CAPTCHA

A JavaScript proof-of-work with adjustable difficulty and HMAC clearance cookies bound to IP and User-Agent. Headless and automation browsers are detected. For staging sites there is a separate auth gate with a shared password or a bcrypt user list.

03 / Logins & APIs

Protect the endpoints attackers aim for.

Login forms and APIs get dedicated checks that understand failed logins, OpenAPI contracts and tokens.

Account-takeover protectionpresets for WordPress, Django, JSON APIs

Failed logins are recognised by status, redirect, cookie or body. Corslet detects brute force per IP, credential stuffing (many usernames from one IP), attacks on one account, distributed brute force and failure-rate waves.

A username under attack must pass the bot challenge, so its owner is never hard-locked out. Usernames are stored only as keyed hashes and passwords are redacted. An optional breached-password check uses the Have I Been Pwned k-anonymity API and is off by default.

API protectionOpenAPI 3.0 / 3.1 · Swagger 2.0

Upload or link a spec and the gateways enforce it: unknown endpoints and methods, parameter types, formats, ranges and patterns, and JSON, form and multipart bodies, including additionalProperties: false and oneOf with discriminators. Violations are answered with RFC 9457 problem responses.

  • JWT · JWKS · alg allowlist
  • GraphQL depth & alias limits
  • Shadow endpoint inventory
  • Per-user rate limits
  • Export learned profile as OpenAPI
Responseswhat leaves your app

Strip server banners, add security headers, CSP and HSTS, mask card numbers, and replace upstream 5xx pages. Optional per-response HTML encryption and JavaScript obfuscation make scraping harder.

04 / Kubernetes

An ingress class with a firewall in it.

Point an Ingress at the corslet class and each host becomes a protected application. Tune it in the console or keep it all in Git.

Annotations for the common cases

Mode, protection level, bot protection, rate limits and blocked countries fit in a few annotations. Routing follows the Ingress, TLS secrets are imported, and the gateway address is written to status.loadBalancer.

Custom resources for everything else

CorsletSite defines an application without an Ingress. CorsletPolicy attaches the full protection settings, with API specs from ConfigMaps and passwords from Secrets.

Whatever a Kubernetes object owns is read-only in the console, and kubectl get csite,cpol shows whether each object was applied.

Chart valuePurpose
postgresql.enabled=trueBundled PostgreSQL; allows several control-plane replicas
gateway.autoscaling.*HPA, 2–10 gateway replicas
networkPolicy.enabledOnly gateway pods reach xDS (on by default)
metrics.serviceMonitor.enabledPrometheus Operator scraping
shop-ingress.yamlnetworking.k8s.io/v1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: shop
  annotations:
    corslet.io/mode: block            # block | detect | off
    corslet.io/level: balance         # low | balance | strict | paranoid
    corslet.io/bot-protection: suspicious
    corslet.io/rate-limit: "300/60"   # requests / seconds per IP
    corslet.io/block-countries: "KP,IR"
spec:
  ingressClassName: corslet
  tls: [{ hosts: [shop.example.com], secretName: shop-tls }]
  rules:
    - host: shop.example.com
      http:
        paths:
          - { path: /, pathType: Prefix, backend: { service: { name: shop, port: { number: 80 } } } }
          - { path: /api, pathType: Prefix, backend: { service: { name: shop-api, port: { name: http } } } }
baseline-policy.yamlcorslet.io/v1alpha1
apiVersion: corslet.io/v1alpha1
kind: CorsletPolicy
metadata: { name: baseline, namespace: shop }
spec:
  targetRefs: [{ group: networking.k8s.io, kind: Ingress, name: shop }]
  protection:
    detection: { level: strict }
    bot: { enabled: true, scope: all }

05 / Architecture

Two binaries and a console.

Gateways are Envoy with one dynamic module. The control plane serves their configuration and collects what they see.

Clients reach the gateway on ports 80 and 443. The gateway, Envoy with the libcorslet module, forwards clean traffic to your apps. It gets listeners, routes and certificates from the control plane over ADS gRPC on port 18000, and long-polls policy and sends telemetry on port 9443. The control plane stores data in SQLite or PostgreSQL and watches Ingress, CorsletSite and CorsletPolicy objects. Clientsbrowsers, bots 80 / 443 Gateway Deployment · HPA Envoy 1.40 libcorslet.so clean traffic Your appsServices, upstreams ADS gRPC :18000listeners · routes · certs policy long-poll :9443events · stats · counters Control plane REST API · console · xDS · policy hub ACME · Kubernetes sync · threat feeds DatabaseSQLite or PostgreSQL Kubernetes APIIngress · CorsletSite watched by the control plane
Compiled once, swapped atomically

Each gateway compiles a new policy snapshot once and swaps it in. Nothing restarts, and listeners never drain.

Gateways survive a control-plane outage

The last snapshot is cached on disk, so a gateway can start and keep serving while the control plane is down.

Scale either side

Gateways scale with an HPA and share rate-limit counters. Control-plane replicas share PostgreSQL and a revision counter.

06 / Operations

The parts you need on day two.

The console is built into the control-plane binary. Its fonts and scripts ship with it, so it makes no requests to third parties.

  • CertificatesLet's Encrypt over HTTP-01, or DNS-01 with 14 DNS providers, wildcards included. Upload, self-signed or Kubernetes secrets, selected by SNI.
  • SitesDomains and wildcards, weighted and backup upstreams, path routes, health checks, retries, circuit breakers, CORS, header rewrites, WebSockets.
  • Sign-inOIDC single sign-on with group-to-role mapping, with presets for Keycloak, Entra ID, Okta, Google Workspace, authentik and Dex. TOTP for local accounts.
  • RolesAdmin, editor and viewer, API tokens, and an audit log of every change and failed sign-in.
  • VisibilityDashboard for traffic, attack types, countries, top IPs and paths. Searchable event log with full request context, CSV export, sampled access log.
  • AlertsSlack, Teams, Discord, Telegram, email and webhooks.
  • SecretsTLS keys, TOTP and SSO secrets encrypted at rest with AES-256-GCM when an encryption key is set. Key rotation on restart.
  • Testing labTry payloads and rules against the real engine before they go live. Custom block pages, maintenance mode, backup and restore.

07 / Install

Running in a few minutes.

Signed images and the Helm chart are published to GHCR with every release. Pick what fits your setup.

  1. Install the chart
    helm install corslet oci://ghcr.io/corslet-waf/charts/corslet --version <version> \
      -n corslet --create-namespace
  2. Read the generated admin password (user admin)
    kubectl -n corslet get secret corslet-secrets -o jsonpath='{.data.admin-password}' | base64 -d
  3. Open the console at localhost:9443
    kubectl -n corslet port-forward svc/corslet-controlplane 9443:9443