Commit Graph

745 Commits

Author SHA1 Message Date
Oliver Kieselbach c4dabeeef4 fix CVE data sync and signalr join 2026-03-27 20:48:35 +01:00
Oliver Kieselbach 8a1c8a553c fix timestamps in agent 2026-03-27 20:08:16 +01:00
Oliver Kieselbach 87ba9281f8 fix agent timestamps 2026-03-27 19:43:55 +01:00
Oliver Kieselbach 284cab5a24 check for unique rule id 2026-03-27 19:05:57 +01:00
Oliver Kieselbach d9bfd0c9af check for unique rule id 2026-03-27 19:05:29 +01:00
Oliver Kieselbach 769beaa14a Refactorings for many reusables, API URL builder, CollectorBaseClass, CorrelationID Middleware, added Polly for external APIs 2026-03-27 11:14:38 +01:00
Oliver Kieselbach 738f524083 fix nullables 2026-03-27 09:35:14 +01:00
Oliver Kieselbach 905e42064b fixed usings 2026-03-27 09:17:17 +01:00
Oliver Kieselbach 22215521f2 Merge pull request #31 from okieselbach/claude/data-access-layer-pyC29
Implement repository pattern for data access abstraction
2026-03-27 09:08:37 +01:00
Oliver Kieselbach d38d5b5906 Merge branch 'main' of https://github.com/okieselbach/Autopilot-Monitor 2026-03-27 09:00:39 +01:00
Oliver Kieselbach a2f14c1ee9 added IME process watcher 2026-03-27 09:00:33 +01:00
Claude f5ec4247e9 Migrate FeedbackFunction + TenantOffboardFunction to repositories
- FeedbackFunction → IConfigRepository (feedback CRUD)
- TenantOffboardFunction → IMaintenanceRepository.DeleteAllTenantDataAsync()

Zero functions/services now create their own TableServiceClient.
All table access goes through repository interfaces.

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 07:38:19 +00:00
Claude c8f308c60b Add Feedback + TenantOffboard repository methods (implementations ready)
- IConfigRepository: Add GetFeedbackEntryAsync, SaveFeedbackEntryAsync, GetAllFeedbackEntriesAsync
- IMaintenanceRepository: Add DeleteAllTenantDataAsync
- TableConfigRepository: Implement feedback CRUD against PreviewConfig table
- TableMaintenanceRepository: Implement bulk tenant data deletion with batch deletes

Function migrations (FeedbackFunction, TenantOffboardFunction) in progress.

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 07:36:27 +00:00
Claude 878b762ca5 Consolidate all repositories to share single TableServiceClient
All 10 repository implementations now get their TableClient instances from
the central TableStorageService singleton instead of creating their own
TableServiceClient connections.

Before: 8 parallel TableServiceClient instances to same Storage Account
After:  1 shared TableServiceClient (+ 2 domain-specific functions)

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 07:29:56 +00:00
Claude be6d7b21f8 Update migration plan — all 4 phases complete
https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 07:22:09 +00:00
Claude d9abf724a3 Migrate VulnerabilityCorrelationService to IVulnerabilityRepository — Phase 4 complete
- VulnerabilityCorrelationService: TableStorageService → IVulnerabilityRepository + ISessionRepository
- IAdminRepository: Add SetTenantMemberEnabledAsync
- TableAdminRepository, TenantAdminsService: Implement enable/disable via new method
- DataAccessServiceExtensions: Add IDeviceSecurityRepository registration

All 12 bypass services now use repository interfaces. Zero services create
their own TableServiceClient. Only repository implementations + TableStorageService
+ 2 domain-specific functions (Feedback, TenantOffboard) have direct table access.

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 07:21:37 +00:00
Claude f6157ec8d0 TableAdminRepository refinement from background agent
https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 07:18:27 +00:00
Claude 5cfed4e660 Phase 4 refinements: BootstrapSession, GlobalAdmin, Notification, SessionReport
Additional cleanup from background agents completing their migrations.

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 07:17:47 +00:00
Claude 5405a40a5a Phase 4: Extract table storage from all bypass services into repositories
New repository implementations:
- TableConfigRepository: TenantConfig, AdminConfig, PreviewWhitelist, PreviewConfig
- TableBootstrapRepository: BootstrapSessions with dual-partition scheme
- TableNotificationRepository: GlobalNotifications + SessionReports
- TableDeviceSecurityRepository: BlockedDevices + BlockedVersions

