Conversation
🤖 Augment PR SummarySummary: Hotfixes BloodHound Enterprise findings parsing to prevent incorrect severity calculation for LargeDefaultGroups and to improve tier-zero detection. Changes:
Technical Notes: 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Pull request overview
This PR updates the BloodHound Enterprise findings parsing to fix severity calculation for LargeDefaultGroups relationship findings and improve tier-zero detection by supporting dynamic tier-zero tag IDs.
Changes:
- Normalize
impact_percentage/exposure_percentageinputs to prevent type errors and incorrect severity calculations (notably forLargeDefaultGroupsandNoneexposure values). - Update tier-zero detection to use
asset_group_tag_idwhen the tier management engine is enabled, and add an aggregatedis_tier_zeroflag on grouped findings. - Expand/adjust unit tests to cover the new severity normalization and tier-zero tag ID behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ghostwriter/shepherd/external/bloodhound/client.py | Fixes severity calculation robustness and updates tier-zero matching logic (tag ID + fallback), adding an is_tier_zero marker. |
| ghostwriter/shepherd/tests/test_bloodhound_client.py | Adds coverage for invalid percentage inputs and tier-zero tag ID behavior; refactors request mocking. |
Comments suppressed due to low confidence (1)
ghostwriter/shepherd/external/bloodhound/client.py:466
- The PR description mentions adding an
is_tier_zeroflag to each source/target pairing, but the flag is only added at the grouped finding level. If consumers need tier-zero identification per principal, consider addingis_tier_zeroto the dict returned by_build_target_entry()(or otherwise associating it with each entry inprincipals).
grouped[unique_key] = {"finding_name": finding_name, **grouped[unique_key]}
grouped[unique_key]["is_tier_zero"] = is_tier_zero_finding
# Calculate severity and build target entry
severity = _calculate_severity(finding)
grouped[unique_key]["principals"] = [_build_target_entry(finding, severity)]
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #882 +/- ##
==========================================
+ Coverage 93.19% 93.20% +0.01%
==========================================
Files 393 393
Lines 24937 24987 +50
==========================================
+ Hits 23239 23290 +51
+ Misses 1698 1697 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR fixes an issue with
LargeDefaultGroupfindings that could cause the severity to calculate incorrectly. It also adjusts the logic around determining if a finding is related to tier zero. I cleaned up the logic and added ais_tier_zeroflag to each source/target pairing for easy tier zero identification.