2846 Commits

Author SHA1 Message Date
Oliver Kieselbach fb8f208f25 fix(backend): the manual maintenance trigger also fills missing Entra regions
The region fill ran only after the 2-hour maintenance timer, so the maintenance button left new
or missing tenant regions empty until the next tick. The manual trigger's worker now runs the same
fill, before its long run, because the operator who pressed the button waits for it; an
aggregation-only run stays aggregation only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 09:07:20 -08:00
Oliver Kieselbach 3b6a209b7a feat: store each tenant's Entra region and show it to Global Admins
Every tenant row now carries the region Microsoft Entra ID publishes for the tenant in its
public sign-in metadata (tenant_region_scope, plus tenant_region_sub_scope for US government
community tenants), stored as Microsoft's raw code. The first member login writes it in the
same conditional write that seeds the domain; the 2-hourly maintenance fills every row that
has none. Both fields are system-owned: denied in the field patch, kept on a revert, and left
out of the configuration backups.

Global Admins see the region as a pill and a filter in Tenant Management, a region line under
the plan breakdown, and a world map of customers per region in Metrics > Customers.
list_tenants returns both fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 08:16:55 -08:00
Oliver Kieselbach 90d01563c2 fix(backend): RuleStats retries a conflicting transaction up to 8 times through one shared CAS loop
RecordRuleStats gave up after 4 conflicting transactions, too few when several analyses of
one tenant write its daily partition at the same moment; the rule statistics of the losing
sessions were dropped. TableCasRetry.RunAsync is now the one conflict loop for single rows
and multi-row transactions: MutateAsync, RecordRuleStats and the platform rollup use it
instead of their own copies. RecordRuleStats gets 8 attempts like the usage counters and the
rollup; the rollup's budget and MutateAsync's behaviour are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 11:22:49 -08:00
Oliver Kieselbach 7fb0291551 feat(web, mcp): TenantGraphAccessLost in the admin distress list and the generated vocabularies (D-445)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 09:57:23 -08:00
Oliver Kieselbach b8962351f6 feat(agent): end monitoring on the backend's 403 TenantGraphAccessLost (D-445)
The backend now says explicitly when a tenant's Graph access is confirmed lost. The agent
acts on it only when the 403 echoes the request's correlation id:

- config fetch: not counted by the auth-failure tracker, no distress report
- registration: new outcome TenantGraphAccessLost without retry, rotation or tracker; the
  start ends like the emergency break (marker first, cleanup per SelfDestructOnComplete,
  exit 0), which also ends a WhiteGlove resume
- telemetry: UploadResult.TenantGraphAccessLost stops the drain once and terminates the
  session with origin tenant_graph_access_lost; spool drain and diagnostics are skipped
  like for session_gone

No emergency report on any path: the error channel runs through the same gate.
ServerControlPlane shares the synthetic terminate_session construction with the 410 path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 09:57:22 -08:00
Oliver Kieselbach 8fed1da22f feat(backend): a confirmed Graph access loss is refused with 403 TenantGraphAccessLost before the validator chain (D-445)
When Microsoft Entra keeps refusing a tenant's app token (GraphAccessRejectionConfirmedAt
set and a validation switched on), every validator would only spend the chain budget on
token requests that cannot succeed. The agent gate now refuses right after the hardware
check with 403 and the envelope code TenantGraphAccessLost, marker
DeviceValidation=AccessLost, without asking Entra. RefusesByConfiguration mirrors the gate,
so a stale cached copy is checked against the stored row before it refuses. The
maintenance recheck and the portal token paths stay the only probes of Entra.

- TenantConfiguration.IsGraphAccessConfirmedLost: one predicate for the gate and the
  portal notice
