BED-7248: Resolves BP-491 Request for Entra ID User Last Logon Timestamp AZUser Node Property#163
Conversation
WalkthroughRefactors user-listing to optionally request Graph Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as CLI (list-users)
participant Params as makeParams
participant Graph as Microsoft Graph
participant Stream as streamOnce (accumulator)
participant Logger as Logger
CLI->>Params: build params (include signInActivity)
CLI->>Graph: request users with params
Graph-->>CLI: response / error
alt response OK
CLI->>Stream: stream items -> accumulate users
Stream-->>CLI: items + per-item errors
else authorization-denied for signInActivity
CLI->>Logger: warn about missing AuditLog.Read.All
CLI->>Params: build params (without signInActivity)
CLI->>Graph: retry request
Graph-->>CLI: response
CLI->>Stream: stream items -> accumulate users
Stream-->>CLI: items + per-item errors
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmd/list-users.go (1)
64-74: RequestingsignInActivityrequires AuditLog.Read.All permission and Entra ID P1/P2 licensing.Adding
signInActivityto$selectrequires the AuditLog.Read.All Microsoft Graph permission (admin consent) and Microsoft Entra ID P1 or P2 licensing on the tenant. Without either, the Graph request fails with a permission error (403) and the user listing exits early (lines 84–86) with no retry or fallback. Consider making this field opt-in, retrying without it on permission failure, or documenting this prerequisite clearly.
|
Updated docs as well: SpecterOps/bloodhound-docs#170 |
zinic
left a comment
There was a problem hiding this comment.
Rest of the code looks good but the unmarshal function for the User type has some ergonomic friction that I'd like addressed.
https://specterops.atlassian.net/browse/BED-7248
Will be paired with a PR to BloodHound to display the data in the entity panel.
Tested by pointing BloodHound to my local copy of AzureHound
Summary by CodeRabbit
New Features
Bug Fixes / Resiliency
Tests
✏️ Tip: You can customize this high-level summary in your review settings.