Gateway import guide
One x-security policy compiles to whichever gateway you run. This page is the canonical per-gateway matrix and the operator path per target: the exact artifact xsecurity generate writes, the command that loads it, and what each backend can and cannot do in shadow.
Targets at a glance
| Target | Status | Artifact | Load command | Shadow support | Rollback |
|---|---|---|---|---|---|
kong | beta | kong.yml | deck sync or POST /config | None today | Your deploy process (git revert + reload) |
coraza | beta | x-security.conf / coraza.yml | Include + reload | Engine switch (SecRuleEngine DetectionOnly, you flip it) | Your deploy process (git revert + reload) |
bunkerweb | beta | configs/modsec/x-security.conf | Mount; bw-scheduler syncs | Engine switch (SecRuleEngine DetectionOnly, you flip it) | Your deploy process (git revert + reload) |
openappsec | beta | policy.yaml + openapi-schema.yaml | Mount into the agent container | Native (mode: detect) | Your deploy process (git revert + reload) |
envoy | alpha | envoy.yaml (+ lua, OPA rego) | Mount + restart / ConfigMap | None today | Your deploy process (git revert + reload) |
cloudflare | live · hosted | Rulesets API JSON | Deployed by the hosted platform | Native (action: log) | Per-rule promote + watch-window auto-revert — shadow mode |
aws-apigw | beta · hosted | WAFv2 WebACL + usage plans | Deployed via AssumeRole | Native (Count) | Per-rule promote + watch-window auto-revert — shadow mode |
action: log), AWS WAFv2 (Count), both pushed by the hosted deployer with per-rule promote and a watch-window auto-revert, and OpenAppSec (policy mode: detect). The Coraza/ModSecurity family and BunkerWeb emit enforcing rules; you flip the engine to SecRuleEngine DetectionOnly to observe first. Kong and Envoy have no shadow mode today.Kong — beta
# Generate
$ xsecurity generate openapi.yml --target kong --out ./out
# Load — pick one
$ deck sync -s out/kong.yml # decK
$ curl -X POST http://kong-admin:8001/config \
-F config=@out/kong.yml # DB-less admin APIOSS 3.x and Enterprise. Notable: on OSS, bearer-JWT supports HS256 only. RS256/ES256 need --kong-edition=enterprise; every downgrade is written to _x_security_warnings inside the artifact, never silent.
Coraza / ModSecurity — beta
# Generate (engine: modsec-nginx | modsec-apache | coraza-go | coraza-spoa)
$ xsecurity generate openapi.yml --target coraza --coraza-engine modsec-nginx --out ./out
# Load (modsec-nginx): mount + include, then reload
# /etc/modsecurity.d/x-security.conf <- out/x-security.conf
$ echo "Include /etc/modsecurity.d/x-security.conf" >> /etc/modsecurity.d/setup.conf
$ nginx -s reload
# Load (coraza-go): feed directives to the embedded WAF
# waf, _ := coraza.NewWAF(coraza.NewWAFConfig().WithDirectives(cfg.Directives))Four engine profiles: modsec-nginx (default), modsec-apache, coraza-go, coraza-spoa (HAProxy stick-table rate limits). Per-identifier rate limits downgrade to global on libmodsecurity3 and say so in WARNINGS.md.
BunkerWeb — beta
$ xsecurity generate openapi.yml --target bunkerweb --out ./out
# Mount out/configs/ under the bw-scheduler /data/configs volume;
# the scheduler syncs rules into BunkerWeb on its poll interval.
# Read out/DEPLOYMENT.md — it lists per-policy warnings and required env settings.OpenAppSec — beta
$ xsecurity generate openapi.yml --target openappsec --out ./out
$ docker run ghcr.io/openappsec/agent-unified:latest \
-v ./out/openappsec/policy.yaml:/etc/appsec/policy.yaml:ro \
-v ./out/openappsec/openapi-schema.yaml:/ext/appsec/openapi-schema.yaml:ro \
-e POLICY_FILE=/etc/appsec/policy.yamlThe only self-hosted target with native detect/prevent modes per policy. Its ML layer needs baseline traffic before prevent is trustworthy. Plan an observation window.
Envoy — alpha
$ xsecurity generate openapi.yml --target envoy --out ./out
$ docker run -v ./out/envoy.yaml:/etc/envoy/envoy.yaml \
envoyproxy/envoy:v1.27-latest -c /etc/envoy/envoy.yaml
# Kubernetes: ship envoy.yaml as a ConfigMap and mount it into the proxy pod.
# If emitted: x-security.lua (body-level checks) and opa/policy.rego (ext_authz).Cloudflare & AWS — hosted deploy
These two have no CLI generator: the CLI produces feasibility reports (xsecurity report --feasible cloudflare,aws-apigw), and the hosted platform deploys the compiled rules — Cloudflare Rulesets with action: log, AWS WAFv2 WebACLs with Count — shadow-first, per-rule promote, watch-window auto-rollback (see shadow mode). AWS uses AssumeRole with an externalId; no long-lived credentials are stored.
Test and verify
# Closed-loop Docker test (kong · coraza · bunkerweb · openappsec)
$ xsecurity test openapi.yml --target kong
# Post-deploy drift check (kong · coraza · bunkerweb · openappsec · envoy)
$ xsecurity verify openapi.yml --target kong --gateway http://kong-admin:8001xsecurity test boots the real gateway in Docker, replays traffic, and asserts allow/deny per rule. xsecurity verify reads the deployed config back and exits non-zero on drift. Wire it into CI.