- SecurityValidationResult.Code carries the envelope code
- the distress endpoint stores a 403 for allowed hardware from such a tenant as the new
  backend-only DistressErrorType.TenantGraphAccessLost, never as DeviceNotRegistered;
  agents may not report that value

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 09:57:21 -08:00
Oliver Kieselbach 7fe9d59342 feat(mcp): download_progress_throttled in the event catalog and the coverage gaps (D-444)
get_session_summary names a reduced download progress cadence as a known gap, so sparse progress
does not read as missing data. The notice stays a search candidate but does not count toward a
keyword's specificity, so "download" remains a rare named entity in event search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 11:58:25 -08:00
Oliver Kieselbach b0dccbc16d feat(web): download panel averages the speed over 20 s and notes reduced progress updates (D-444)
The speed comes from the ticks of the last 20 s instead of the last pair, so Delivery
Optimization's 1 MiB byte steps no longer make it swing. When a session's downloads ran long, a
note above the rows says since when progress was reported less often, with a link to the
protective limits page. download_progress_throttled is listed among the gather-rule event types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 11:57:11 -08:00
Oliver Kieselbach 5e73628d69 feat(agent): one sender for download_progress with automatic session stages (D-444)
The DO collector and the IME adapter no longer emit download_progress themselves; the new
DownloadProgressPublisher sends it. While Delivery Optimization reports an app, the IME progress
lines for it are dropped, so each download is reported once. Every tick keeps the source label and
timestamp of the sample whose byte count it carries; a DO tick also carries the app's IME state.

The interval per app follows the session's emitted total: 3 s, then 10 s from 400, 30 s from 640
and 60 s from 760 events. Each download reports every 3 s for 60 s from its first byte. A
download's first tick, its completion and a held tick at its end or when the DO collector goes
idle are always sent. Total and stage are saved in the IME tracker state. One
download_progress_throttled per stage entered; it does not count as activity for the idle and
stall clocks. Shared manifests regenerated for the new event type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 11:57:11 -08:00
Oliver Kieselbach 72f138e9ca Merge pull request #219 from okieselbach/dependabot/npm_and_yarn/src/McpServer/autopilot-monitor-mcp/mcp-5de5504dc0
Bump the mcp group in /src/McpServer/autopilot-monitor-mcp with 4 updates
2026-11-17 20:20:36 +01:00
Oliver Kieselbach f3a62fa5fb test(agent): give EnrollmentOrchestratorTests the 10 s worker wait of its siblings
Stop_flushes_final_snapshot_with_current_state waited only 2 s for the
worker to apply a posted signal and starved on a loaded CI runner late in
the agent suite. The three worker waits in the class now share one 10 s
budget, the same as the other orchestrator test classes. SpinUntil returns
as soon as the condition holds, so a green run does not get slower.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:19:36 -08:00
Oliver Kieselbach c27e6f3ff4 Merge pull request #222 from okieselbach/dependabot/nuget/src/Backend/AutopilotMonitor.Functions/dotnet-7c3ace5f1a
Bump the dotnet group with 1 update
2026-11-17 20:07:03 +01:00
Oliver Kieselbach 89e143d53b Merge pull request #220 from okieselbach/dependabot/npm_and_yarn/src/Web/autopilot-monitor-web/web-f513729e12
Bump the web group in /src/Web/autopilot-monitor-web with 5 updates
2026-11-17 20:05:55 +01:00
Oliver Kieselbach 7884055c98 Email templates: test send to any recipient, default shown with its source
POST global/email-templates/{kind}/test takes an optional toEmail (one plain
address, the same rule as an e-mail channel recipient, now shared as
TenantConfigValidation.ValidateEmailAddress). Without it the test goes to the
caller's default recipient as before: activation notification address, then
ContactEmail, then the caller's UPN.

The template GET returns that default and the field it came from
(testRecipient, testRecipientSource). Settings > Email Templates gets one
"Test recipient" field for both templates, shows the default below it, and
explains who receives the real mails and the tests. "Send test to me" is now
"Send test"; the section uses the generated EmailTemplateResponse instead of
a local copy of the shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:42:09 -08:00
dependabot[bot] 3c9935a29f Bump the dotnet group with 1 update
Bumps Microsoft.Identity.Web from 4.16.1 to 4.18.0

