Repository navigation
Agent enroll: a MAC alone no longer vouches for a different machine - #2104
Merged
fog-workflows[bot] merged 1 commit intoNov 17, 2026
Merged
Conversation
An unregistered machine carrying a MAC registered to host A (a USB Ethernet adapter shared between laptops, forum 18319) bound to host A as known-host-no-agent. Within FOG_AGENT_ENROLL_DEPLOY_WINDOW of a deploy to A, that request was approved with no admin, so a different laptop could be issued A's agent identity. The setting promises the shortcut only for an agent presenting A's firmware identity. When only the MAC found the host and the reported serial contradicts the host's stored one (SmbiosIdentity::contradicts()), enrollment now records an identity-conflict. The deploy window never approves a conflict; an admin still can, for a real board swap. The directory identity resolver returns conflict for the same case. The fake PDO row factory may now return null to answer a SELECT with no row, so the resolver test reaches the serial check instead of failing earlier as ambiguous firmware. Co-Authored-By: Claude Opus 5.5 <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.
Problem
An unregistered machine that carries a MAC registered to host A binds its fog-agent enrollment to host A with reason
known-host-no-agent. The forum 18319 case is a USB Ethernet adapter shared between laptops. WithinFOG_AGENT_ENROLL_DEPLOY_WINDOW(default 24 hours) of a deploy to A,_autoApproval()approves that request with no admin. So a different laptop can be issued A's agent identity.The setting's own description limits the shortcut to "an agent presenting that host's firmware identity". The code did not check the firmware.
MachineIdentity::resolve()(the directory-identity enroll path andidentity/check) had the same MAC-only resolution.Fix
Suppose only the MAC found the host, and the reported serial contradicts that host's stored serial. The check is
SmbiosIdentity::contradicts()from #2100: the system serial decides when both sides have one, and placeholders never count. Then:Enrollment::_resolve()recordsidentity-conflictagainst host A. The deploy window never approves a conflict. An admin still can, for a real board swap.MachineIdentity::resolve()returnsconflict.With
FOG_HOST_IDENTIFY_SMBIOSset tooff, identity is ignored as before.Verification
tests/agent-identity-check.test.php: 51 checks pass.Not changed
🤖 Generated with Claude Code