NM-304: collect additional data for MDM integration#1334
Merged
Conversation
Contributor
|
Review Complete Files Reviewed: 29 By Severity:
This PR introduces cross-platform device identity collection (Linux, Windows, macOS) and MDM compliance posture handling. Review found 2 high-severity bugs (unbounded external command execution blocking the SYSTEM service, and computer UPNs bypassing machine account filters) plus 3 medium-severity identity bugs (DMI placeholders, sentinel UUIDs, day-count truncation) and 1 low-severity error-wrapping contract violation. Files Reviewed (29 files) |
Contributor
There was a problem hiding this comment.
Risk: 🟠 High (68/100) — 2 high findings, 3 medium, 1 low · 1400 LOC across 29 files
High Severity
- Unbounded external command timeouts (
posture/runner.go:11):osRunner.Runusesexec.Command().Output()without context/timeout. On Windows SYSTEM service, hung PowerShell/dsregcmd/wmic blocks all netclient operations indefinitely. Requires interface change toexec.CommandContextwith 15s timeout. - Computer UPN misclassified as user email (
posture/email.go:12):isMachineAccountonly checksHasSuffix("$"), missing Azure AD computer UPNs likeCOMPUTERNAME$@tenant.onmicrosoft.com. Causes silent MDM matching failures when SYSTEM service reports machine identity as user email.
Medium Severity
- DMI placeholder strings treated as valid serial numbers (
posture/identity_linux.go:6):firstNonEmptyaccepts placeholders like "Not Specified" and "To be filled by O.E.M.", skipping theboard_serialfallback. - Sentinel UUIDs (nil/all-ones) unfiltered (
posture/identity_windows.go:24): VM fleets without SMBIOS passthrough share the same sentinel UUID, causing device identity collisions. humanDurationtruncates day values ending in 0 (functions/posture.go:138):TrimSuffixstrips "0d" from any day value ending in 0 (10→1, 20→2, etc.).
Low Severity
- Error wrapping drops
ErrStatusNotOk(auth/mdm.go:42):AsMDMDenieduses%w: %sinstead of%w: %w, breaking the documented error chain contract.
Co-authored-by: tenki-reviewer[bot] <262613592+tenki-reviewer[bot]@users.noreply.github.com>
Co-authored-by: tenki-reviewer[bot] <262613592+tenki-reviewer[bot]@users.noreply.github.com>
NEETweeb
approved these changes
Jun 27, 2026
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.
Describe your changes
Provide Issue ticket number if applicable/not in title
Provide link to Netmaker PR if required
Provide testing steps
Checklist before requesting a review