Services migrated to use repository interfaces (keep caching + business logic):
- TenantConfigurationService → IConfigRepository
- AdminConfigurationService → IConfigRepository
- PreviewWhitelistService → IConfigRepository
- TelegramNotificationService → IConfigRepository
- GlobalAdminService → IAdminRepository
- TenantAdminsService → IAdminRepository
- BootstrapSessionService → IBootstrapRepository
- GlobalNotificationService → INotificationRepository
- SessionReportService → INotificationRepository
- BlockedDeviceService → IDeviceSecurityRepository
- BlockedVersionService → IDeviceSecurityRepository

TableAdminRepository rewritten with direct table CRUD (removed circular service deps).
IVulnerabilityRepository: Added GetCveCacheEntryAsync for VulnerabilityCorrelationService.

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 07:16:23 +00:00
Claude 6fec275d9e Update IConfigRepository, IBootstrapRepository, INotificationRepository for Phase 4
- IConfigRepository: Add GetNotificationEmailAsync, SaveNotificationEmailAsync
- IBootstrapRepository: Add CleanupExpiredAsync
- INotificationRepository: Add DismissAllNotificationsAsync, GlobalNotification.Type/Href

Phase 4 agents running in background creating repository implementations.

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 07:10:45 +00:00
Claude fdbbfcb1c6 Update migration plan — Phase 1-3 complete, zero direct TableStorageService consumers
https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:57:06 +00:00
Claude 36b8594ff0 Migrate all Vulnerability functions, ApiKey, bypass services to DAL (Phase 3)
Vulnerability Functions (8 files):
- GetCpeMappings, SaveCustomCpeMapping, DeleteCustomCpeMapping → IVulnerabilityRepository
- GetUnmatchedSoftware, GetSoftwareInventory → IVulnerabilityRepository
- GetVulnerabilityReport → IVulnerabilityRepository + ISessionRepository
- TriggerVulnerabilityDataSync, VulnerabilityDataSync → IVulnerabilityRepository

Admin:
- ReseedFromGitHubFunction → IVulnerabilityRepository + IRuleRepository
- ApiKeyManagementFunction → IAdminRepository
- ApiKeyMiddleware → IAdminRepository

Bypass Services (removed TableStorageService dependency):
- BlockedDeviceService → own TableClient from IConfiguration
- BlockedVersionService → own TableClient from IConfiguration
- SessionReportService → own TableClient from IConfiguration

