Commit Graph

677 Commits

Author SHA1 Message Date
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 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 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
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
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
Oliver Kieselbach f6ed4660d1 agent: secureboot certs incl. analyze rule, timezone auto set, NTP offset check 2026-03-26 09:23:12 +01:00
Oliver Kieselbach e8e586aa19 Security: request size limit, symlink detection 2026-03-26 08:07:02 +01:00
Oliver Kieselbach 5dabba56ab Merge branch 'mcp-server'
# Conflicts:
#	src/Agent/AutopilotMonitor.Agent/buildcounter.txt
#	src/Web/autopilot-monitor-web/tsconfig.tsbuildinfo
2026-03-26 07:06:01 +01:00
Oliver Kieselbach d4501fbcb3 update license 2026-03-26 07:02:33 +01:00
Oliver Kieselbach e65a76c836 changed download api for bootstrapper 2026-03-26 06:27:44 +01:00
Oliver Kieselbach 0df6ed6890 changed api default access 2026-03-25 18:08:04 +01:00
Oliver Kieselbach cd32ff9e6d added dynamic handling to properties 2026-03-25 17:40:12 +01:00
Oliver Kieselbach a0886c12d3 more audit 2026-03-24 23:52:08 +01:00
Oliver Kieselbach c2b34ceb58 more audit 2026-03-24 21:03:01 +01:00
Oliver Kieselbach b6d92c914e added software mapping delete und userfeedback removed collapse 2026-03-24 16:16:18 +01:00
Oliver Kieselbach 9f7d6e23f1 initial mcp server implementation 2026-03-24 08:06:48 +01:00
Oliver Kieselbach 8e1b45042a changed appinsights events 2026-03-23 07:12:38 +01:00
Oliver Kieselbach 0fd8ca22d1 renaming global admin 2026-03-23 06:28:59 +01:00
Oliver Kieselbach 3ae19f48b2 renaming global admin 2026-03-23 06:27:58 +01:00