Skip to content
Gatehouse
Help pages

Security model

Who can sign in to Gatehouse, what each kind of app may do, how long a sign-in lasts, and what is kept.

Gatehouse holds the credentials for every service behind it, so no app or device holds one. It removes any credential an app sends and adds its own. Only 3 apps may sign in through Gatehouse's OAuth: Claude, Claude Code and the Gatehouse CLI. Open registration is off. The console and the Gatehouse app sign in with Microsoft Entra ID through Cloudflare Access instead.

Sign-in

WhoHow they sign in
An administrator, in the console, the Gatehouse app or the CLI's admin commandsCloudflare Access on gatehouse-admin.theleeorganization.com, for a member of the Gatehouse administrators group on a managed device, then a Microsoft Entra ID token for Gatehouse's admin scope, checked by the Worker. Admission is for a member of the group the settings name as administrators. Not Gatehouse's OAuth
A member, in the CLI's script commandsMicrosoft Entra ID, for a member of the Gatehouse users or administrators group. Gatehouse then issues a token to the CLI
A member's AI apps (Claude, Claude Code)Gatehouse's OAuth after the member signs in with Microsoft Entra ID
A machine, on Gatehouse's machine addressMicrosoft Entra ID as a workload identity with Gatehouse's service role. Gatehouse issues it no token
Gatehouse, when it reaches a serviceIts own credentials: a Cloudflare Access service token for the media apps, an API key for each of Sonarr, Radarr and SABnzbd, and whatever credential the settings name for any other service

How long a sign-in lasts

AppLongestEnds when unused for
AI apps (Claude, Claude Code)30 days7 days
Scripts (the Gatehouse CLI)15 minutes, never renewedNone
The console12 hours15 minutes

The pages at https://gatehouse.theleeorganization.com (Connections, Apps and the consent page) keep a sign-in of their own: it ends after 60 minutes unused or 24 hours in all, and Sign out ends it at once. Signing out of Gatehouse leaves the Microsoft sign-in as it is, so the other Microsoft apps on the device stay signed in; to end that too, sign out at Microsoft.

An AI app's access is renewed every 15 minutes while it is used. Each renewal asks Microsoft Entra ID again, so an account disabled or removed from the Gatehouse groups in Entra stops working at its next renewal. Disabling someone in Gatehouse, or signing them out, stops them at once.

Roles

A person's role comes from their Microsoft Entra ID groups at sign-in: administrator for a member of the group the settings name as administrators, user for anyone else the settings let in. No role is stored for a person. What an app may do is set by its kind and the settings, within limits in code, and the emergency controls can only take access away.

RoleMay
Administrator (the console, the Gatehouse app, the CLI's admin commands)Use the admin API: list and remove app access, approve or deny, set the emergency controls, read health, read and change the settings and service keys. Read the log through the log API. Through its own admin Worker it can turn the gateway off and back on, because it does not sign in through the gateway
Scripts (the Gatehouse CLI)Use the Script API: the listed reads and commands for Sonarr, Radarr and SABnzbd. Up to each service's hourly limit (600 unless set) for each app access
AI apps (Claude, Claude Code)Use tools set to Allowed. A tool set to Ask first waits for approval; a tool set to Never is not offered. Up to the permissions' hourly limit (600 unless set) for each app access

Gatehouse itself holds one more kind of connection: the tool listing of each service where each person signs in. An administrator makes it in the console after a fresh sign-in, it is kept encrypted like a person's connection, and it can only list the service's tools: any other request through it is refused before it leaves Gatehouse. No person's request uses it. Sign out everything ends it.

An AI app is refused on /api, and cannot reach the admin API, which is behind Cloudflare Access on its own address. Every response has the headers cache-control: no-store, x-content-type-options: nosniff and x-robots-tag: noindex, and Gatehouse's pages refuse to be shown in a frame.

What is recorded

Every request, sign-in, approval, admin request and change is recorded in Gatehouse's log, which is kept apart from the Workers that write it: they can only add to it. Every 5 minutes the log is sealed into an archive that refuses a delete or overwrite until its retention ends, with a signed, chained digest, and every hour it is verified. No role can delete or change a record. Administrators read the log they are recorded in; whoever can deploy the log Worker can read its signing key.

No record holds a credential or a request's result. A request record holds a fingerprint of the arguments, not the arguments; an approval holds a summary of up to the first 120 characters of them (see Architecture). An approval's code is never in the log.

What is kept about a person, for 548 days:

  • Their Microsoft Entra ID object ID, name and email address, in the security stream.
  • The IP address and agent string of each request and sign-in.
  • The name of the app that acted for them.