@@ -231,7 +231,10 @@ A run takes `RunConfig` (`packages/roach/src/types.ts`): `tenant`, `mode`, `rule
231231 1 Mi characters. A run with the token learns at most 16,384 values, with
232232 a total of 16 Mi characters, for credentials that change on each
233233 request, such as AWS signatures. The whole value and each part of it
234- count, also for the `secrets` of the run. A run whose `secrets` go past
234+ count, also for the `secrets` of the run. The proxy also redacts each
235+ part with `\/` for `/`, as some servers write it in JSON, and the whole
236+ value when a `/` is only in parts shorter than 12 characters. These
237+ forms do not count. A run whose `secrets` go past
235238 the limit gets HTTP 400 when it starts. Past the limit, a request with a
236239 new credential gets HTTP 431, and the proxy does not send or record it.
237240 A request with known credentials goes on. Start a new run to learn more.
@@ -305,7 +308,24 @@ A run takes `RunConfig` (`packages/roach/src/types.ts`): `tenant`, `mode`, `rule
305308 ` secret_key` , `private_key`, and `secret_access_key`. In JSON, these
306309 fields count at each depth. In an `application/x-www-form-urlencoded`
307310 body, the form fields count. No key uses this text, so this list can be
308- longer.
311+ longer. The proxy replaces the value at the place of each field, and
312+ each other string that is the same value. A value pattern can change
313+ the text of a key, so then the proxy checks the result. It parses the
314+ body again, and the body must be JSON. Each field must hold
315+ ` <<redacted>>` at its place, and no string can be one of the values.
316+ Only the body counts, not a key header. When a check fails, the request
317+ sample has no text, and the proxy writes a log line with the key. This
318+ occurs when a value pattern takes a quote, or a name of a field, away.
319+ A request with credential fields also gets no text when the name of a
320+ value of its rule has `"`, `\`, `&`, `=`, `<`, `>`, or a control
321+ character, because its `<<name>>` can add a field. A miss has no change
322+ then.
323+ - The proxy cannot find the fields of a body that is not JSON or a form,
324+ such as JSON with a comma at the end, JSON lines, or a multipart body.
325+ So the request sample of such a body has no text when the body has the
326+ name of a field above anywhere. The name can be in any case, with `_`,
327+ ` -` , or nothing between its words, such as `accessToken`. This is one
328+ search of the body, so a long body costs little.
309329- The proxy parses a JSON body to find the fields, so a long string value
310330 cannot stop it. It does not find a field whose value is not a string,
311331 such as an array, or a field in JSON text that is itself a string, such
@@ -462,8 +482,10 @@ shows it.
462482 change would let anyone guess the requests of a tenant back, one
463483 character at a time.
464484- A miss has no change when there is no sample, such as for a recording
465- from an older version, or when the texts are the same in the part that
466- the sample keeps.
485+ from an older version, when the sample has no text (`withheld`, see
486+ [Config](#config)), or when the texts are the same in the part that the
487+ sample keeps. A sample with no text still takes the place of the older
488+ sample, so a miss never compares with a request that is not the last.
467489- The proxy redacts the text of the miss before it compares it. This has
468490 the time limit of a key, and for a run without the token it runs in the
469491 worker process of the keys (see [Changing values](#changing-values)).
@@ -626,10 +648,11 @@ Each proxied request is one trace. Each span has `roach.tenant`,
626648 response has token usage, the span also has the `gen_ai` attributes of
627649 the model call (`usage.ts`). Sentry then calculates its cost in USD as
628650 ` gen_ai.cost.total_tokens` . The span of the first miss of a session also
629- has `miss.sample` (`found` or `none`), in every run. When the proxy finds
630- a change, the span also has `miss.changed_at` (the offset of the first
631- different character), `miss.compared` (the key of the recording), and
632- the redacted text of the change : ` miss.recorded` and `miss.request`.
651+ has `miss.sample` (`found`, `withheld`, or `none`), in every run. When
652+ the proxy finds a change, the span also has `miss.changed_at` (the
653+ offset of the first different character), `miss.compared` (the key of
654+ the recording), and the redacted text of the change : ` miss.recorded` and
655+ ` miss.request` .
633656 Only Sentry gets these texts ([Misses](#misses)). It contains:
634657 - `roach.key` : the key of the request, with `roach.rule` and
635658 ` roach.key` .
0 commit comments