Feature/timeline and delegations#2
Merged
Merged
Conversation
- Models: DomainSnapshot, ADChangeItem (ChangeType enum), ADDelegation (RightCategory/TrusteeType enums) - ADObject: add Delegations property (ObservableCollection<ADDelegation>) - Services: ADDiffService (Compare/Flatten/DetectChanges) - Services: ADImportPowerShellService — export ACL delegations in PS script (PasswordReset, AccountUnlock, ComputerManagement, AttributeWrite, FullControl) - ViewModels: DomainTimelineViewModel, DelegationsViewModel - Views: DomainTimelineWindow, DelegationsWindow (DataGrid-based) - MainWindow: Analyse menu (Ctrl+T Timeline, Ctrl+D Delegations) - MainWindowViewModel: RootObject property - csproj: add Avalonia.Controls.DataGrid 12.0.0 - App.axaml: include DataGrid Fluent theme
There was a problem hiding this comment.
Pull request overview
Adds two new analysis capabilities to SMAD-X: (1) a “Domain Timeline” window to compare two exported domain snapshots and list changes, and (2) end-to-end support for AD ACL-based delegations (import, model, UI, graph visualization).
Changes:
- Introduces a snapshot diff pipeline (models + diff service + timeline UI + CSV export).
- Adds AD delegation collection to the data model, PowerShell import output, and a dedicated Delegations UI with CSV export.
- Extends the graph view to render/filter delegation edges and surfaces delegation presence in the main TreeView.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| SMAD-X/Views/MainWindow.axaml.cs | Adds click handlers to open the new Timeline and Delegations windows. |
| SMAD-X/Views/MainWindow.axaml | Adds “Analyse” menu items and a TreeView badge for delegation presence. |
| SMAD-X/Views/GraphWindow.axaml | Refactors toolbar layout and adds a “Delegations” graph filter checkbox. |
| SMAD-X/Views/DomainTimelineWindow.axaml.cs | Implements file pickers and CSV export wiring for the timeline window. |
| SMAD-X/Views/DomainTimelineWindow.axaml | New Timeline UI (file pickers, compare button, filters, DataGrid, status). |
| SMAD-X/Views/DelegationsWindow.axaml.cs | Adds CSV export wiring and optional load-from-tree initialization. |
| SMAD-X/Views/DelegationsWindow.axaml | New Delegations UI (stats, filters, DataGrid, export, status). |
| SMAD-X/ViewModels/MainWindowViewModel.cs | Exposes RootObject for passing the loaded tree into DelegationsWindow. |
| SMAD-X/ViewModels/GraphViewModel.cs | Adds ShowDelegations and passes it into graph filter construction. |
| SMAD-X/ViewModels/DomainTimelineViewModel.cs | Implements snapshot loading, diff execution, filtering, and CSV export. |
| SMAD-X/ViewModels/DelegationsViewModel.cs | Implements delegation collection, filtering, stats, and CSV export. |
| SMAD-X/SMAD-X.csproj | Adds Avalonia DataGrid package reference. |
| SMAD-X/Services/LocalizationService.cs | Adds localization strings for delegation graph filter + delegation group descriptions. |
| SMAD-X/Services/ADImportPowerShellService.cs | Extends generated PowerShell to export delegations into JSON. |
| SMAD-X/Services/ADDiffService.cs | New diff service comparing snapshots incl. delegations. |
| SMAD-X/Services/ADDataService.cs | Adds delegation groups + sample delegations into generated structures. |
| SMAD-X/Models/DomainSnapshot.cs | New snapshot model used by the timeline comparison feature. |
| SMAD-X/Models/ADTreeNode.cs | Adds delegation-derived properties for TreeView badges/tooltips. |
| SMAD-X/Models/ADObject.cs | Adds Delegations collection to AD objects. |
| SMAD-X/Models/ADDelegation.cs | New delegation model and related enums. |
| SMAD-X/Models/ADChangeItem.cs | New diff item model used by the timeline UI. |
| SMAD-X/Helpers/LocalizationProxy.cs | Exposes the new graph delegations filter localization key. |
| SMAD-X/Graph/GraphFilter.cs | Adds ShowDelegations to graph filtering options. |
| SMAD-X/Graph/GraphEdge.cs | Adds delegation edge type and label handling. |
| SMAD-X/Graph/GraphCanvas.cs | Adds delegation edge color and legend entry. |
| SMAD-X/Graph/GraphBuilder.cs | Builds delegation edges (trustee → target) when enabled by filter. |
| SMAD-X/App.axaml | Includes DataGrid Fluent theme resources. |
| ROADMAP.md | Documents the intended design/steps for timeline + delegations features. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+82
to
+85
| <MenuItem Header="Analyse"> | ||
| <MenuItem Header="Domain Timeline (Ctrl+T)" Click="OnTimelineClick" InputGesture="Ctrl+T"/> | ||
| <MenuItem Header="Delegations (Ctrl+D)" Click="OnDelegationsClick" InputGesture="Ctrl+D"/> | ||
| </MenuItem> |
Comment on lines
+171
to
+176
| // Use "Trustee|Right|Target" as a stable key | ||
| static string Key(ADDelegation d) => | ||
| $"{d.TrusteeName}|{d.Right}|{d.TargetDN}".ToLowerInvariant(); | ||
|
|
||
| var oldKeys = before.Delegations.ToDictionary(Key); | ||
| var newKeys = after.Delegations.ToDictionary(Key); |
Comment on lines
+215
to
+221
| L(s, " $trusteeType = 'Group'"); | ||
| L(s, " try {"); | ||
| L(s, " $tObj = Get-ADObject -Filter { SAMAccountName -eq $trustee.Split('\\\\')[-1] } -Properties objectClass -ErrorAction SilentlyContinue"); | ||
| L(s, " if ($tObj.objectClass -eq 'user') { $trusteeType = 'User' }"); | ||
| L(s, " elseif ($tObj.objectClass -eq 'computer') { $trusteeType = 'Computer' }"); | ||
| L(s, " } catch {}"); | ||
| L(s, " $trusteeSam = $trustee.Split('\\\\')[-1]"); |
| var ggTier1OperatorsFresh = new ADObject("GG-Tier1-Operators", ADObjectType.Group) | ||
| { | ||
| Description = loc["Desc.Delegation.GGTier1Operators"], | ||
| Tier = GetTier("Tier 0"), |
Comment on lines
29
to
33
| <PackageReference Include="Avalonia" Version="12.0.3" /> | ||
| <PackageReference Include="Avalonia.Controls.DataGrid" Version="12.0.0" /> | ||
| <PackageReference Include="Avalonia.Desktop" Version="12.0.3" /> | ||
| <PackageReference Include="Avalonia.Themes.Fluent" Version="12.0.3" /> | ||
| <PackageReference Include="Avalonia.Fonts.Inter" Version="12.0.3" /> |
6 tasks
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.
No description provided.