New: TableAdminRepository implementation for IAdminRepository

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:54:35 +00:00
Claude 782f81f1a6 Expand IVulnerabilityRepository, IAdminRepository, INotificationRepository for Phase 3
- IVulnerabilityRepository: Add CPE mapping CRUD, CVE cache, cross-tenant inventory
- IAdminRepository: Add GetAllApiKeysAsync, GetApiKeyAsync, IncrementApiKeyRequestCountAsync
- INotificationRepository: Add UpdateSessionReportAdminNoteAsync
- TableVulnerabilityRepository: Implement all new methods with direct table access

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:48:47 +00:00
Claude 799ec0a39b Migrate GetPlatformStatsFunction to IMetricsRepository
Completes non-Vulnerability function migrations. Remaining 14 files still
using TableStorageService are: 8 Vulnerability functions (use GetTableClient),
ReseedFromGitHub, ApiKeyManagement, BlockedDevice/VersionService,
SessionReportService, ApiKeyMiddleware — these need interface additions first.

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:42:39 +00:00
Claude b3187d9ef3 Migrate AuditLogs, RuleResults, Progress, Feedback, Auth functions to DAL
- GetAuditLogsFunction, GetGlobalAuditLogsFunction → IMaintenanceRepository
- GetRuleResultsFunction → IRuleRepository + IMaintenanceRepository + ISessionRepository
- ProgressPortalFunction, FeedbackFunction → ISessionRepository
- AuthFunction → IMetricsRepository

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:42:06 +00:00
Claude 6582faad17 Migrate GetGlobalGeographicMetricsFunction to DAL
https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:38:20 +00:00
Claude 85cd9ae688 Migrate GetGeographicMetricsFunction to DAL
https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:37:58 +00:00
Claude ff6e43cecc Migrate Geographic Location Sessions functions to DAL
https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:37:41 +00:00
Claude cae99b445f Migrate GetAppMetrics, GetGlobalAppMetrics, TenantOffboard refinements
https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:37:11 +00:00
Claude d89e2a2ad1 Migrate TenantAdminManagement, TenantOffboard functions to DAL
https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:36:38 +00:00
Claude b2246fa7a4 Migrate VersionBlockFunction, MaintenanceService.Aggregation refinements
https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:35:41 +00:00
Claude 6468a87bc3 Migrate DeviceBlock, Bootstrap, Config, MaintenanceService.Aggregation to DAL
- DeviceBlockFunction → IMaintenanceRepository
- CreateBootstrapSessionFunction → IMaintenanceRepository
- RevokeBootstrapSessionFunction → IMaintenanceRepository
- UpdateTenantConfigurationFunction → IMaintenanceRepository
- MaintenanceService.Aggregation → repository interfaces
- IngestEventsFunction.Processing refinements

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:35:24 +00:00
Claude 107fb51a14 Continue DAL migration: Config functions, IngestEvents processing, MaintenanceService
Incremental progress from background agents migrating remaining functions
and services to repository interfaces.

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:33:10 +00:00
Claude bd41ea05c7 Migrate MaintenanceService, IngestEvents processing, UpdateAdminConfig to DAL
- MaintenanceService → IMaintenanceRepository + ISessionRepository + IMetricsRepository
- IngestEventsFunction.Processing → updated repository references
- UpdateAdminConfigurationFunction → IMaintenanceRepository

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:32:37 +00:00
Claude 7bf139ecbe Migrate IngestEvents, RegisterSession, DeleteSession, services to DAL
- IngestEventsFunction → ISessionRepository + IMetricsRepository + IMaintenanceRepository
- RegisterSessionFunction → ISessionRepository + IMetricsRepository
- DeleteSessionFunction → ISessionRepository + IMaintenanceRepository
- SubmitSessionReportFunction → IMaintenanceRepository
- RuleEngine → IRuleRepository
- UsageMetricsService → IMetricsRepository + IMaintenanceRepository + ISessionRepository
- PlatformMetricsService → IMetricsRepository + IMaintenanceRepository
- Add StoreEventsBatchAsync to ISessionRepository + TableSessionRepository

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:32:10 +00:00
Claude 2c83bca248 Migrate MarkSession Functions, SearchByCve, AnalyzeRule/GatherRule services to DAL
- MarkSessionFailedFunction, MarkSessionSucceededFunction → ISessionRepository + IMaintenanceRepository
- SearchSessionsByCveFunction → ISessionRepository
- AnalyzeRuleService, GatherRuleService → IRuleRepository
- ImeLogPatternService → IRuleRepository

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:30:14 +00:00
Claude 5b4e4238f3 Migrate Session and Metrics Functions to DAL repository interfaces
Replace direct TableStorageService injection with ISessionRepository,
IMetricsRepository, and IMaintenanceRepository in 10 Function files.
Add GetSessionEventsAsync to ISessionRepository interface.

Migration in progress — more functions and services to follow.

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:29:17 +00:00
Claude 36554c5ca4 Add Data Access Layer with repository interfaces and Table Storage implementations
Introduces a clean abstraction layer to decouple domain services from Azure Table Storage,
enabling future migration to Cosmos DB and Event Streaming without touching business logic.

Architecture:
- 10 repository interfaces in Shared/DataAccess/ (ISessionRepository, IRuleRepository, etc.)
- IDataEventPublisher interface with NullDataEventPublisher for future event streaming
- IStorageInitializer for provider-agnostic initialization
- 5 Table Storage implementations that delegate to existing TableStorageService
- DI extension method AddTableStorageDataAccess() with AddEventStreaming<T>() hook
- Migration plan in tasks/todo.md for incremental adoption

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
2026-03-27 06:03:55 +00:00
Oliver Kieselbach 29cc623da6 Merge pull request #30 from okieselbach/claude/add-vector-search-mcp-qLyNT 2026-03-27 01:13:01 +01:00
Claude 73592068d8 chore(mcp): migrate from @xenova/transformers to @huggingface/transformers
Replace the deprecated @xenova/transformers v2 with the actively maintained
@huggingface/transformers v3. Migration changes:

- Import path: @xenova/transformers → @huggingface/transformers
- Quantization: quantized: true → dtype: 'q8' (v3 API)
- Type workaround: dynamic import for pipeline() to avoid TS2590
  from the more complex v3 overload signatures

Model (Xenova/all-MiniLM-L6-v2) and output format unchanged.

