Reference
Runtime and Redis reference
Source and package versions
One AIWAF repository.
Python: py/aiwaf/ · Node.js: js/ · Rust/WASM: rust/ · Java: java/.
Source and canonical README.
Versions shown describe the source checkout; package releases are independent.
Current Python/Node source targets are aiwaf 1.1.8 (Python) and
aiwaf 1.1.5 (npm), with Rust/Python 0.2.7 and
WASM 0.2.5 and Java 1.3.5. Sandbox guides retain their separately pinned builds.
Services and ports
Proxy traffic targets juice:3000 inside Docker. The direct host baseline uses port 3001. Test names below work with repeated --target NAME=URL arguments.
| Test name / framework | Compose service | Host port | Redis DB |
|---|---|---|---|
| node / Express | aiwaf | 3000 | 0 |
| fastify | aiwaf_fastify | 3002 | 1 |
| hapi | aiwaf_hapi | 3003 | 2 |
| koa | aiwaf_koa | 3004 | 3 |
| nest / NestJS | aiwaf_nest | 3005 | 4 |
| next / Next.js | aiwaf_next | 3006 | 5 |
| adonis / AdonisJS | aiwaf_adonis | 3007 | 6 |
| sails / Sails.js | aiwaf_sails | 3008 | 7 |
| django | aiwaf-django | 3009 | 8 |
| flask | aiwaf-flask | 3010 | 9 |
| fastapi | aiwaf-fastapi | 3011 | 10 |
| java / Servlet | aiwaf-java | 8080 | 14 |
| spring / Boot | aiwaf-spring | 8084 | 14 |
| java-r / JRE with R | aiwaf-java-r | 8085 | 14 |
| spring-r / Boot with R | aiwaf-spring-r | 8086 | 14 |
| laravel / separate PHP | aiwaf-laravel-php81 | 8081 | 11 |
| symfony / separate PHP | aiwaf-symfony-php82 | 8082 | 12 |
| wordpress / separate PHP | aiwaf-wordpress-php80 | 8083 | 13 |
| Direct fixture | security-fixture | 8090, loopback | Ephemeral application state |
| Protected fixture | aiwaf-assessment | 3020, loopback | 15 |
| TLS direct / protected | assessment-tls | 8443 / 8444, loopback | None |
PHP is excluded from the current source runner. R variants run the Java engine in an R-containing image; they are not separate R AIWAF packages.
State ownership and persistence
Redis 7 uses AOF persistence in redis_data, has no published host port, and must pass its health check before protected services start. Services isolate state by database and key prefix. Java integrations share DB 14 with separate sandbox:java:, sandbox:spring:, sandbox:java-r:, and sandbox:spring-r: storage prefixes.
- JavaScript uses rate-limit lists through the cache adapter.
- Django uses its native Redis cache for rate limits, honeypot and anomaly history; WATCH/MULTI updates preserve serialized buckets across concurrent writers.
- Flask/FastAPI use a shared rate-limit cache.
- Java stores engine state, reputation and distributed counters.
- PHP uses the Redis extension and RedisAdapter for rate counters.
Python/JavaScript model and blocklist storage retains supported adapter backends. A Redis rate cache does not move all state into Redis. Workers of one service must share its namespace for an aggregate budget. Startup clearing is disabled; rate keys expire and restarts preserve state.
docker compose exec redis redis-cli INFO keyspace
docker compose exec redis redis-cli -n 14 --scan --pattern 'sandbox:*'Cache failure policies
| Runtime | Behavior | Settings |
|---|---|---|
| JavaScript | Sanitized rate-cache failures produce generic 503 responses in closed mode. | AIWAF_RATE_CACHE_FAILURE_MODE=closed by default; open selects fail-open behavior. |
| Python | Typed RateCacheUnavailable errors produce generic 503 responses. Invalid requested Redis configurations no longer silently switch to memory. | AIWAF_RATE_CACHE_BACKEND=redis, AIWAF_REDIS_URL, AIWAF_RATE_CACHE_KEY_PREFIX. rediss:// delegates to redis-py; the minimal fallback driver lacks TLS. |
| Java | Standalone Redis with bounded waits, default closed policy. | AIWAF_REDIS_FAILURE_MODE=fail_closed or fail_open. Connection/socket/pool waits: 1000/2000/250 ms. |
JavaScript retains compatibility with legacy cache configurations. Closed mode rejects failed operations on the selected cache; it does not establish that every adapter configuration selects Redis. Flask invalid backend setup fails initialization; FastAPI invalid runtime cache configuration is rejected. Shared JavaScript upstream connection failures return generic 502 bad_gateway. See live outage scope.
SDK and request-inspection changes
The pinned commit contains Python/JavaScript 1.1.1 and Java 1.3.2 source: Python/JavaScript SQL inspection, Java SQL rules and keyword-learning safety, Java decoded query/body previews, JavaScript JSON body handling, Python atomic rate updates, and sanitized Redis failures. Source and registry releases are independent. Rust/WASM dependencies are resolved separately from that source snapshot. Rust/Python 0.2.2 is now published; inspect installed versions rather than assuming the pinned source revision selects the newest accelerator.
Node imports aiwaf. Plain Java reads /app/aiwaf.json with environment overrides and supports AIWAF_CONFIG_FILE. Spring uses Boot auto-configuration and route discovery. Its sandbox forwarded-IP trust covers 172.16.0.0/12; change AIWAF_SANDBOX_TRUSTED_PROXY_CIDRS to your actual proxy CIDRs elsewhere.
Dependency hardening
- Node:
npm ci, compiler build stage, digest-pinned Node 22 slim runtime, npm 12.2.0, patched bundled undici and brace-expansion. - Python: refreshed digest-pinned 3.11 base, Linux x86_64/CPython 3.11 wheel hashes, setuptools 84.0.0 and wheel 0.48.0.
- Java: Jackson 2.22.3; Spring Boot 4.0.8 overrides Jackson 2/3 to 2.22.3/3.1.7 and Tomcat to 11.0.25.
- Java/R: patched Ubuntu OpenSSL 3.0.13-0ubuntu3.16 packages.
- Runtime images copy their own application and shared helpers. Tool caches, TLS material, reports and build outputs are excluded from build contexts.
These measures reduce known findings; they are not provenance verification or a resolved SBOM. Read remaining advisory findings.
