Skip to content

feat(dsregcmd): DSRegTool Phase 1 diagnostic rules - #15

Merged
adamgell merged 2 commits into
mainfrom
dsregtool-phase1
Mar 17, 2026
Merged

feat(dsregcmd): DSRegTool Phase 1 diagnostic rules#15
adamgell merged 2 commits into
mainfrom
dsregtool-phase1

Conversation

@adamgell

Copy link
Copy Markdown
Owner

Summary

New Rules

Rule ID Severity Fires When
builtin-admin-cannot-join Error User identity is built-in Administrator or SID ending in -500 on a non-joined device
entra-sync-pending-inference Warning Domain-joined + not AAD-joined + AD pre-join tests passing
fallback-sync-join-active Info Sync-join fallback enabled on a non-hybrid device
scp-verify-needed Warning DRS discovery failed on a domain-joined device
scp-tenant-mismatch-hint Warning Both DRS discovery and AD configuration tests fail with tenant details present

Test plan

  • cargo test --lib dsregcmd — all 30 tests pass (20 existing + 10 new)
  • cargo clippy -- -D warnings — zero warnings in rules.rs
  • Manual: run with dsregcmd output containing Administrator identity
  • Manual: run with domain-joined but not AAD-joined device output
  • Manual: run with DRS discovery failure on domain-joined device

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings March 16, 2026 20:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_diagnostics in rules.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 {
Comment thread src-tauri/src/dsregcmd/rules.rs Dismissed
…ainst absent AD tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@adamgell
adamgell merged commit 2958be4 into main Mar 17, 2026
9 checks passed
@adamgell
adamgell deleted the dsregtool-phase1 branch July 30, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants