The admin-token comment said the same thing twice, and its numbers were stale
The reasoning paragraph in AdminEndpoints was pasted twice by an earlier patch,
and the measurement it quoted ("0 token lines at the shipped level, 2 at
Information") came from a single request without saying so. Re-measured against
the image built from this tree (openwaf:ci, 261 MB): one query-string request
leaves 0 lines containing the token at the shipped level and 2 at Information -
"Request starting" and "Request finished" - so two such requests leave 4, and
a header request leaves 0 at either level.
Teeth counted on this tree, not on the earlier one: guarding the warning behind
an env var that is never set makes exactly 1 integration test fail -
A_token_in_the_query_string_is_served_but_named_in_the_log_without_the_secret -
and leaves 33 passing. The sibling test cannot catch that removal: it asserts
the absence of a warning, so it passes either way. The pair is one trap, not two.
Gates on the committed tree: build 0 warnings / 0 errors, unit 59/59,
integration 34/34.
This commit is contained in:
@@ -48,22 +48,12 @@ internal static class AdminEndpoints
|
||||
// history keeps, and at the shipped log level the edge does not log
|
||||
// URLs - but raising Microsoft.AspNetCore to Information, which is
|
||||
// the ordinary next move when something is misbehaving, makes
|
||||
// Kestrel log the full URL including this token (measured: 0 token
|
||||
// lines at the shipped level, 2 at Information). So the request is
|
||||
// served and the moment it happens is named, without ever repeating
|
||||
// the secret.
|
||||
// The query string is accepted for one reason: an operator typing
|
||||
// curl at a keyboard does it without thinking, and refusing them is
|
||||
// how an operator ends up disabling the auth instead of learning the
|
||||
// header. What is NOT acceptable is doing it silently. A URL is the
|
||||
// one part of a request that every access log, proxy log and browser
|
||||
// history keeps, and at the shipped log level the edge does not log
|
||||
// URLs - but raising Microsoft.AspNetCore to Information, which is
|
||||
// the ordinary next move when something is misbehaving, makes
|
||||
// Kestrel log the full URL including this token (measured: 0 token
|
||||
// lines at the shipped level, 2 at Information). So the request is
|
||||
// served and the moment it happens is named, without ever repeating
|
||||
// the secret.
|
||||
// Kestrel log the full URL including this token. Measured on the
|
||||
// shipped image: one query-string request leaves 0 lines containing
|
||||
// the token at the shipped level and 2 at Information ("Request
|
||||
// starting" and "Request finished"), and a header request leaves 0
|
||||
// at either. So the request is served and the moment it happens is
|
||||
// named, without ever repeating the secret.
|
||||
if (viaQuery)
|
||||
{
|
||||
filterCtx.HttpContext.RequestServices
|
||||
|
||||
Reference in New Issue
Block a user