feat: send x-machine-id header on OpenFrame TLS requests - #35
Open
mikhailm-coder wants to merge 1 commit into
Open
feat: send x-machine-id header on OpenFrame TLS requests#35mikhailm-coder wants to merge 1 commit into
mikhailm-coder wants to merge 1 commit into
Conversation
osqueryd now reads the machine id written by openframe-client to the shared OpenFrame data directory and sends it as the x-machine-id header on all TLS requests in openframe mode, matching orbit's behavior so requests pass the machine-id firewall. Co-Authored-By: Claude Fable 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.
Summary
In openframe mode, osqueryd's own TLS requests (enroll, config, distributed read/write, logger, carve) were blocked with a 403 by the gateway's new machine-id firewall because — unlike orbit — osqueryd never sent the
x-machine-idheader.OpenframeMachineIdProvider(openframe/): lazily reads the machine id written by openframe-client to the shared OpenFrame data dir (/Library/Application Support/OpenFrame/machine_idon macOS,/var/lib/openframe/machine_idon Linux,%ProgramData%\OpenFrame\machine_idon Windows) and caches it for the process lifetime; retries on every request until the file appears.TLSTransport::decorateRequestadds thex-machine-idheader next to the existing openframe Bearer token when--openframe-modeis on — one choke point covering all osquery TLS endpoints.openframe_machine_id_provider.goin the fleetmdm fork).Testing
Built for macOS arm64 and swapped into a live mmm-dev enrollment on a machine behind the active firewall:
OpenFrame machine id loaded from: /Library/Application Support/OpenFrame/machine_idCannot parse JSON: Invalid value. Offset: 0) back to Fleet's JSON-level response — i.e. requests now pass the firewall and reach Fleet, identical to pre-firewall behavior.🤖 Generated with Claude Code