---
updated-dependencies:
- dependency-name: Microsoft.Identity.Web
  dependency-version: 4.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dotnet
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-17 01:07:13 +00:00
dependabot[bot] 249cfe673b Bump the web group in /src/Web/autopilot-monitor-web with 5 updates
Bumps the web group in /src/Web/autopilot-monitor-web with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [@microsoft/applicationinsights-web](https://github.com/microsoft/ApplicationInsights-JS) | `3.4.5` | `3.4.6` |
| [next](https://github.com/vercel/next.js) | `16.4.4` | `16.4.6` |
| [@next/bundle-analyzer](https://github.com/vercel/next.js/tree/HEAD/packages/next-bundle-analyzer) | `16.4.4` | `16.4.6` |
| [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) | `16.4.4` | `16.4.6` |
| [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip) | `6.44.1` | `6.44.2` |


Updates `@microsoft/applicationinsights-web` from 3.4.5 to 3.4.6
- [Release notes](https://github.com/microsoft/ApplicationInsights-JS/releases)
- [Changelog](https://github.com/microsoft/ApplicationInsights-JS/blob/main/RELEASES.md)
- [Commits](https://github.com/microsoft/ApplicationInsights-JS/commits)

Updates `next` from 16.4.4 to 16.4.6
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.4.4...v16.4.6)

Updates `@next/bundle-analyzer` from 16.4.4 to 16.4.6
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/commits/v16.4.6/packages/next-bundle-analyzer)

Updates `eslint-config-next` from 16.4.4 to 16.4.6
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/commits/v16.4.6/packages/eslint-config-next)

Updates `knip` from 6.44.1 to 6.44.2
- [Release notes](https://github.com/webpro-nl/knip/releases)
- [Commits](https://github.com/webpro-nl/knip/commits/knip@6.44.2/packages/knip)

---
updated-dependencies:
- dependency-name: "@microsoft/applicationinsights-web"
  dependency-version: 3.4.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: web
- dependency-name: next
  dependency-version: 16.4.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: web
- dependency-name: "@next/bundle-analyzer"
  dependency-version: 16.4.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: web
- dependency-name: eslint-config-next
  dependency-version: 16.4.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: web
- dependency-name: knip
  dependency-version: 6.44.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: web
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-17 01:06:23 +00:00
dependabot[bot] 0a54546fcd Bump the mcp group
Bumps the mcp group in /src/McpServer/autopilot-monitor-mcp with 4 updates: [jose](https://github.com/panva/jose), [undici](https://github.com/nodejs/undici), [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip) and [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint).


Updates `jose` from 6.2.15 to 6.2.17
- [Release notes](https://github.com/panva/jose/releases)
- [Changelog](https://github.com/panva/jose/blob/main/CHANGELOG.md)
- [Commits](https://github.com/panva/jose/compare/v6.2.15...v6.2.17)

Updates `undici` from 8.12.3 to 8.12.4
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v8.12.3...v8.12.4)

Updates `knip` from 6.44.1 to 6.44.2
- [Release notes](https://github.com/webpro-nl/knip/releases)
- [Commits](https://github.com/webpro-nl/knip/commits/knip@6.44.2/packages/knip)

Updates `typescript-eslint` from 8.72.1 to 8.72.2
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.72.2/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: jose
  dependency-version: 6.2.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: mcp
- dependency-name: undici
  dependency-version: 8.12.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: mcp
- dependency-name: knip
  dependency-version: 6.44.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: mcp
- dependency-name: typescript-eslint
  dependency-version: 8.72.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: mcp
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-17 01:06:08 +00:00
Oliver Kieselbach b4680761af Web: Usage Metrics folds its stat rows into the compact panel on a phone
Usage Metrics and the platform usage section now follow the dashboard and
Fleet Health (D-440). Below 553 px of row width each row of stat cards is one
compact panel; from there the cards stand two or three to a row until md.
Each row is described once (UsageStat, UsageStatRow), so card and panel
cannot drift. Only outcomes are colored in the panel. Four cells form two
rows of two.

The Users block is shared by both pages. In the platform section, Tenants and
Users become rows and Platform Statistics three rows.

Under /admin/metrics the layout's header is the page header. Platform Usage
and Agent Metrics drop their own header bar and get the title row the other
sections use; shared section headings step down a level inside it.

The duplicate baseline loses the Users block clone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 18:05:42 -08:00
Oliver Kieselbach 2c6f5fc269 Web: stat rows fold into one compact panel on a phone
Below 553 px of row width the dashboard and Fleet Health show their
figures in one three-column panel instead of stacked cards: a short
label, the value and at most one note per cell. From 553 px the cards
stay as they were. The dashboard hides the "Actively developed" banner
below 640 px; feedback and What's new stay in the overflow menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:14:56 -08:00
Oliver Kieselbach 26f2b88846 MCP: bump hono to 4.13.18
hono comes in transitively through @modelcontextprotocol/node, whose
range ^4.11.4 already allows the patched line, so only the lockfile
entry changes. 4.13.16 fixes GHSA-46wx-v44x-9hh2, GHSA-4m76-xfj5-7975,
GHSA-3gg2-335m-rxc6, GHSA-h7mg-cq63-vhpq and GHSA-4h7h-rv7c-7m2v.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 08:31:37 -08:00
Oliver Kieselbach c31d00f85a Web: Software Mapping is readable on a phone
Below the sm breakpoint the Unmapped, Mapped and Ignored tables drop their
header and fixed column widths, which left the software name a few pixels
wide. Each row now wraps: the full name on its own line, publisher or vendor
below it, then the badges and the actions. The Map and Edit forms stack their
fields, and the tab bar spans the width so it fits with both count badges.

Every new class carries max-sm:, so the desktop table is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:54:37 +01:00
Oliver Kieselbach 25f1a0ec3e Vulnerability data: the dictionary sync's comment says a download takes a few seconds
Comment only; it carried the same estimate as the button's tooltip.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 01:29:02 +01:00
Oliver Kieselbach 320517fc80 Web: Auto-Map's answer for a missing NVD dictionary names the button that loads it
The reason text for no_dictionary pointed to the nightly sync only. The dictionary can be loaded on
demand, so the text names Vulnerability Data > Sync NVD Dictionary. The button's tooltip says "a few
seconds" instead of a number.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 01:24:55 +01:00
Oliver Kieselbach 2cc120c182 Web: the vulnerability data syncs form one row, the two list imports a second
A seventh button wrapped alone onto a second line. The dictionary sync sits next to the cache
refresh, both being NVD data, and is a filled button like the other syncs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 00:55:34 +01:00
Oliver Kieselbach 6a68580c87 Web: vulnerability data shows the NVD product dictionary, with a button to load it
- Data Sync Status: a line for the NVD product dictionary (when it was replaced, how many
  products it holds, or that it is not loaded yet), and the cache line says that it counts the
  products CVE data is held for.
- Button "Sync NVD Dictionary" next to the other syncs.
- The correlation switch sits on the line of its heading instead of the middle of the text block.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 00:50:44 +01:00
Oliver Kieselbach 6f48aab4bf Vulnerability data: the NVD product dictionary can be loaded on demand and shows in the sync status
- POST vulnerability/sync-dictionary (Global Admin) downloads the dictionary now. Until now only
  the nightly run loaded it, so a new installation had none until 03:00 UTC and Auto-Map answered
  that it was not loaded yet. 409 while a download runs on the instance.
- GET vulnerability/sync-status carries cpeDictionaryProducts and cpeDictionaryLastRefreshUtc,
  both absent while no dictionary was ever stored. They are a different store than the CVE
  cache that nvdCacheEntries counts.
- One dictionary download at a time per instance: the nightly run waits for one in flight and
  then finds the stored copy current instead of pulling the feed a second time.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 00:50:42 +01:00
Oliver Kieselbach 996240fa0e Web: the vulnerabilities card says "None to update" when only self-updating software was found
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 23:14:19 +01:00
Oliver Kieselbach ed209b5f1a MCP: browsers are an example of self-updating software, not its definition
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 23:07:04 +01:00
Oliver Kieselbach fcd678eb4a Web: report row keeps its worst CVSS band, mapped software actions fit the column
- Session report: the badge of a row is the worst CVSS band over all CVEs of the entry again,
  from the entry's counts on a newer report and from its list on an older one. The previous
  commit had switched it to the report's risk level, which a known exploited CVE raises to
  critical: rows of existing reports changed from HIGH to CRITICAL and contradicted the
  severity cards above them.
- Admin > Software > Mapped: the actions column is wide enough for both buttons; Delete was
  cut off at the table's edge.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 22:42:49 +01:00
Oliver Kieselbach 6198f5ac21 MCP: get_vulnerability_summary takes includeSelfUpdating and says what the index holds
- get_vulnerability_summary: new parameter includeSelfUpdating (default false, like the portal).
  The description names the default, the fields that say how much is left out, and that the
  index holds per product and device every known exploited CVE plus the five most urgent others.
- search_sessions_by_cve: the description names the same limit of the index.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 22:20:57 +01:00
Oliver Kieselbach e96c35a311 Web: vulnerability numbers count what has to be updated by hand, self-updating software is shown apart
Session report
- The headline numbers come from the report's own counts, so a shortened CVE list no longer
  changes them; each entry says how many CVEs it has in all next to the ones it lists.
- Self-updating software forms a group of its own below the findings and is left out of the
  headline; the number of its CVEs stands next to it.
- Programs that could not be judged are listed under "Not evaluated" with the reason.
- A report written before these counts existed is read from its lists as before.

Software > Vulnerabilities and the dashboard card
- Self-updating software is left out by default. A line says how many products on how many
  devices that is and counts them in on request; their rows carry a mark.
- The card says "None to update by hand" when only self-updating software was found.

Admin > Software
- Mapping and ignoring work on vendor plus canonical name.
- Automatic mappings show their source and can be deleted; a product can be marked as
  self-updating.
- A Global Reader gets the lists without the write controls.
- The reseed result shows the inventory rows it changed and why a mapping list was refused.

Privacy and terms pages
- The NVD and EPSS lookups carry only public identifiers (a product identifier, a CVE number);
  the NVD product dictionary is named as a downloaded source.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 22:20:54 +01:00
Oliver Kieselbach dc7b960bb2 Vulnerability scan: product dictionary, maintained mapping list, self-updating products, bounded NVD loops
Mapping
- The backend keeps a reduced copy of the NVD product dictionary, replaced nightly when NVD
  publishes a new one and read as a stream. The NVD keyword search is removed: no program name
  is sent to NVD any more.
- A program gets an automatic mapping only when its name is exactly one product's name, the
  product's cache row holds CVEs, none of them lacks a version, and the program does not occur
  only as a Store package. Deleting an automatic mapping puts the name on the ignore list.
- rules/dist/cpe-mappings.json is the maintained list (410 mappings, editions, default set of
  self-updating products). An import checks the list, writes, then removes what the list no
  longer holds; a refused list leaves the mappings in service and is recorded as an ops event.
  cpe-mapping-seed.json stays until this backend is deployed.
- The CPE on every inventory row follows the mappings: after each change and once a night.
- The admin routes work on vendor plus canonical name. POST vulnerability/cpe-product-flags
  lets a Global Admin mark a product as self-updating; the value is stored only while it
  differs from the list's default.

Report and rule
- Findings in self-updating software are listed, but the actionable_* counters leave them out.
  ANALYZE-ID-003 (1.3.0) reads those counters, so a browser no longer triggers it.
- A program without a version number and a Store package under an automatic mapping are
  listed as not evaluated instead of being compared.
- The fleet summary leaves self-updating software out unless includeSelfUpdating is set, and
  says how much that is.

NVD
- A 403 is a refusal like a 429; a request that got no answer is told apart from a rejected one.
- Every loop that asks NVD has a count bound, an unanswered bound and a time bound. The cache
  walk waits an open cooldown out once before its first request.
- The scan filter and the dictionary share one list of the platforms that rule a Windows
  desktop out; the phone, embedded and ARM-only Windows lines are in it.

Monitoring
- New unsampled event SoftwareInventoryCpeReconciled; VulnerabilityDataSyncCompleted carries the
  dictionary, the automatic mappings and the parts that fell short.
- Ops events VulnerabilityDataSyncDegraded (also from stored state: walk not finished for two
  days, dictionary older than a week), CpeMappingUnavailable (mappings unreadable or a list
  refused; once per UTC day, cause and severity) and CpeAutoMappingsCreated.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 22:18:45 +01:00
Oliver Kieselbach 7f17b5c484 MCP: the unmatched software list no longer skips rows
get_software_inventory with scope "unmatched" advanced its cursor by the
page size asked for. The backend serves at most 200 rows per page, so a
larger page size skipped the difference without a hint. The cursor now
advances by the rows that arrived and ends on an empty page.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 17:19:42 +01:00
Oliver Kieselbach 7cffcc8799 Vulnerability scan: tests for the CVE data path and the result writer, and two fixes they found
Tests cover the paged NVD fetch and its policy, the cache fill path,
the version filter (own product, editions, version schemes, platform
words), report entries and their trimming, the WhiteGlove merge, the
scan end to end over a mocked repository, the queue handler's
postponements, the re-scan, the per-session index replace, the refresh
walk, the KEV catalog and the write modes.

Fixes:
- A run that is out of time still reads the cache and only skips the
  fetch. Before, every remaining product was reported as waiting for
  data even when its data was cached.
- An entry of a report stored in the earlier format gets its counts and
  the most-urgent-first list when it is merged. Before, trimming such an
  entry left nothing that said how many CVEs it stood for.

The NVD client gets a test seam for its request pacing.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 17:19:41 +01:00
Oliver Kieselbach 0cefbc17cf Vulnerability scan: fetch the newest CVEs, judge only the product's own ranges, one result writer
CVE data
- The NVD fetch asked for one page of 100, which is the oldest 100, and
  the age filter then dropped them. It now reads a full page and, for a
  product with more, the last page as well, behind its own HTTP policy
  and a time limit that covers the body. A timeout fails that request,
  not the scan.
- A cache row keeps only the version ranges of its own product; the
  filter compares the product again when reading, so rows written
  earlier stop matching through another product's range.
- Known-exploited CVEs are kept ahead of the size cap.
- Cache rows and reports are written in replace mode. A merge left the
  other storage form of an earlier write in place and the reader
  returned it.
- Not judged, and reported as such: Store app stubs with a placeholder
  version, ranges in another version scheme, and software editions a
  mapping excludes. The platform check on descriptions matches whole
  words.
- The KEV lookup reads the loaded catalog and never fetches; a failed
  refresh is reported instead of swallowed.

Scan and result
- CVE data is read once per product. A product without data is fetched
  while the run has time, otherwise noted for the nightly refresh; the
  session is put back once and then reports it as not evaluated instead
  of clean.
- A software entry lists every known-exploited CVE and the most urgent
  others and carries the full counts; the report is trimmed before it
  outgrows its table row. Sums and the WhiteGlove merge use the counts.
- New counters leave out software marked as self-updating.
- The queue handler and the re-scan store through one writer: the
  report is replaced or removed and the session's CveIndex rows follow
  it, keeping the detection date of rows that stay. The index takes the
  five most urgent CVEs per software plus every known-exploited one,
  and the fleet summary filters by date in the query.
- The nightly refresh uses the same fill path as the scan, starts with
  products waiting for data and rows of the older shape, and removes
  rows no mapping names.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 16:05:21 +01:00
Oliver Kieselbach 94324bf137 Vulnerability scan: map software to CPE products by whole words
Name patterns matched as substrings and the first hit won, so a short
pattern filed unrelated programs under a foreign product. The matching
now works on words:

- A pattern matches whole words in order; the pattern with the most
  words wins. A one-word pattern needs the vendor to agree or the word
  to be the whole name, and a name that follows "for" is an add-on.
- A key match compares vendor and canonical name (no version,
  architecture or language), which becomes the key for manual mappings.
- The fuzzy NVD name search no longer runs during a scan. A program
  without a mapping stays unmapped.
- Mappings load as one immutable snapshot: concurrent readers share one
  load, a failed reload keeps the last good copy, and an empty result is
  never served. A scan that cannot read them is put back on the queue
  instead of filing every program as unknown.
- Every program is mapped before the first CVE lookup, so a run that
  runs out of time has still filed each one. The inventory row takes the
  computed CPE on every count, set or cleared.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 15:39:17 +01:00
Oliver Kieselbach f0fee75b08 Web: Vulnerabilities card on the dashboard, count on the Software tab, analyzer-off notices
- Dashboard: a sixth stat card shows the known exploited CVEs (CISA KEV) of the last
  30 days for the one tenant in view and opens Software > Vulnerabilities; it reads Off
  while the Software Inventory & Vulnerability Analyzer is off. All stat cards share one
  layout (icon in the title row, tighter padding); six cards sit in one row from a row
  width of 1126 px, else 3 + 3 or 2 + 2 + 2, as container queries in globals.css.
- Software hub: a red known-exploited count on the Vulnerabilities tab. With the analyzer
  off, the Vulnerabilities and Inventory tabs say so instead of an empty list; users who
  can save the setting get a link that opens it with the switch highlighted.
- A session's Vulnerability Report and an app's detail page link to the tab; the hub takes
  ?tenantId= for a platform admin, like the app detail page.
- Telemetry: vuln_card_shown, vuln_link_clicked, vuln_enable_clicked,
  software_tab_selected, vuln_exposure_viewed, vuln_exposure_action and
  session_vuln_report_action. No CVE ids, session ids or product names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 12:55:06 +01:00
Oliver Kieselbach ba53b82c00 Web: Admin Mode takes effect only for tenant Admins and Global Admins
The stored Admin Mode flag is shared by every account in a browser. It now
takes effect, and its toggle shows, only for a tenant Admin or a Global
Admin (canUseAdminMode); the stored value stays for the account that set it.
Dashboard rows offer delete and the Select checkbox only where the backend
admits the caller for the row's tenant (canAdministerTenant), the
blocked-device read runs only in the platform view, and a failed
Succeed/Fail shows an error notification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:35:30 +01:00
Oliver Kieselbach 7f53dcf223 Backend: Succeed, Fail and session actions act in the session's tenant
mark-failed, mark-succeeded and actions on sessions/{sessionId} take the
tenant from ?tenantId= (TenantScoping.QueryParam) and resolve it like the
other session write routes (ResolveSessionScopeAsync with
requireGlobalAdmin). Before, they used the caller's token tenant, so a
Global Admin on another tenant's session got 404. A test pins that every
sessions/{sessionId} route is query-scoped; the report keeps the tenant
from its body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:35:21 +01:00
Oliver Kieselbach cd2ea05878 Web: "/" jumps to the event timeline search, Esc clears it
On the session page "/" focuses the timeline search from anywhere: the
controls row scrolls up below the navbar, so the matches fill the screen,
and a previous query is selected for overtyping. It is the web's usual
key for a page's own search and the same on Windows and Mac; Shift stays
allowed, since layouts like German type "/" as Shift+7. A "/" typed into
any field still belongs to that field. An empty box shows a "/" hint.

Esc in the box clears the query and keeps the cursor there for the next
term; Esc on an empty box leaves it.

The "is the user typing in a field" check moves to lib/keyboardTarget.ts
and is shared with the dashboard's Esc handler for select mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:08:34 +01:00
Oliver Kieselbach e6191831bd Rules: remove the AutoLogon allow-list template ANALYZE-SEC-004
The ID stays retired; a test pins that it does not come back and that no rule
matches on the AutoLogon user name.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 22:05:18 +01:00
Oliver Kieselbach ccea1dacfe Agent: leaner payloads for the join-status and AutoLogon events
The domain helper moves next to the join-info reader and is shared by its callers.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 21:47:14 +01:00
Oliver Kieselbach a7e76f0584 Console detection: a running process that cannot be read is reported, and every console warning is uploaded at once
The probe answered "gone" whenever it had no row, also when the query
itself failed. A console that still ran was then counted as script
activity instead of being reported. A start is now counted only on
certainty: the process list no longer has the id, it has another image
under it, or a fact that was read contradicts the start trace. A failed
or empty query, or a fact that could not be read, is reported at low
confidence, as before the counting was introduced.

The immediate upload is back for every oobe_console_spawned. The
confidence follows the command line, which whoever opens the console
chooses, so it labels the warning and never delays it. With short-lived
starts counted there is no burst left that the limit would have spared.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 19:18:38 +01:00
Oliver Kieselbach dabd0d5b7e Console detection: short-lived cmd.exe are counted per window instead of reported one by one
The watcher learns of a process start about a second late, because WMI
delivers the start trace in batches. A scripted cmd /c has exited by
then, and its unreadable command line was reported as a low-confidence
console. A script that starts many of them produced one Warning with an
immediate upload each.

A start whose process is gone, or whose id now belongs to another process
(other image name, session 0, other parent), is now counted. The host
reports the count as one Info console_script_activity per 60 s window,
with the owner SIDs and the parent processes by image name, at most 20
windows per agent run and the rest when it stops. The type does not
count as activity, neither for the agent's idle and stall clocks nor for
the backend's stall heal.

oobe_console_spawned stays for a console that is still running when
probed. It carries parentProcessName and is uploaded immediately only at
high confidence.

Fixed in the same code: a reused process id could be reported with the
command line of another program; the owner of a console found at agent
start was never read, because the query lacked the key property; a later
console that was given an id seen before was dropped; the WMI
subscription was cancelled on the stop thread.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 18:56:29 +01:00
Oliver Kieselbach 68dab1e154 Office watcher: a traced process id is tracked only while it still carries the worker's name
WMI delivers the process start trace with a delay. By then the id can
belong to another process. The watcher took whatever ran under the id as
an Office worker, and a foreign process held the install window open
until it exited.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 18:56:16 +01:00
Oliver Kieselbach a1590579f9 Agent: the image path of another process comes from one shared helper
ImeProcessIdentity carried a private wrapper around
QueryFullProcessImageName. It moves unchanged to
Monitoring/Interop/ProcessImagePath, so a second caller can read a
process's image name without a copy of the P/Invoke.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 18:56:15 +01:00
Oliver Kieselbach 512b145484 Backend: the comment on register-session's 410 sits on its method
The summary of the 410 response stood above ClampStartedAt and promised
that the agent treats registration and telemetry alike. It now sits on
WriteSessionLockedAsync and says what the agent does.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 17:05:40 +01:00
Oliver Kieselbach 8ece30631a Agent: a registration answered with 410 ends monitoring; a WhiteGlove Part 2 start registers a new session
register-session answers 410 while a deleted session's tombstone is fresh.
The agent treated that like a network failure: six attempts, exit 7,
everything kept for the next boot. A WhiteGlove resume never left that
loop, because the 48-hour break is skipped for it.

A 410 that echoes the request's correlation id is now its own signal. The
start sends one report (RegistrationRejectedSessionGone) and ends
monitoring with a forced cleanup, as the telemetry path already does on
410. A WhiteGlove Part 2 start rotates its session id and registers again
instead, so the user phase is observed; agent_started names the reason in
sessionRotationReason. A 410 without the echo stays a retried failure.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 17:05:39 +01:00
Oliver Kieselbach 7c8204357b Web: the session page starts fresh for every session
A link from one session to another only changes ?id=, so the route stays
mounted, and the append-only event list kept the previous session's
events: both sessions ended up in one timeline. The page content is now
keyed by the session id.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 15:07:48 +01:00
Oliver Kieselbach dfcf7ad8ba Web: one script-name lookup per session view, one follow-up after a time limit
The session page loads events page by page, and the hook fired a lookup
for every page that added a script. It now waits for the complete event
walk and asks once, with every script of the session.

When the backend reports that a time limit cut the lookup short, the hook
asks once more after 5 s. The follow-up never takes away a name the first
answer had, and a session switch drops a pending one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 15:07:35 +01:00