Repository navigation
Claim a Job (managed OH) - BED-9515 - #94
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. WalkthroughThe change adds managed collector-job polling, claiming, credential validation, and runner handoff. It also adds bounded AWS client settings, binary secret parsing, and sanitized handling of managed-job request errors. ChangesManaged Collector Scheduling
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Service
participant BloodHoundEnterprise
participant AWSSecretsManager
participant ManagedJobRunner
Service->>BloodHoundEnterprise: Poll queue and claim matching job
BloodHoundEnterprise-->>Service: Return claimed job
Service->>AWSSecretsManager: Retrieve secret for claimed job
AWSSecretsManager-->>Service: Return decoded credentials
Service->>ManagedJobRunner: Pass prepared job
Suggested reviewers: Merge Risk: ⚪ Minimal · up to Managed job claiming, credential validation and failure reporting are bounded and sanitized. Unmanaged scheduling is unchanged. No confirmed merge-blocking defect remains. It is still worth confirming how the server responds when ending an expired claim, because a persistent non-404 error would keep retrying the failure report. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
A rabbit checks the job queue bright Comment |
Summary
Ticket: BED-9515
A managed OpenHound collector can claim an available BHE job and validate its required credentials from AWS Secrets Manager before collection begins. Self-hosted scheduling remains unchanged when managed mode is disabled.
Flow
If retrieval or validation fails, report the claimed job as
FAILEDwith the fixed messageCredential validation failedand do not start a collection.Reliability and credential protection
404clears local state.401before retrying the request.Current scope
Managed collection is not yet complete end to end. This PR adds the logic to claim a job and retrieve and validate its credentials, so the job details and credentials are ready for the collector to use. The scheduler currently stops before claiming work because the managed collection runtime is not connected yet. BED-9516 will supply managed start and execution.
Verification
Tests cover claim request shape, claim-to-credential-to-handoff ordering, BHE token refresh, validation failures, conflicts, retries, failure-report recovery, credential redaction, and unchanged unmanaged scheduling.
Summary by CodeRabbit