Commit Graph

25 Commits

Author SHA1 Message Date
Oliver Kieselbach e6792aee95 added entra upcoming valid algorithm 2026-05-20 20:09:10 +02:00
Oliver Kieselbach 2ecbefce73 backend route fix and v2 agent version check fix 2026-04-22 17:51:12 +02:00
Oliver Kieselbach fee6909ec6 feat(mcp): add tool-call telemetry for production observability
Track MCP tool invocations in App Insights and UserUsageLog:
- Add ClientSource + McpToolName custom dimensions to RequestTelemetry
- Propagate tool name via X-MCP-Tool-Name header from MCP server
- Wrap all 26 tool handlers with withToolTelemetry for context propagation
- Add MCP_TOOL_LOGGING env var (default false) for optional stderr logging
- Add toolLoggingEnabled param to Bicep template for persistence

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 10:30:41 +02:00
Oliver Kieselbach 734061031b better OIDC config cache scaling 2026-04-01 12:52:15 +02:00
Oliver Kieselbach d9c4ea2657 agent emergency channel established 2026-03-31 03:07:52 +02:00
Oliver Kieselbach 66cc6af20f added user requests rate limiter, mcp tools bugfix, optimized request pipeline, mcp usage data retention, mcp plantier management 2026-03-29 16:12:15 +02:00
Oliver Kieselbach e88749e794 tracking only for mcp 2026-03-29 14:57:13 +02:00
Oliver Kieselbach 762bcfde34 better debug logging 2026-03-29 14:33:52 +02:00
Oliver Kieselbach 9e278db162 added logging for debug 2026-03-29 14:24:18 +02:00
Oliver Kieselbach f6d685392a request telemetry, fixed usage logging bug 2026-03-29 14:06:43 +02:00
Oliver Kieselbach dbb8c20a45 fixed usage log, fixed mcp tools, fixed version comparer vul report 2026-03-29 13:28:00 +02:00
Oliver Kieselbach 49a14c0a00 added CORS middleware 2026-03-28 09:26:44 +01:00
Oliver Kieselbach cefdc5e8fb CORS fix 2026-03-28 09:16:27 +01:00
Oliver Kieselbach 219f5c686a oauth for mcp server 2026-03-28 06:15:12 +01:00
Oliver Kieselbach 0126ce3c93 Added Policy Catalog and Audit for verification (first phase) 2026-03-08 14:23:25 +01:00
Oliver Kieselbach a2de05fe33 refactor: reorganize metrics/stats API routes and fix session-reports 404 handling
- Rename app-metrics → metrics/app (tenant + galactic)
- Rename usage-metrics → metrics/usage (tenant)
- Rename platform/usage-metrics → galactic/metrics/usage
- Rename platform-stats → stats/platform (anon whitelist updated)
- SessionReportService: gracefully handle missing table (404) with empty list
- SessionReportsSection: treat 404 as no reports yet (suppress error)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 16:47:55 +01:00
Oliver Kieselbach 81c4806083 Hardening: re-architecture to use mTLS for complete agent communication (agent endpoints consolidated) 2026-02-26 23:02:50 +01:00
Oliver Kieselbach c1c19c4f7a fix diagnostics upload 401 and enrich upload event data
- Add /api/diagnostics/upload-url to anonymous routes in AuthenticationMiddleware so the
  new device-cert-authenticated endpoint is not blocked by the JWT middleware
- Add DiagnosticsUploadResult value object to DiagnosticsPackageService carrying BlobName,
  SasUrlPrefix (truncated, safe to log), and ErrorCode