https://claude.ai/code/session_01TBPsvvMBue9Ft7j3CfD4S2
2026-03-27 00:11:53 +00:00
Oliver Kieselbach 7f252b95fc Merge pull request #29 from okieselbach/claude/agent-build-workflow-qf0j6
Add GitHub Actions workflow for building and releasing Agent
2026-03-26 22:11:45 +01:00
Oliver Kieselbach f80d6cf150 Merge pull request #28 from okieselbach/claude/clarify-license-readme-axUuY 2026-03-26 19:22:09 +01:00
Claude 5a2709ef16 Clarify split licensing model in README
The License section previously stated "MIT License" which was misleading,
as the project actually uses a split model (MIT for Agent/Shared, AGPL-3.0
for server-side components). Updated to reflect the actual licensing terms.

https://claude.ai/code/session_01WPv7ceMFvhU9GStDPcryRE
2026-03-26 18:20:48 +00:00
Claude 50cc268738 feat: add SummaryDialog build and Azure Blob Storage upload to agent workflow
- Build SummaryDialog (WPF) alongside Agent and bundle into same ZIP
- Upload AutopilotMonitor-Agent.zip + version.json to Azure Blob Storage
  (matches bootstrap script download URL pattern)
- Compute Content-MD5 header for ZIP integrity validation
- New workflow input to toggle blob upload independently from release

Requires AZURE_BLOB_AGENT_SAS_TOKEN secret for blob storage access.

https://claude.ai/code/session_01QiuThUkeSEbiapFpTY9yRp
2026-03-26 18:15:08 +00:00
Claude ddc0328922 feat: add GitHub Actions workflow for Agent build & release
On-demand workflow (workflow_dispatch) that:
- Builds the .NET Framework 4.8 Agent on Windows runner
- Auto-increments build counter or accepts manual override
- Creates a ZIP artifact with all build outputs + version.json
- Optionally creates a GitHub Release with the artifacts
- Commits updated buildcounter.txt back to the repo

https://claude.ai/code/session_01QiuThUkeSEbiapFpTY9yRp
2026-03-26 18:11:08 +00:00
Claude a219affd91 refactor(mcp): abstract search behind SearchProvider interface
Introduce a pluggable search architecture with two backends:

- VectorSearchProvider: Sentence-transformer embeddings (all-MiniLM-L6-v2)
  for true semantic search. Best quality, requires model download.
- FuseSearchProvider: Fuse.js fuzzy text matching. Zero model download,
  instant startup, lightweight fallback.

Auto-detection: if @xenova/transformers is available, uses vector; otherwise
falls back to fuse. Override via SEARCH_BACKEND=vector|fuse env var.

Architecture:
  SearchProvider (interface)  ← tools.ts programs against this
  ├── VectorSearchProvider    ← embeddings + cosine similarity
  └── FuseSearchProvider      ← fuse.js weighted fuzzy match
  createSearchProvider()      ← factory with auto-detect

Also refactored knowledge-base.ts to be provider-agnostic (just loads
documents) and removed the old monolithic vector-store.ts.

https://claude.ai/code/session_01TBPsvvMBue9Ft7j3CfD4S2
2026-03-26 17:30:21 +00:00
Claude ba5ef2ae22 feat(mcp): add vector search with semantic knowledge base and event search
Add two new MCP tools powered by local embeddings (all-MiniLM-L6-v2 via
@xenova/transformers):

- search_knowledge: Semantic search over 103 analysis rules, gather rules,
  and IME log patterns. Finds relevant rules by meaning, not exact match.
- search_events_semantic: Semantic search over enrollment event messages
  within a session or across recent failed sessions. Matches symptoms by
  meaning (e.g. "timeout" finds "connection timed out", "waiting exceeded").

Implementation:
- vector-store.ts: In-memory vector store with cosine similarity
- knowledge-base.ts: Loads rules from disk, computes embeddings at startup
- Embeddings computed locally — no external API key required

https://claude.ai/code/session_01TBPsvvMBue9Ft7j3CfD4S2
2026-03-26 17:07:58 +00:00
Oliver Kieselbach ce1833231c update changelog 2026-03-26 10:09:08 +01:00
Oliver Kieselbach 439dbcaa90 fix tenant config 2026-03-26 09:55:49 +01:00
Oliver Kieselbach ab93e482ba rules description render fix 2026-03-26 09:46:46 +01:00