BED-7975: Add support for log upload & download (support bundles)#17
Draft
StranDutton wants to merge 2 commits into
Draft
BED-7975: Add support for log upload & download (support bundles)#17StranDutton wants to merge 2 commits into
StranDutton wants to merge 2 commits into
Conversation
- Add management polling via GET /api/v2/clients/management before each job poll cycle so management operations take priority over collections. - Add support_bundle module: collect_log_files() gathers openhound.log and ext_*.log files; create_support_bundle() zips them with a timestamped filename (<name>_support_bundle_%Y-%m-%d-%H-%M-%S.zip). - Add upload_support_bundle() on BloodHoundEnterprise client, POSTing the zip to POST /api/v2/clients/management/artifacts. - Add ManagementOperationType and ManagementOperationStatus as StrEnums (values confirmed via BED-8268 DB migration CHECK constraints). - Add ManagementOperation and ManagementAvailable Pydantic models with optional nullable fields from the DB schema (requested_by_user_id, started_at, completed_at, execution_time). - Add check_management() and _send_support_bundle() to scheduler Service. - Extend _poll() to check management before jobs; management errors are logged and swallowed so job collection continues uninterrupted. - Add 14 new tests covering management polling, poll ordering, log collection, bundle creation, upload, and cleanup. TODO(BED-8266): Confirm response field names once GET /api/v2/clients/management is fully implemented in BHE.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves BED-7975.
DRAFT - not ready for review
Draft Status:
Implements support for collecting and uploading OpenHound logs to BloodHound Enterprise as a support bundle.
The collector now polls for management operations, creates zipped bundles of platform and job logs, and uploads them when triggered by BHE administrators.
Changes:
New support bundle module (src/openhound/core/support_bundle.py):
Management API models (updated src/openhound/core/clients/models/jobs.py):
Client methods (updated src/openhound/core/clients/bloodhound_enterprise.py):
Poll loop integration (updated src/openhound/scheduler/service.py):
Included test coverage (updated tests/test_bhe_job_scheduling.py):
Also added
AGENTS.mdso there's more awareness about the required branch naming convention.Technical Details: