Skip to content

Honor deployment.useinsecureprotocols for ProxyDHCP boot - #265

Merged
jjohnson42 merged 4 commits into
xcat2:masterfrom
Obihoernchen:proxydhcp-insecuremode
Aug 5, 2026
Merged

Honor deployment.useinsecureprotocols for ProxyDHCP boot#265
jjohnson42 merged 4 commits into
xcat2:masterfrom
Obihoernchen:proxydhcp-insecuremode

Conversation

@Obihoernchen

Copy link
Copy Markdown
Member

reply_dhcp4 refuses to answer a PXE boot request unless deployment.useinsecureprotocols is set to firmware or
always, but the proxyDHCP handler on port 4011 had no such check. A node left at the default of never was still
offered a TFTP bootfile and a plain http boot.ipxe URL whenever its request arrived on 4011 rather than 67, so the
attribute silently did nothing in ProxyDHCP deployments that run alongside an independent DHCP server.

  • Apply the same gate in proxydhcp, with the same UEFI HTTP boot exemption and remediation hint, and ignore requests whose client architecture could not be determined (those would otherwise reach the iPXE branch without passing the gate). Node attributes are read once and passed to get_deployment_profile instead of being looked up twice.
  • Drop UEFI HTTP boot requests on 4011 explicitly. HTTP boot is offered from the DHCP path, and proxyDHCP has no bootfile branch for it, so such a request fell through with bootfile unset or left over from an earlier client.
  • Reset skiplogging per loop iteration. The reset sat in relay_proxydhcp as a dead local, so the flag stayed False after the first packet and the 90 second per hwaddr window never re-armed.
  • Rate limit the same refusal message in reply_dhcp4 through the existing ignoremacs window. A refused node never gets a reply, so it retries for as long as it is powered on and the hint repeated every few seconds.

reply_dhcp4 declines to answer a PXE boot request unless
deployment.useinsecureprotocols is set to firmware or always, but
proxydhcp had no such check. A node left at the default of never was
therefore still offered a TFTP bootfile and a plain http boot.ipxe URL
whenever the request arrived on port 4011 rather than port 67, so the
attribute silently did nothing in ProxyDHCP deployments alongside an
independent DHCP server.

Apply the same gate, including the UEFI HTTP boot exemption, and log the
same remediation hint. The node attributes are now fetched once and
passed through to get_deployment_profile instead of being looked up
again there.

Requests whose architecture could not be determined are ignored rather
than falling through to the reply. opts_to_dict stops parsing before the
client architecture option whenever the message type is not a request,
and such a packet would otherwise reach the iPXE branch and be handed a
plain http boot.ipxe URL without ever passing the gate.
The per-MAC 90 second log throttle in proxydhcp has been inert: the
`skiplogging = True` reset sat in relay_proxydhcp, where it is a dead
local, while the loop in proxydhcp only ever assigns False.  Once the
first packet is handled the flag stays False for the life of the
process, so every retransmitted boot request logs again even though
ignoredisco is updated to suppress it.

Reset the flag at the top of each loop iteration instead, next to the
timestamp check it belongs to, and drop the dead assignment.
reply_dhcp4 logs the insecure mode remediation hint on every DHCP
discover it refuses.  A node in this state never receives a reply, so it
retries for as long as it is powered on and the same message repeats
every few seconds.

Rate limit it per hardware address the way the neighbouring boot attempt
messages already do, reusing the ignoremacs window that check_reply uses
for the missing profile hint.
@jjohnson42
jjohnson42 merged commit 91f1010 into xcat2:master Aug 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants