Skip to content

Remote session lifetime (#648) refuses HALT too: a keel serve --external-host console can't halt after 12h until restarted #983

Closed

Description

@eaitbrahim

Raised by the PR #977 security review (round 2). Decision needed from the owner; not changed in #977.

What changes when #977 lands

Before #977, serve() dropped external_hosts and started_at (#971), so the #648 remote session lifetime was never enforced. #977 restores it as designed: on a server started with --external-host, ServeConfig.session_expired_at = start + REMOTE_SESSION_MAX_AGE_SECONDS, and the admission check in keel/web/server.py refuses EVERY request after that with 403 "Session expired". That includes POST /api/gates/halt, and it includes loopback clients.

Why it matters

keel/web/gates.py: "stopping must never be slower than starting". A console left running past the lifetime shows the expired-session refusal instead of Pulse, so HALT is unreachable from the browser until someone restarts keel serve at a terminal (keel halt at the CLI still works).

Options

  1. Keep as is (the lifetime is the point of keel link prerequisite: the remote-exposure security pass — bind opt-in, tunnel Host validation, token issuance off loopback #648; a leaked token must not halt either), and say so on the refusal page ("use keel halt at a terminal").
  2. Exempt the halt route from the lifetime (still requiring the halt token): a leaked token could then halt, which is recoverable by keel resume, never release.
  3. Add a re-mint flow so a long-running remote console can renew without a restart.

Cost of leaving it: an operator using a tunnel can lose the browser HALT after 12 h without noticing until they need it.

Activity

  1. self-assigned this
    on Oct 12, 2026
  2. eaitbrahim commented on Oct 12, 2026

    @eaitbrahim
    ContributorAuthor

    Owner decision (2026-10-12): option 2. HALT is exempt from the remote session lifetime on keel serve --external-host, and still requires the halt token in X-Keel-Halt. Releases, setup writes and reads keep the 12 h lifetime. A leaked halt token can at worst halt, which keel resume at a terminal undoes. Folded into the #981/#982 PR.

  3. added 2 commits that reference this issue on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions