From 75c9d64b66762fbdd5ed0ac7602b5d59ef987e38 Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Tue, 25 Aug 2026 14:31:25 +0300 Subject: [PATCH 1/5] fix(ui): mask flagged secrets server-side, skeleton Security tiles, fold /search into Tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Web UI UX audit (docs/qa/ux-audit-webui-2026-08.md), security + routing cluster. F13 — the activity drawer printed the credential it had just flagged, in cleartext, next to a Copy button. Masking now happens in the REST layer, before the record leaves the process: GET /api/v1/activity and /activity/{id} replace every detected value inside `arguments` and `response` with a recognisable preview (`AKIA…****`) whenever the record carries a detection, and drop the internal `_auth_*` arguments from every record. Redacting in the browser would have left the raw value on the wire and in the network log, which is not a fix. Full values stay reachable through the one deliberate surface that already gates them: `activity export --include-bodies`. The drawer says so, and badges both payload panels Masked. F15 — the Security page's four stat tiles sat outside the loading guard, so a cold start rendered "0 scanners · 0 scans · 0 findings" before the overview had been fetched. A security page asserting zero findings before it has looked is worse than one that admits it is still looking: the tiles now skeleton until the first response lands. F20 — `/search` was a third search surface, routed but sidebar-less, duplicating both the header box and the Tools page. It redirects to Tools (the canonical one) carrying `?q=` across; Tools honours the query on mount and on later route changes; the header box targets it, and its Search button is no longer greyed out next to an empty box. F31 — the header's routing-mode badge explains itself: label and description live together in utils/routingMode.ts. F33 — a Web UI deep link without the `/ui` prefix returned Go's plain-text "404 page not found". Known UI paths now 302 into the SPA, keeping the escaped path and the query string (`?apikey=` survives). Unknown paths still 404 — an allowlist, so a mistyped API path is not answered with an HTML page. F36 (this area) — Tools table descriptions carry a title, so the clipped half is readable without opening the tool. --- docs/features/sensitive-data-detection.md | 23 +- frontend/src/components/SidebarNav.vue | 3 +- frontend/src/components/TopHeader.vue | 36 +- frontend/src/router/index.ts | 14 +- frontend/src/utils/routingMode.ts | 42 ++ frontend/src/views/Activity.vue | 26 ++ frontend/src/views/Search.vue | 434 ------------------ frontend/src/views/Security.vue | 58 ++- frontend/src/views/Tools.vue | 31 +- .../unit/activity-sensitive-masking.spec.ts | 102 ++++ .../tests/unit/routing-mode-tooltip.spec.ts | 29 ++ .../tests/unit/search-consolidation.spec.ts | 93 ++++ .../unit/security-overview-skeleton.spec.ts | 90 ++++ internal/httpapi/activity.go | 42 +- internal/httpapi/activity_mask_test.go | 145 ++++++ internal/httpapi/server.go | 15 + internal/security/mask.go | 204 ++++++++ internal/security/mask_test.go | 125 +++++ internal/server/server.go | 19 +- internal/server/ui_redirect.go | 71 +++ internal/server/ui_redirect_test.go | 89 ++++ 21 files changed, 1208 insertions(+), 483 deletions(-) create mode 100644 frontend/src/utils/routingMode.ts delete mode 100644 frontend/src/views/Search.vue create mode 100644 frontend/tests/unit/activity-sensitive-masking.spec.ts create mode 100644 frontend/tests/unit/routing-mode-tooltip.spec.ts create mode 100644 frontend/tests/unit/search-consolidation.spec.ts create mode 100644 frontend/tests/unit/security-overview-skeleton.spec.ts create mode 100644 internal/httpapi/activity_mask_test.go create mode 100644 internal/security/mask.go create mode 100644 internal/security/mask_test.go create mode 100644 internal/server/ui_redirect.go create mode 100644 internal/server/ui_redirect_test.go diff --git a/docs/features/sensitive-data-detection.md b/docs/features/sensitive-data-detection.md index a4804b5fa..f0d7ffa41 100644 --- a/docs/features/sensitive-data-detection.md +++ b/docs/features/sensitive-data-detection.md @@ -185,9 +185,28 @@ When sensitive data is detected, it is recorded in the activity log metadata: ``` :::caution Redaction -Detected sensitive values are automatically redacted in the activity log to prevent secondary exposure. Only the type, category, and partial context are stored. +A detection record itself never carries the value that triggered it — only the type, category, severity and location are stored. ::: +### Masked payloads + +A detection is stored alongside the call it came from, and that call's arguments and response are kept for debugging. Serving those verbatim would mean the screen that warns you about a credential also prints it, in cleartext, next to a Copy button — into every screenshot, screen-share and exported page. + +So MCPProxy masks them **server-side**, in the REST layer, before the record leaves the process: + +- `GET /api/v1/activity` and `GET /api/v1/activity/{id}` replace every detected value inside `arguments` and `response` with a recognisable preview — `AKIAIOSFODNN7EXAMPLE` becomes `AKIA…****`. Enough to tell you *which* credential to rotate, not enough to use. +- Masking applies only to records the detector flagged (`has_sensitive_data: true`); an unflagged payload is served unchanged. +- Internal `_auth_*` arguments (the server-edition identity MCPProxy injects into a call) are stripped from **every** record — they are plumbing, not something the caller sent. +- The Web UI's activity drawer and `mcpproxy activity show` both read those endpoints, so both are masked. + +Full values remain reachable through one deliberate, separately-flagged surface for incident response and compliance: + +```bash +mcpproxy activity export --include-bodies +``` + +Masking follows the same `sensitive_data_detection` configuration as detection: a category you disable is neither flagged nor masked. + ## Web UI Usage The Activity Log page in the web UI provides filtering and visualization for sensitive data detections. @@ -214,8 +233,8 @@ Clicking on an activity with detections shows: - List of all detected sensitive data types - Location (arguments or response) -- Redacted context for verification - Timestamp and duration +- The request arguments and response body, with every detected value masked (`AKIA…****`) and both panels badged **Masked** — see [Masked payloads](#masked-payloads) ## CLI Usage diff --git a/frontend/src/components/SidebarNav.vue b/frontend/src/components/SidebarNav.vue index 5016eb6c2..8e15949a5 100644 --- a/frontend/src/components/SidebarNav.vue +++ b/frontend/src/components/SidebarNav.vue @@ -633,7 +633,8 @@ const teamsUserMenu = [ { name: 'My Activity', path: '/my/activity' }, { name: 'Agent Tokens', path: '/my/tokens' }, { name: 'Diagnostics', path: '/my/diagnostics' }, - { name: 'Search', path: '/search' }, + // Tools is the canonical search surface since /search folded into it (F20). + { name: 'Tools', path: '/tools' }, ] const teamsAdminMenu = [ diff --git a/frontend/src/components/TopHeader.vue b/frontend/src/components/TopHeader.vue index 30bc715c3..0bc012b0f 100644 --- a/frontend/src/components/TopHeader.vue +++ b/frontend/src/components/TopHeader.vue @@ -21,10 +21,12 @@ @keydown.enter="handleSearch" /> +