namespace OpenWaf.Edge.Admin; /// /// The operator's console: one page, served by the edge itself, over the /// endpoints in . It adds no decision logic — every /// action on the page is one call to an endpoint that already exists. /// /// Two properties are inherited from the admin API rather than invented here, /// and both are load-bearing: /// * /admin is on the always-pass list, so an operator who is themselves /// blocked can still reach the page that clears it; /// * the always-pass surface is never observed, so fumbling the page cannot /// build a streak against the operator. /// /// The token is never in a URL. A token in a query string survives in proxy /// logs, browser history and Referer headers, which is exactly how an admin /// token on a public edge leaks. It is typed into the page, kept in /// sessionStorage for the tab, and sent as a header. /// /// No external assets: the runtime image is distroless and the edge is often /// the thing standing in front of a site that is under attack. A page that /// needs a CDN is a page that fails at the moment it is wanted. /// internal static class AdminConsole { public static IEndpointRouteBuilder MapAdminConsole(this IEndpointRouteBuilder app) { // One endpoint, not two: "/admin" and "/admin/" are the same route to the // matcher and registering both is an AmbiguousMatchException at request // time (found by a test, not by reading). The catch-all is deliberate — // this is a single page, so a mistyped subpath should show the page // rather than be proxied to an upstream that has never heard of it. app.MapGet("/admin/{**rest}", () => Results.Content(Page, "text/html; charset=utf-8")); return app; } private const string Page = """ openwaf — operator

openwaf

no token
—

Bans and blocks

sourceprovenancereasonlive untillast

Netblocks the edge noticed

blockbans insideoldest bannewest bansome of those bans

Allow entries

matchnoteexpires

Path rules

patternactionnotematchesexpires

Request budget

sourcerequests in windowbudgetwindow ends

Path budgets

patternrequestswindow ssources countedwindows runningover budget nownoteexpires

Ask what the edge would answer

One address, one answer

The enforcement horizon

One source through time

Where does this appear?

What would this ban touch?

Sources the edge is watching

sourceconsec.refusalslast statuspathgeo

Streaks standing in this edge

sourceconsecutiveserver errorslast statuspathgeolast seen

Alerts — what the edge wants a human to look at

kindsourcecountlastwhen

What changed on this edge

whensectionactiontargetdetailsurface

Countries seen

codesourcesrefusalsrefusals vs the busiestrule

Every action here is one call to the admin API. The page decides nothing.

"""; }