From df6ae89e7dc32ba3cf04ab37d73bc5ada595ddef Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Fri, 16 Oct 2026 13:21:16 -0600 Subject: [PATCH] fix: limit Jeannie API edge traffic --- bootstrap/edge/templates/default.conf.tftpl | 4 ++-- docs/jeannie-remote-api.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bootstrap/edge/templates/default.conf.tftpl b/bootstrap/edge/templates/default.conf.tftpl index 4ded0f8..ce70e1c 100644 --- a/bootstrap/edge/templates/default.conf.tftpl +++ b/bootstrap/edge/templates/default.conf.tftpl @@ -12,7 +12,7 @@ access_log /var/log/nginx/crowdsec-access.log; error_log /var/log/nginx/crowdsec-error.log warn; limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s; -limit_req_zone $binary_remote_addr zone=jeannie_api:10m rate=10r/s; +limit_req_zone $binary_remote_addr zone=jeannie_api:10m rate=2r/s; proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=static_assets:10m max_size=100m inactive=24h; proxy_cache_path /var/cache/nginx_dynamic levels=1:2 keys_zone=dynamic_content:5m max_size=50m inactive=1h; @@ -126,7 +126,7 @@ server { } location / { - limit_req zone=jeannie_api burst=20 nodelay; + limit_req zone=jeannie_api; client_max_body_size 64k; proxy_pass http://jeannie_api_backend; diff --git a/docs/jeannie-remote-api.md b/docs/jeannie-remote-api.md index 4c7e1f6..cfee45d 100644 --- a/docs/jeannie-remote-api.md +++ b/docs/jeannie-remote-api.md @@ -32,8 +32,8 @@ edge proxy at `api.lab2025.duckdns.org`. The backend remains the Debian host at `192.168.100.73:8787`; Kubernetes does not run a second Jeannie server and is not required for API availability. -The edge gateway applies a per-client rate limit of 10 requests per second -with a burst of 20, forwards the bearer token to Debian, and uses 35-second +The edge gateway applies a per-client rate limit of 2 requests per second with +no burst, forwards the bearer token to Debian, and uses 35-second proxy read/write timeouts. The Jeannie API remains responsible for bearer authentication and command allowlisting. Read-only retries are not enabled at the edge; `POST /v1/execute` is never retried so a command cannot be submitted