- Change CreateAndUploadAsync return type to DiagnosticsUploadResult for richer error context
- Add BuildSasUrlPrefix helper to produce a safe truncated URL for event data
- Change UploadToBlobStorageAsync to return (bool success, string errorCode) tuple
- Update MonitoringService to populate sasUrl and errorCode in diagnostics_upload_failed
  event data dict for visible timeline diagnostics

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 22:18:21 +01:00
Oliver Kieselbach 1f1b2cf2b4 usage of EntraId ClientId harmonised 2026-02-16 18:18:42 +01:00
Oliver Kieselbach a7e12b3588 Middleware security fix 2026-02-07 21:56:13 +01:00
Oliver Kieselbach 89fb50368e ConfigManagerCache fix 2026-02-07 21:41:25 +01:00
Oliver Kieselbach 064319334d Signing fix 2026-02-05 22:02:12 +01:00
Oliver Kieselbach 557dd22c53 Authentication & Galactic Admin: Implement JWT-based multi-tenant access control with cross-tenant support
Backend Changes:
- Fix user identification to use UPN (User Principal Name) claim as primary identifier instead of display name
- Add JWT authentication validation to all API endpoints with Authorization header support
- Implement Galactic Admin role with cross-tenant access permissions for sessions, events, and SignalR groups
- Add cross-tenant validation in GetSessionEventsFunction, SignalRAddToGroupFunction, and SignalRRemoveFromGroupFunction
- Enhance AuthenticationMiddleware to log actual user identifier (UPN) instead of display name

Admin Configuration:
- Add GetAdminConfigurationFunction and UpdateAdminConfigurationFunction for global settings
- Create AdminConfigurationService for managing platform-wide configuration
- Add AdminConfiguration model with global rate limiting and maintenance settings
- Restrict admin configuration access to Galactic Admins only

SignalR Real-time Updates:
- Implement "galactic-admins" SignalR group for cross-tenant session visibility
- RegisterSessionFunction now sends "newSession" events to both tenant-specific and galactic-admins groups
- IngestEventsFunction sends "newevents" only to tenant-specific groups (prevents flooding)
- Frontend listens to both "newSession" and "newevents" for real-time updates
- Galactic Admins see new sessions from all tenants without being flooded with event updates

Frontend Changes:
- Add Authorization headers with JWT tokens to all API fetch calls (sessions, events, metrics, configuration)
- Implement automatic joining/leaving of "galactic-admins" SignalR group based on Galactic Admin mode
- Handle both "newSession" and "newevents" SignalR events for complete session list updates
- Add authentication error handling with user notifications for token failures

Security Improvements:
- Validate tenant access for all cross-tenant operations
- Ensure users can only access their own tenant data unless they're Galactic Admins
- Log all cross-tenant access attempts with user identifiers for audit trail
2026-02-05 20:49:36 +01:00
Oliver Kieselbach a20ff48ae6 Backend:
- Add JWT-based authentication to all API endpoints
- Implement tenant isolation and access control validation
- Add Galactic Admin role validation for cross-tenant endpoints
- Enhance certificate validation with full X.509 chain checking
- Add certificate validation cache (5-min TTL) and self-signed cert protection
- Implement NDJSON payload size limit protection (configurable per tenant)
- Replace placeholder audit user identifiers with actual JWT user principals
- Add TenantHelper utility for consistent tenant/user extraction from tokens
- Disable PII logging in production (ShowPII = false)

Agent:
- Add automatic tenant ID detection from Windows Registry (AAD Join enrollment)
- Implement tenant ID precedence: CLI argument > Registry > Fallback

SignalR:
- Add authentication checks to all SignalR functions
- Implement tenant-based group access control
- Add user identifier logging for SignalR operations

Frontend:
- Change MSAL cache from localStorage to sessionStorage (XSS protection)
- Add warning status support to health check page
- Add Admin Configuration link in navbar (Galactic Admin only)
- Move maintenance trigger from Settings to Admin Configuration page
- Update tenant context logging for clarity

Configuration:
- Add MaxNdjsonPayloadSizeMB setting to TenantConfiguration model
- Update configuration service to persist new retention/timeout settings
2026-02-05 16:38:16 +01:00
Oliver Kieselbach 5690620058 Initial commit 2026-02-05 06:14:41 +01:00