-
Notifications
You must be signed in to change notification settings - Fork 234
Adding ObjectId to CompStatus #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughPropagates an ObjectId into status reporting: producers set Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Operator
participant Producer as Producer (ComputerFile/Stealth)
participant Processor as ObjectProcessors
participant Smb as SmbProcessor
participant LDAP as DCLdapProcessor
participant Writer as CompStatusWriter
Operator->>Producer: start resolution
Producer->>Processor: report resolved target { SID, ObjectId }
note right of Producer #D3E4CD: Producer sets CSVComputerStatus.ObjectId
Processor->>Smb: Scan(apiName, domainSid)
Smb-->>Processor: SMB results
Processor->>LDAP: Scan(displayName, objectId)
LDAP-->>Processor: LDAP results
Processor->>Writer: Write CSVComputerStatus { ComputerName, Task, Status, ObjectId }
Writer-->>Operator: CSV row including ObjectID
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Writers/CompStatusWriter.cs (1)
22-23: Remove duplicate assignment.The assignment
_channel = channel;appears twice consecutively, which is redundant.Apply this diff to remove the duplicate:
_context = context; _channel = channel; - _channel = channel; if (!_context.Flags.DumpComputerStatus) NoOp = true;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
Sharphound.csproj(1 hunks)src/Runtime/ObjectProcessors.cs(7 hunks)src/Writers/CompStatusWriter.cs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/Runtime/ObjectProcessors.cs
🔇 Additional comments (1)
src/Writers/CompStatusWriter.cs (1)
63-63: Verify CSV serialization by testing the actual output.The header has been updated to include ObjectID, and the codebase consistently populates the
ObjectIdproperty when creatingCSVComputerStatusinstances. However, theToCsv()method is defined in the externalSharpHoundCommonNuGet package (v4.5.0), which cannot be inspected in this codebase.To confirm the change is correct, manually run the tool with
DumpComputerStatusflag enabled and verify that:
- The CSV output contains all four columns: ComputerName, Task, Status, ObjectID
- The columns appear in this order
- ObjectID values are populated correctly
Description
Adding ObjectId to CompStatus
Motivation and Context
Resolves: BED-6568
How Has This Been Tested?
This has been tested by creating a build of SharpHound with the updated library, and using running a collection.
Screenshots (if appropriate):
Types of changes
Checklist:
Summary by CodeRabbit
New Features
Style