Skip to content

Client identity Since v0.2 ​

Client identity says what "one client" is for an application. Without it, a client is its address: behind a NAT many users look like one, and a user whose phone changes networks looks like several. With identity, the product names each request's client by the first source present in the request, and every security event records it. Object ownership, business flows and LLM budgets count per identity.

Identity is on by default. Every application has the sources consumer, user, ip: an authenticated API consumer if there is one, else the session user, else the address. New applications need no change.

Before you begin ​

  • Role: operator changes identity settings and rotates the identity key. viewer reads.
  • A consumer or jwt_claim source needs API authentication set up first. For details, see Authentication and API keys.
  • A user source needs the Sessions module to bind sessions to logins.

Choose the sources ​

Sources are tried in order, and the first one present wins. You can list at most 10.

KindPresent whenNotes
consumerAPI authentication verified an API key or JWT.The configured consumer's name, or the token subject or key ID if no consumer matched.
jwt_claimA JWT was verified and has the claim.claim: sub (any claim name, also URL-shaped). Needs at least one JWT rule. Claims of tokens that fail verification are never read. At most 4.
userThe sessions module bound the session to a login.As the sessions module shows it (redacted unless user names are shown).
cookieThe request has the cookie.name: sessionid. A cookie sealed by cookie protection counts by its opened value. At most 4.
headerThe header is present and the client address is in trusted_from.name: X-Customer-Id, trusted_from: [10.0.0.0/8] (required, at most 32 entries). Authorization, Cookie and Proxy-Authorization are refused: use consumer or jwt_claim. At most 4.
ip_ja4The TLS fingerprint (JA4) is known.Address and fingerprint together: separates different client programs behind one address.
ipAlways, when the address is known.IPv6 addresses are grouped by the IPv6 prefix.

The header source trusts the address you see

The header source trusts the address the product sees as the client, after trusted proxies. List the gateway that sets the header in trusted_from, and do not also list it as a trusted proxy. Otherwise the address becomes the end user's and the header is ignored.

Set the sources ​

text
1. Open Applications > All applications, and select the application.
2. Open Request checks > Client identity, tab Sources.
3. Add a source, pick its kind (the fields that kind needs appear), and move sources up or down.
4. Select Preview changes, add a comment and select Apply.
sh
waap identity sources -app shop
waap identity sources -app shop -f sources.yaml -m "identify by consumer and cookie"
waap identity sources -app shop -add kind=cookie,name=sessionid -before 3
waap identity sources -app shop -remove 2
waap identity sources -app shop -reset
yaml
# applications[].policy.identity
identity:
  sources:
    - { kind: consumer }
    - { kind: jwt_claim, claim: sub }
    - { kind: cookie, name: sessionid }
    - { kind: header, name: X-Customer-Id, trusted_from: [10.0.0.0/8] }
    - { kind: ip }
  ipv6_prefix: 64

While the list is the default, the page says so. Saving writes it explicitly. Nothing is saved until you preview and apply.

Test a request ​

The Test a request tab answers which source wins for a request you describe, without sending or storing anything.

text
1. Open Request checks > Client identity, tab Test a request.
2. Enter the Client address, Path, Session user, API consumer, Cookies, Headers and Verified JWT claims.
3. Read the result.
sh
waap identity test -app shop -ip 203.0.113.5 -cookie sessionid=abc -header X-Customer-Id:42 -path /api/orders
text
POST /v1/apps/shop/identity/test

The result names the source that wins, the kind, the label, the keyed hash (made with a throwaway secret, so only its shape is real), and why earlier sources did not apply. A header from a peer outside trusted_from is "absent". With a path, it also says whether identity.required would be recorded. Labels are masked for viewers and for applications that mask logs.

Require a known client on some paths ​

Paths needing a known client lists paths (exact, or prefixes ending in *) where a client must be known by more than its address. A request there identified only by ip or ip_ja4 gets rule identity.required (variable IDENTITY, value the kind found). With action log (the default) it is logged. With refuse it is refused in block mode.

text
1. Open Request checks > Client identity, tab Settings.
2. Enter the Paths needing a known client, and choose When unknown: log or refuse.
3. Select Preview changes, then Apply.
sh
waap identity set -app shop -m "need a known client on orders" require.paths='/api/orders*' require.action=log
yaml
identity:
  require: { paths: ["/api/orders*"], action: log }

You can except the rule like others with ignore_rules: [identity.required]. If a node has no identity key yet (a fresh node before its first state sync), every client is named by its address and the node logs "no identity key yet" once. The required-identity check is skipped until the key arrives.

Read identity in events ​

Each event has an identity with kind, key and label. An event refused before the identity step (an access rule, a ban, a bot verdict) has none, and the client address stands in. The event store indexes the key, so you can find one client's events across addresses.

In the console, the events list shows the identity under the client address. Select it to see only that client's events. The event detail has an Identity row.

sh
waap events list -identity KEY

The API filter is GET /v1/events?identity=KEY.

The identity key and label ​

The product never stores the raw value as the identity. It computes a key, <kind>:<22 characters>, a keyed hash (HMAC-SHA256) of the value with a per-application secret kept in the store and synced to every node, so the same client has the same key on every node and over time. Values longer than 4 KiB are hashed over their first 4 KiB and their length. The cost is one HMAC per request, about 1 µs.

The event also shows a label. With policy.logging.mask off it is the value itself (at most 128 bytes). Under pci, addresses and consumer names stay, and other values become their first character and six hex digits (a…3f9c1e). Viewers see only the first character.

Rotate the identity key ​

Rotating makes a new key for the application.

text
1. Open Request checks > Client identity, tab Identity key.
2. Select the rotate action and confirm.
sh
waap identity rotate-key -app shop -yes
text
POST /v1/apps/shop/identity/rotate-key

Rotation resets per-identity state

Every client gets a new identity key. Events filtered by an old key find nothing new, and per-identity state (object ownership, flow progress, budgets) starts over. The console asks you to confirm this first.

Settings reference ​

SettingWhat it doesDefaultAllowed valuesApplies in
Sources (policy.identity.sources)The ordered list of sources.consumer, user, ipup to 10; kinds aboveall
IPv6 prefix (policy.identity.ipv6_prefix)IPv6 clients identified by address are grouped by this prefix length (64: one network; 128: each address).6432 to 128sources ip, ip_ja4
Mode (policy.identity.mode)Mode of the required-identity check only.empty (same as the application)detect, block, emptydetect wins over the application's block
Paths needing a known client (policy.identity.require.paths)Paths where an address-only client triggers identity.required.noneexact paths, or prefixes ending in *all
When unknown (policy.identity.require.action)What happens to such a request.loglog, refuserefuse acts only in block mode

Limits ​

LimitValue
Sources10
jwt_claim, cookie, header sources4 each
trusted_from per header source32
Label128 bytes
Value hashedfirst 4 KiB and its length

Troubleshooting ​

Everyone behind one office address looks like one client ​

  • Cause: no source other than the address matched.
  • Check: the Test a request tab, with a typical request.
  • Fix: add a consumer, jwt_claim, cookie or header source.

A header source is ignored ​

  • Cause: the peer that sent it is outside trusted_from, or it is also listed as a trusted proxy.
  • Fix: list the gateway in trusted_from and remove it from the trusted proxies.

Preview refuses a source ​

  • Cause: a header source without trusted_from, Authorization as a header name, or a jwt_claim without a JWT rule.
  • Fix: correct the source as the message says.