Commit 19a6a33
feat(hybridagent): pivot to AD scan producer for Azure-native stack
The Azure-native deployment is a parallel product to the on-prem stack; the
two coexist but never integrate. This commit flips Phase 3 so the HybridAgent
is the PRODUCER of sealed batches (it has line of sight to on-prem AD) and a
future Azure consumer Function will persist rows into Azure SQL.
Core
* Move IDekSealingFacade + DekSealingService from Functions/Security to
Core/Security so the agent can reference them directly (Azure.Security.
KeyVault.Keys added to Core).
* ConfigurationProvider gains a static-only mode (CreateStaticOnly factory)
for hosts that read scan parameters straight from appsettings.json with no
SQL backing - guarded by EnsureNotStaticOnly on every write path.
* NoOpAuditService for hosts without an AuditEvents table - logs AUDIT lines
via Serilog only.
HybridAgent
* Drop consumer-side wiring (SealedBatchProcessor BackgroundService,
IDekUnsealingFacade, replay store, SealedBatchHandler) from DI; files stay
dormant for the upcoming consumer Function migration.
* New SealedBatchSender wraps ServiceBusSender for SealedDekBatchMessage; uses
BatchId as MessageId for SB dedup.
* New AdScanProducerJob (Quartz IJob, DisallowConcurrentExecution) drives
IAdScannerService, buffers up to 250 rows per batch, seals each with the
Key Vault agent-seal key, publishes to dek-sealed-batches queue.
* Program.cs rewritten with Serilog + ScanConfiguration/AuthConfiguration
binding + static ConfigurationProvider + LdapConnectionFactory +
AdScannerService + DekSealingService + Quartz scheduler reading
ScanSettings:CronSchedule.
* appsettings.json mirrors the on-prem Worker schema (ScanSettings,
Authentication, Encryption:KeyVault, SealedBatch) so admins can lift
values from the on-prem config.
* Quartz + Serilog packages added.
Deploy-HybridAgent.ps1
* New params: -KeyVaultUri, -SealKeyName, -LdapServer, -LdapSearchBase,
-LdapPort, -LdapUseSsl, -CronSchedule, -ImportFromWorkerAppSettings.
* Merge helper now supports nested objects (Encryption.KeyVault) and merges
4 sections in one remote call. Explicit params override imported file.
Verified
* dotnet build .\BitLockerKeyMonitor.Azure.slnx - 0 warn / 0 err.
* dotnet test .\BitLockerKeyMonitor.Azure.slnx - 109/109 pass.
* dotnet test .\BitLockerKeyMonitor.slnx - 86/86 on-prem pass.
Deferred next session:
* Build Azure consumer Function (ServiceBusTrigger - unseal - upsert).
* Move IDekUnsealingFacade + SealedBatchHandler to Core/Security.
* Flip Bicep RBAC: HybridAgent SP gets Crypto User + SB Data Sender;
Functions UAMI flips from Sender to Receiver.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 66c8d10 commit 19a6a33
12 files changed
Lines changed: 682 additions & 92 deletions
File tree
- src
- BitLockerKeyMonitor.Core
- Security
- Services
- BitLockerKeyMonitor.HybridAgent
- Jobs
- Security
- tests/BitLockerKeyMonitor.Functions.Tests/Security
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
113 | 129 | | |
114 | 130 | | |
115 | 131 | | |
| |||
307 | 323 | | |
308 | 324 | | |
309 | 325 | | |
310 | | - | |
311 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
312 | 357 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
343 | 430 | | |
344 | | - | |
345 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
346 | 438 | | |
347 | 439 | | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | 440 | | |
354 | 441 | | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
| 442 | + | |
| 443 | + | |
361 | 444 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
369 | 458 | | |
370 | 459 | | |
371 | 460 | | |
| |||
474 | 563 | | |
475 | 564 | | |
476 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
477 | 570 | | |
478 | 571 | | |
479 | 572 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
6 | | - | |
| 5 | + | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
Lines changed: 57 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
46 | 74 | | |
47 | 75 | | |
48 | 76 | | |
49 | 77 | | |
50 | 78 | | |
51 | 79 | | |
52 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
53 | 90 | | |
54 | 91 | | |
55 | 92 | | |
56 | | - | |
| 93 | + | |
57 | 94 | | |
58 | 95 | | |
59 | 96 | | |
| |||
84 | 121 | | |
85 | 122 | | |
86 | 123 | | |
| 124 | + | |
87 | 125 | | |
88 | 126 | | |
89 | 127 | | |
90 | | - | |
| 128 | + | |
91 | 129 | | |
92 | 130 | | |
93 | 131 | | |
| |||
123 | 161 | | |
124 | 162 | | |
125 | 163 | | |
| 164 | + | |
126 | 165 | | |
127 | 166 | | |
128 | 167 | | |
129 | | - | |
| 168 | + | |
130 | 169 | | |
131 | 170 | | |
132 | 171 | | |
| |||
138 | 177 | | |
139 | 178 | | |
140 | 179 | | |
141 | | - | |
| 180 | + | |
142 | 181 | | |
143 | 182 | | |
144 | 183 | | |
| |||
152 | 191 | | |
153 | 192 | | |
154 | 193 | | |
155 | | - | |
| 194 | + | |
| 195 | + | |
156 | 196 | | |
157 | 197 | | |
158 | 198 | | |
| |||
164 | 204 | | |
165 | 205 | | |
166 | 206 | | |
167 | | - | |
| 207 | + | |
168 | 208 | | |
169 | 209 | | |
170 | 210 | | |
| |||
269 | 309 | | |
270 | 310 | | |
271 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
272 | 321 | | |
273 | 322 | | |
274 | 323 | | |
| |||
0 commit comments