Custom logging is disabled by default. To enable logging.default.fields, an
administrator must set spec.enableLoggingFields: true on the Authorino CR.
Creating a TelemetryPolicy alone does not enable custom logging, and logging
fields apply only to routes with an AuthPolicy. This requires an Authorino and
Authorino Operator version supporting custom logging fields.
Metric label and logging field expressions that do not reference auth.* are evaluated
in the gateway's wasm filter and their values are forwarded verbatim: logging fields reach
Authorino as plain strings, outside its log redaction, and metric labels reach Limitador.
A policy whose expression reads a sensitive request header is therefore rejected with
Accepted=False and reason Invalid. The sensitive headers are authorization, cookie,
x-api-key and apikey, matched case-insensitively, the same list Authorino redacts by
default. Reading request.headers or request as a whole, or indexing request.headers
with a key that is not a string literal, is rejected for the same reason, as is an
expression that does not parse. Presence tests do not read the header value and are
accepted in both spellings: has(request.headers.authorization) ? "bearer" : "anonymous",
and for hyphenated names, which has() cannot select,
"x-tenant" in request.headers ? string(request.headers["x-tenant"]) : "". A membership
test naming a sensitive header, such as "authorization" in request.headers, is rejected
like a read of that header.
SectionName is the name of a section in a Kubernetes resource. In the following resources, SectionName is interpreted as the following: * Gateway: Listener name * HTTPRoute: HTTPRouteRule name * Service: Port name
Labels to add to metrics, where keys are label names and values are CEL expressions. On the authorization action an unresolved auth.* label is omitted; any other evaluation failure follows the failure mode of the corresponding protection service, see below
Fields to add to authorization decision logs, where keys are field names and values are CEL expressions. An unresolved auth.* field is omitted from the record; any other evaluation failure follows the failure mode of the authorization service, see below
On the authorization action, logging fields and metric labels that reference auth.* are
evaluated in the auth provider after authentication, and one that cannot be resolved is omitted
from the record or the metric. Every other expression is evaluated in the gateway, and one that
cannot be evaluated for a request, for example a read of a header the request does not carry,
fails the action it belongs to. What happens to the request then follows the failure mode of the
corresponding protection service: the authorization service defaults to failureMode: deny, so
the request fails with HTTP 500 and no decision record is written; the rate limit service
defaults to failureMode: allow, so the request proceeds without rate limiting. On a rate-limit
action that runs after authentication every metric label, including one that references
auth.*, is evaluated in the gateway as part of the descriptor and follows that rule; on one
that runs before authentication, auth.* labels are left out of the descriptor and are not
evaluated. The two sides also see identity differently: a Kubernetes TokenReview identity is
auth.identity.user.username in Authorino but auth.identity.username in the gateway, so one
expression cannot resolve on both, see the
egress observability guide.
Guard optional attributes in the expression itself:
"x-tenant" in request.headers ? request.headers["x-tenant"] : "unknown" works for any header name,
and has(request.headers.xtenant) ? string(request.headers.xtenant) : "unknown" for names without
hyphens. The gateway exposes header names in lowercase, so write request.headers["x-tenant"],
not X-Tenant. CEL optional field syntax (.?) is not supported.