Skip to content

Use MDM SecurityInfo as boot policy source#420

Open
Thinkscape wants to merge 1 commit into
Layr-Labs:masterfrom
Thinkscape:doctor-mdm-boot-policy-source
Open

Use MDM SecurityInfo as boot policy source#420
Thinkscape wants to merge 1 commit into
Layr-Labs:masterfrom
Thinkscape:doctor-mdm-boot-policy-source

Conversation

@Thinkscape

@Thinkscape Thinkscape commented Jun 20, 2026

Copy link
Copy Markdown

Summary

Avoid local localized boot-policy parsing in doctor: the detailed local checks no longer render a Secure Boot verdict from the authenticated-root proxy. The coordinator now treats Apple's typed MDM SecurityInfo.SecureBootLevel as the authoritative boot-policy source, with only full accepted and documented/tested against medium, off, and not supported.

Linked issue

N/A - follow-up to PR #398 boot-policy review

Test plan

  • cd /Users/thinkscape/d-inference-mdm-boot-policy-20260620-142122/provider-swift && swift build --product darkbloom - passed; product darkbloom built successfully (warnings only).
  • cd /Users/thinkscape/d-inference-mdm-boot-policy-20260620-142122/provider-swift && DARKBLOOM_NO_UPDATE_CHECK=1 .build/debug/darkbloom doctor - ran built binary; exited 1 because the self-built debug binary is missing the keychain-access-groups entitlement for the Secure Enclave key (OSStatus -34018). Relevant output confirmed no detailed secure boot check is printed; authenticated root, mdm enrollment, and coordinator trust checks still print and pass on this machine.
  • cd /Users/thinkscape/d-inference-mdm-boot-policy-20260620-142122/provider-swift && swift test --filter MDMTrustDiagnosis - passed 7 tests in MDMTrustDiagnosisTests.
  • cd /Users/thinkscape/d-inference-mdm-boot-policy-20260620-142122 && go test ./coordinator/mdm - passed.
  • cd /Users/thinkscape/d-inference-mdm-boot-policy-20260620-142122 && go test ./coordinator/api - passed.
  • git diff --check - passed.

Components touched

  • coordinator (Go)
  • provider (Rust, legacy)
  • provider-swift (Swift CLI)
  • console-ui (Next.js)
  • enclave (Swift)
  • infra / CI / release
  • docs

Protocol / interface changes

  • No protocol/interface changes
  • Yes — described above and matching side updated

Notes for reviewers

Verified local alternatives while preparing this change: there is no public BootPolicy or DeviceManagement Swift module for an unprivileged local doctor check; bputil requires root; private BootPolicy access is unsuitable for doctor. This keeps local doctor away from localized display strings and leaves boot-policy authority with the typed MDM SecurityInfo response.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

@Thinkscape is attempting to deploy a commit to the EigenLabs Team on Vercel.

A member of the Team first needs to authorize it.

@Thinkscape Thinkscape force-pushed the doctor-mdm-boot-policy-source branch from 3020105 to a0a5ae0 Compare June 20, 2026 05:19
@Thinkscape Thinkscape mentioned this pull request Jun 20, 2026
9 tasks
@Thinkscape Thinkscape force-pushed the doctor-mdm-boot-policy-source branch from a0a5ae0 to 32d1a83 Compare June 20, 2026 05:29

@ethenotethan ethenotethan 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.

Automated Code Review — Layr-Labs/d-inference#

Verdict: COMMENT

Security — ✅ No issues found

Performance — 2 finding(s)

  • 🔵 [INFO] coordinator/api/provider_mdm_reliability_test.go:133 — String formatting in test helper could be optimized
    • Suggestion: Pre-allocate string builder or use strings.Builder for better performance if this helper is called frequently
  • 🔵 [INFO] coordinator/mdm/mdm.go:741-743 — fmt.Sprintf in error path allocates unnecessarily
    • Suggestion: Consider pre-formatting common error messages or using string concatenation for this simple case

Type_diligence — ✅ No issues found

Additive_complexity — 1 finding(s)

  • 🔵 [INFO] coordinator/mdm/mdm.go:251-253 — HasFullSecureBoot method adds unnecessary indirection for simple string comparison
    • Suggestion: Replace method with direct comparison r.SecureBootLevel == SecureBootLevelFull at call sites, or inline the logic if used only once

3 finding(s) total, 0 blocking. Verdict: COMMENT.

🤖 Automated review by Centaur · DAR-186

@ethenotethan ethenotethan 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.

Automated Code Review — Layr-Labs/d-inference#

Verdict: COMMENT

Security — ✅ No issues found

Performance — 1 finding(s)

  • 🔵 [INFO] coordinator/api/provider_mdm_reliability_test.go:133 — String formatting in test helper called repeatedly with same parameters
    • Suggestion: Pre-compute the plist template or cache formatted strings if this helper is called frequently in test loops

Type_diligence — ✅ No issues found

Additive_complexity — 1 finding(s)

  • 🔵 [INFO] coordinator/mdm/mdm.go:251-253 — HasFullSecureBoot method adds unnecessary indirection for simple string comparison
    • Suggestion: Replace method with direct comparison r.SecureBootLevel == SecureBootLevelFull at call sites, or inline the constant check

2 finding(s) total, 0 blocking. Verdict: COMMENT.

🤖 Automated review by Centaur · DAR-186

// securityInfoWebhook builds a MicroMDM acknowledge webhook body carrying a
// SecurityInfo plist with the given CommandUUID and SIP/SecureBoot posture.
func securityInfoWebhook(udid, commandUUID string, sipEnabled bool, secureBootFull bool) []byte {
func securityInfoWebhook(udid, commandUUID string, sipEnabled bool, secureBootLevel string) []byte {

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.

🔵 [INFO] ⚡ String formatting in test helper called repeatedly with same parameters

💡 Suggestion: Pre-compute the plist template or cache formatted strings if this helper is called frequently in test loops

📊 Score: 2×1 = 2 · Category: repeated_work

Comment thread coordinator/mdm/mdm.go
Comment on lines +251 to +253
func (r *SecurityInfoResponse) HasFullSecureBoot() bool {
return r != nil && r.SecureBootLevel == SecureBootLevelFull
}

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.

🔵 [INFO] 🧩 HasFullSecureBoot method adds unnecessary indirection for simple string comparison

💡 Suggestion: Replace method with direct comparison r.SecureBootLevel == SecureBootLevelFull at call sites, or inline the constant check

📊 Score: 2×3 = 6 · Category: over-abstraction

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.

2 participants