Add active_terminal_timeout and hard_timeout to session controller#128
Merged
Conversation
Two new timeout axes, both configured via env vars and disabled by default (unbounded): - TUNNEL_CONTROLLER_ACTIVE_TERMINAL_TIMEOUT: caps active SSH/TTY/RD sessions from creation time, regardless of activity. Prevents the proxy idle timeout from killing a session mid-task when the user switches browser tabs. - TUNNEL_CONTROLLER_HARD_TIMEOUT: absolute session lifetime from creation, not reset by reconnects. Closes the loophole where a session persists indefinitely by reconnecting within the idle window. Existing env vars are unchanged: - TUNNEL_CONTROLLER_IDLE_TIMEOUT (default 300s) - TUNNEL_CONTROLLER_AWAKE_INTERVAL (default 30s)
active_terminal_timeout and hard_timeout to session controller
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
Adds two new timeout axes to
TimeoutController, closing two gaps in the current session expiry model:TUNNEL_CONTROLLER_ACTIVE_TERMINAL_TIMEOUT— caps how long an active SSH/TTY/RD session can run from creation, regardless of user activity. Without this, a session with a connected terminal ran indefinitely. Also addresses the tab-switching false-idle problem: while a terminal is connected the idle clock is suspended entirely, and this new timeout provides the upper bound instead.TUNNEL_CONTROLLER_HARD_TIMEOUT— absolute session lifetime from creation, not reset by reconnects. Without this, a session could persist indefinitely by reconnecting within the idle window.Both default to unset (unbounded), so existing deployments are unaffected until the values are configured.
Environment variables
TUNNEL_CONTROLLER_IDLE_TIMEOUT300TUNNEL_CONTROLLER_ACTIVE_TERMINAL_TIMEOUTTUNNEL_CONTROLLER_HARD_TIMEOUTTUNNEL_CONTROLLER_AWAKE_INTERVAL30Expiry logic per tunnel type
hard_timeoutfrom creationidle_timeoutfrom last access ·hard_timeoutfrom creationactive_terminal_timeoutfrom creation ·hard_timeoutfrom creationidle_timeoutfrom last access ·hard_timeoutfrom creationactive_terminal_timeoutfrom creation ·hard_timeoutfrom creationidle_timeoutfrom last access ·hard_timeoutfrom creationactive_terminal_timeoutfrom creation ·hard_timeoutfrom creationidle_timeoutfrom last access ·hard_timeoutfrom creationChanges
Single file changed:
wallguard-server/src/tunneling/timeout_controller.rsOut of scope
Idleintermediate state — requires changes in the proxy layer outside the controller.