davidcastagnetoa/skills

rate_limiting_gateway

Control de tasa por IP en el API Gateway con ventana deslizante implementada en Redis

First seen Mar 6, 2026

Installation

$ npx skills add davidcastagnetoa/skills --skill rate_limiting_gateway

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from davidcastagnetoa/skills · top by installs.

npx skills add davidcastagnetoa/skills

Browse all from davidcastagnetoa/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 1
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,935 B
  • docs SUMMARY.md 114 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 5 installs

SKILL.md

ratelimitinggateway

El rate limiting en el gateway es la defensa primaria contra ataques de fuerza bruta, scraping y credential stuffing. Se implementa con ventana deslizante en Redis para ser preciso y distribuido entre múltiples instancias de Nginx.

When to use

Aplicar en todos los endpoints del API. Los límites del gateway son más laxos que los del antifraud_agent (que aplica límites específicos por documento/dispositivo).

Instructions

  1. Usar ngxhttplimitreqmodule de Nginx para rate limiting simple:

``nginx limitreqzone $binaryremoteaddr zone=kycapi:10m rate=10r/s; limitreq zone=kycapi burst=20 nodelay; limitreq_status 429; ``

  1. Para rate limiting distribuido entre instancias, usar lua-resty-limit-traffic con Redis:

``lua local limitreq = require "resty.limit.req" local lim = limitreq.new("redispool", 10, 20) -- 10 req/s, burst 20 local delay, err = lim:incoming(ngx.var.binaryremote_addr, true) if not delay then if err == "rejected" then ngx.exit(429) end end ``

  1. Límites por endpoint:

- POST /v1/verify (inicio de sesión KYC): 5 req/min por IP. - GET /v1/status/{session_id}: 30 req/min por IP. - GET /health: sin límite.

  1. Devolver header Retry-After con el tiempo de espera en respuestas 429.
  2. Logear todos los 429 con IP y endpoint — son señal de ataque o cliente mal programado.

Notes

  • El rate limiting del gateway es por IP. El del antifraud_agent es por documento/dispositivo — son capas complementarias.
  • Las IPs que generan 429 repetidamente deben escalarse a la blacklist tras N violaciones.
  • En Kubernetes con múltiples pods de Nginx, el Redis compartido garantiza que el límite sea global.