Skip to content

Phase 0

Phase 0 is the current draft state of Tlapiani (draft PR #1). This page lists what the module does today. It does not describe planned features. For those, see Roadmap.

One Caddy handler can run either engine, or both:

  • Coraza (v3.8.1) with the embedded OWASP Core Rule Set (coraza-coreruleset v4.25.0). Both are pure Go. There is no cgo.
  • T1K client, the protocol used by Chaitin SafeLine detectors. It needs a separate SafeLine detector process. The detector itself is proprietary and is not part of Tlapiani.

The original waf_chaitin directive from the starting fork is unchanged.

The order is fixed. Coraza runs its request phases first, then T1K runs. If Coraza denies a request, T1K is not called for that request.

  • mode detect_only logs the match and lets the request continue. This applies to both engines.
  • mode block denies matching requests.
  • Coraza blocks with the rule status. For the OWASP CRS deny action this is 403.
  • T1K still returns 501, with the same JSON response shape as before.

load_owasp_crs mounts the embedded OWASP CRS rules. Paths that start with @ are not files on disk. They resolve to the embedded rule sets inside the binary.

log_file writes JSONL decision records. Each record includes fields such as engine, action, rule_id, and event_id. The same fields are also emitted on the Caddy logger.

Tlapiani exposes these metrics, labeled by engine (coraza or t1k):

  • caddy_waf_engine_requests_total{engine,action}
  • caddy_waf_engine_detect_duration_seconds{engine}

The existing T1K pool and health metrics are unchanged.

The test suite runs without cgo:

Ventana de terminal
CGO_ENABLED=0 go test ./...

The tests block a SQL injection sample and an XSS sample. They do so twice: once with inline libinjection rules, and again with the embedded OWASP CRS. The T1K pool tests do not need a live detector.

  • Request phases only. CRS response rules, which run in phases 3 and 4, are not applied.
  • T1K addresses are IP:port. Unix sockets are rejected. This matches the behavior of waf_chaitin.
  • Errors fail open. If Coraza or T1K returns an error, the request is not blocked by that error.
  • No admin UI.
  • No native detector. T1K mode needs a separate SafeLine detector.
  • No telemetry. Nothing is sent to any third party.