feat(dsregcmd): DSRegTool Phase 1 diagnostic rules - #15
Merged
Conversation
Add 5 new rules from the DSRegTool gap analysis (PR #13): - builtin-admin-cannot-join: detect built-in Administrator / SID -500 - entra-sync-pending-inference: domain-joined but not AAD-synced - fallback-sync-join-active: sync-join fallback on non-hybrid devices - scp-verify-needed: SCP guidance when DRS discovery fails - scp-tenant-mismatch-hint: dual failure suggesting tenant misalignment Includes 10 unit tests covering positive and negative cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Implements Phase 1 “quick win” DSRegTool-inspired diagnostics in the dsregcmd analyzer by adding several heuristic rules (no new parsing/data collection) plus unit tests validating each rule’s behavior.
Changes:
- Added 5 new DSRegTool Phase 1 diagnostic rules to
build_diagnosticsinrules.rs. - Added 10 unit tests covering positive/negative cases for the new rules.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1386
to
+1392
| let is_builtin_admin = contains_text(&facts.diagnostics.user_identity, "administrator") | ||
| || facts | ||
| .diagnostics | ||
| .user_identity | ||
| .as_deref() | ||
| .map(|id| id.trim().ends_with("-500")) | ||
| .unwrap_or(false); |
|
|
||
| // Device sync status inference — sync pending | ||
| if facts.join_state.domain_joined == Some(true) | ||
| && facts.join_state.azure_ad_joined == Some(false) |
Comment on lines
+1468
to
+1473
| let is_domain_joined_not_hybrid = facts.join_state.domain_joined == Some(true) | ||
| && matches!( | ||
| derived.join_type, | ||
| DsregcmdJoinType::HybridEntraIdJoined | DsregcmdJoinType::NotJoined | ||
| ); | ||
| if has_drs_discovery_failure && is_domain_joined_not_hybrid { |
…ainst absent AD tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
rules.rsusing existing parsed data — zero new data collection neededNew Rules
builtin-admin-cannot-join-500on a non-joined deviceentra-sync-pending-inferencefallback-sync-join-activescp-verify-neededscp-tenant-mismatch-hintTest plan
cargo test --lib dsregcmd— all 30 tests pass (20 existing + 10 new)cargo clippy -- -D warnings— zero warnings in rules.rs🤖 Generated with Claude Code