Repository navigation
Conversation
Periphery's outbound websocket cannot pass an authenticating reverse proxy in front of Core, such as Cloudflare Access, which expects service token headers on the upgrade request. - Add `core_headers_file` (PERIPHERY_CORE_HEADERS_FILE): a file of `Name: value` lines sent with the websocket request to Core. Blank lines and `#` comments are ignored; an empty env value is unset. - The file is re-read on every connection attempt, so rotated values apply on reconnect. - Periphery refuses to start if the file is missing, invalid, not owned by its user, or accessible by group or others. - Values are marked sensitive and never included in errors or logs. Headers owned by the websocket handshake are rejected. - The transport's websocket connect takes extra headers; Core passes none. Verified end to end with a 2.3.3 Core behind a proxy that returns 403 unless the headers match: no file gets 403, a 644 file stops startup, a 600 file connects, a rotated wrong value fails on reconnect and the restored value reconnects without a restart, and no value is logged.
AzScep
added a commit
to AzScep/komodo
that referenced
this pull request
Sep 26, 2026
Adds the core_headers_file patch (moghtech#1649) to PATCHES.md and bumps FORK_REVISION so the image publishes as 2.3.3-azscep.2.
This branch has not been deployed
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
In outbound mode Periphery opens a websocket to Core, but it has no way to add headers to that request. So it can't get through an authenticating reverse proxy in front of Core. For example, with Cloudflare Access protecting the whole Core hostname, a client has to send
CF-Access-Client-IdandCF-Access-Client-Secretservice token headers. Today the only option is a bypass rule for/ws/periphery.Change
core_headers_file(PERIPHERY_CORE_HEADERS_FILE). It points to a file with oneName: valueheader per line, which is added to the websocket upgrade request. Blank lines and#comments are ignored. An empty env value counts as unset.chmod 600).Host,Connection,Upgrade,Sec-WebSocket-*and so on) are rejected.TungsteniteWebsocket::connect*inlib/transportnow takes an extraHeaderMap. Core passes an empty one, so its behaviour doesn't change.config/periphery.config.toml.This keeps the header values out of the main config and env. Only the file path goes there, and it shows up in the sanitized startup config.
Verification
connection::headers::testscover parsing, values never showing up in errors orDebugoutput, and the mode and owner checks.cargo fmt --checkpasses and clippy is clean forkomodo_periphery,transportandkomodo_core.644: Periphery exits at startup with an error telling you tochmod 600600: Periphery logs in to Core through the proxy馃 Generated with Claude Code