Gateway redirects suspicious traffic (by IP + sensitive route + rate) to sandbox containers. Normal traffic hits real routes.
- Node.js 18+
- Docker (optional, for sandbox)
- Redis
-
Start Redis
docker run -d -p 6379:6379 --name redis redis:alpine
-
Gateway
cd gateway npm install node index.jsListens on port 3001.
-
Sandbox image (optional)
cd sandbox docker build -t sandbox-image .
When rate limit is exceeded on sensitive routes, gateway spawns containers from this image.
| Route | Behavior |
|---|---|
/health |
Always real response |
/api/users |
Real response; rate-limited, then redirect to sandbox |
/admin |
Real response; rate-limited, then redirect to sandbox |
# Real response (under limit)
curl http://localhost:3001/api/users
# Health (never limited)
curl http://localhost:3001/health- gateway/ – Express app, rate limit, Redis, sandbox redirect
- sandbox/ – Docker app served in isolation (
/admin,/api/users) - gateway/scripts/ – Create test IPs/users, remove test IPs from Redis