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 / frameworkCompose serviceHost portRedis DB
node / Expressaiwaf30000
fastifyaiwaf_fastify30021
hapiaiwaf_hapi30032
koaaiwaf_koa30043
nest / NestJSaiwaf_nest30054
next / Next.jsaiwaf_next30065
adonis / AdonisJSaiwaf_adonis30076
sails / Sails.jsaiwaf_sails30087
djangoaiwaf-django30098
flaskaiwaf-flask30109
fastapiaiwaf-fastapi301110
java / Servletaiwaf-java808014
spring / Bootaiwaf-spring808414
java-r / JRE with Raiwaf-java-r808514
spring-r / Boot with Raiwaf-spring-r808614
laravel / separate PHPaiwaf-laravel-php81808111
symfony / separate PHPaiwaf-symfony-php82808212
wordpress / separate PHPaiwaf-wordpress-php80808313
Direct fixturesecurity-fixture8090, loopbackEphemeral application state
Protected fixtureaiwaf-assessment3020, loopback15
TLS direct / protectedassessment-tls8443 / 8444, loopbackNone

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

RuntimeBehaviorSettings
JavaScriptSanitized rate-cache failures produce generic 503 responses in closed mode.AIWAF_RATE_CACHE_FAILURE_MODE=closed by default; open selects fail-open behavior.
PythonTyped 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.
JavaStandalone 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.