Skip to content

[WAF-08] Implement collection variables, selectors, origins, and macros #9

Description

@chrisbbreuer

Objective

Implement ARGS families, headers, cookies, files, multipart, XML, GEO, RULE, ENV, TX, persistent-collection namespace interfaces, key and regex selectors, exclusions, counts, origins, and runtime macro expansion. Cross-request persistence, expiry, and synchronization for IP/SESSION/USER/GLOBAL/RESOURCE are implemented by WAF-09 against these interfaces.

Deliverables

  • Implement bounded owned collection storage with repeated and map mutation semantics.
  • Preserve source origins and offsets and enforce minimum phase availability.
  • Implement exact and production zig-regex key selectors, exclusions, and count targets.
  • Compile and expand bounded runtime macros with explicit baseline policy.
  • Publish atomic derived ARGS, cookie, header, match, and file metadata families for downstream parsers.
  • Keep request-path work independent from UI, PostgreSQL, and blocking audit I/O.
  • Use Zig 0.17-dev and dependencies pinned through Pantry; do not add Git submodules.

Acceptance criteria

  • The scoped implementation and tests are merged on main in small conventional commits.
  • Zig formatting, focused tests, and the relevant CI suite pass.
  • Compatibility claims have executable evidence and no unexplained skips or silent fallbacks.
  • Untrusted inputs have deterministic entry, key, value, token, output, and physical-allocation bounds.
  • Selector exhaustion is an error, never a false non-match.
  • Documentation, dedicated benchmark, and machine-readable compatibility matrix are updated.

Relationships

Blocked by

Blocks

  • WAF-09 — persistent backends, expiry, synchronization
  • WAF-23 — request target/header/cookie parsing
  • WAF-25 — multipart and file producers
  • WAF-26 — URL-encoded/JSON body producers
  • WAF-27 — XML producers

Baselines

  • ModSecurity 3.0.16
  • Coraza 3.7.0
  • OWASP CRS 4.28.0
  • Zig 0.17-dev resolved and locked through Pantry

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions