Skip to content
Gatehouse
Help pages

Administration

The everyday tasks of running Gatehouse, in the console and with the CLI.

The console is at https://gatehouse-admin.theleeorganization.com/console, for members of the administrators group on a compliant device. Steps that name a page, such as Approvals or Emergency controls, are in its menu. For using Gatehouse from Claude, read Using Gatehouse.

A change that grants access, or that only an administrator who has just signed in should make, asks you to Sign in again with Microsoft, then to Confirm the change within 5 minutes.

Approve or deny a request

Each approval shows the app, the person, the tool, the arguments, and the time left. An approval expires after the approval window (10 minutes unless you set 5 to 30 in Settings, Gateway) unless you decide it first.

  1. Open Approvals.
  2. Check that the request is the one the person made.
  3. Select Approve or Deny.

The Gatehouse app's Approvals tab and node cli/gatehouse.ts admin approvals decide the same approvals. An approval that is decided cannot be decided again. After you approve, ask the person to make the same request again within the approval window. It runs once.

See and remove an app's access

  1. Open Apps and the app, then its People tab; or open Accounts, the person, and their Apps tab.
  2. Select Remove access on the row, and confirm.

The app's access ends at once, and the log records it. To use the app again, the person signs in from it.

To end every person's access to one app, open the app and select Sign out everywhere.

Read sign-ins and activity

  1. Open Log, or an account's Activity tab for that account's events.
  2. Filter by event, such as authn. for sign-ins, by outcome or by time.

From a terminal: node cli/gatehouse.ts logs security.

Turn all requests, AI apps or scripts off or on

  1. Open Emergency controls.
  2. Under Kill switches, select Turn off on All requests, AI apps or Scripts.

It is off at once, and the notice offers Undo. While All requests is Off, every request through the gateway is refused; the console does not sign in through the gateway, so it can always turn it back on. To turn a switch back on, select Turn on, then Sign in again and Confirm the change.

Set a tool to Ask first, or turn it off

  1. Open Emergency controls.
  2. Under Tools, find the tool.
  3. Select Set to Ask first or Turn off.

This holds whatever the permissions say. Turning the tool back on, or from Off to Ask first, asks you to sign in again. To change what a group may do with a tool for good, change its permissions instead.

See everything that is off

Open Emergency controls. Under Off elsewhere are each disabled service, app or account, each paused log destination, each suppressed alert rule, and Gatehouse closed, each linked to where it is changed. The Overview's Off tile counts them with the kill switches and tools that are off.

Check health

Open Health. Under Services, each service shows its state (Healthy, Failing or Not checked), when it was last checked, and its failed checks in a row; Gatehouse checks every 5 minutes. Under Detection, Log delivery and Keys and certificates are how detection, the log's destinations and each key stand. A key that ends within 30 days shows Ending soon on the Overview.

Gatehouse sends no messages: check Health when requests fail, and Alerts, where a failing service is also an alert.

Respond to many refusals

Gatehouse sends no message about refusals. A spike in refusals is an alert (Alerts); to look at each one, read the log.

  1. Open Log, and filter by outcome Failure.
  2. Find the refused requests and sign-ins, and note their app and account.
  3. To stop them at once, turn off a kill switch, as in Turn all requests, AI apps or scripts off or on.
  4. Remove the app's access, as in See and remove an app's access.

Disable or enable an account

Disabling a person or a machine refuses their next call at once, ends all their app access, and signs them out of Microsoft Entra in Gatehouse. You cannot disable yourself.

  1. Open Accounts and the account.
  2. Select Disable, and confirm.

To let them in again, select Enable, then Sign in again and Confirm the change. Their old app access stays ended: they sign in again.

Sign someone out everywhere

  1. Open Accounts and the person.
  2. Select Sign out everywhere, and confirm.

All their app access ends at once, and their apps ask them to sign in again.

Sign out everything

This ends all app access of every person, yours included, every person's connections, and the tool listing of every service. Reconnect each service's tool listing afterwards (see MCP servers), or its tools are not refreshed.

  1. Open Emergency controls.
  2. Select Sign out everything, confirm, then Sign in again and Confirm the change.

Sign out of the console

Open the account menu at the top of any page and select Sign out.

Run a script

Scripts use the Gatehouse CLI, which needs Node 20 or later. Each run signs in through the browser.

  1. Open a terminal in a copy of the Gatehouse repository.
  2. Run a request in this form:

    node cli/gatehouse.ts <app> <METHOD> <path> [--data <json>]

    Replace <app> with sonarr for Sonarr, radarr for Radarr, or sabnzbd for SABnzbd.

    For example:

    node cli/gatehouse.ts sonarr GET /api/v3/series

The result is JSON on standard output. A refusal goes to standard error and exits with code 1. A request that is not on the Script API's list is refused with 403 and recorded.

To move series or movies to another root folder:

node cli/gatehouse.ts sonarr move <id> --to <root folder>
node cli/gatehouse.ts radarr move <id> --to <root folder>

Run the disable check

The disable check proves, on the live Gatehouse, that disabling an account refuses its next call and that enabling it lets it in again. It uses the test machine gatehouse-e2e. The machine holds no admin right: you run the disable and the enable with your own sign-in.

  1. In GitHub, open the leeorg-gatehouse repository's Actions tab.
  2. Select the e2e workflow.
  3. Select Run workflow, keep cycle, and select Run workflow again.
  4. Wait until the run's log shows ok 1. served.
  5. In a terminal in a copy of the repository, run node cli/gatehouse.ts admin e2e disable-check.
  6. Check that the command ends with disable check passed, and the workflow run with ok 4. served.

The command waits for each record to reach the log, up to 20 minutes, by the server's clock. If anything stops it after the disable, it enables gatehouse-e2e again and says so.

The first time, run the workflow with self instead of cycle to make the machine's account, then run the check. The command finds gatehouse-e2e by its Microsoft Entra object ID, which it holds; --subject names another.

Run the SSRF check

The SSRF check proves that Gatehouse refuses an MCP server on a private address. It writes nothing: both writes are refused.

  1. Run node cli/gatehouse.ts admin e2e ssrf-check.
  2. Check that it ends with ssrf check passed.

Run the alerts check

The alerts check proves that Gatehouse's detection saw the live checks: the disabled machine's refused calls (MCH-03, not raised), the SSRF check's refused changes (ADM-05, not raised), and a change to the probe's tools (MCP-01, raised), and that no disable went unenforced (IDN-10). It resolves each alert it raised with the reason Test, so tests stay out of the figures. See Alerts.

  1. Run the disable check and the SSRF check, and change the probe's tools (set the probe to its variant b, then refresh the probe's tools), noting the time you began.
  2. Run node cli/gatehouse.ts admin e2e findings-check --since <the time you began>.
  3. Check that it ends with findings check passed.

Alerts appear within about 2 minutes; the command waits up to 5 minutes for each.

The probe's probe_set_variant tool changes the probe for everyone who uses it. Give the probe service only in the administrators' permissions, never in another group's.

Check that no record holds a credential

  1. Run node cli/gatehouse.ts logs security --since <the time to check from> | node tools/scan_tokens.ts.
  2. Check that it ends with 0 match(es). A match names the event and the field, never the value.

Sign out of the CLI

The CLI keeps your sign-ins in your Mac's keychain between commands. To forget them, run node cli/gatehouse.ts logout.

If every command opens a new sign-in, run node cli/gatehouse.ts keychain-check. It ends keychain check passed when the keychain keeps a sign-in whole.

Read the quarantine

The quarantine holds events the log could not take as they came, usually because a newer Gatehouse version wrote a reason the log does not know yet. They are kept, not lost, and the log takes them as soon as it knows the reason.

  1. Open Log, then Quarantine.
  2. Check that it says No quarantined events.

From a terminal: node cli/gatehouse.ts logs quarantine, and check that count is 0.

Close Gatehouse

Closing the gateway stops it answering anyone: every request gets 503 {"error": "closed"} before any sign-in, token, tool call or admin call. Its timers keep running: the log is sealed, verified and trimmed as on any other day, but nothing is sent to Sonarr, Radarr or SABnzbd. The console and admin API's Worker, gatehouse-admin, is never closed: it is how you watch Gatehouse and open it again, so terraform/closed.auto.tfvars does not list it. While Gatehouse is closed, Emergency controls lists it under Off elsewhere.

  1. In the Gatehouse repository, open terraform/closed.auto.tfvars.
  2. Change false to true for gatehouse.
  3. Open a pull request with that one-line change.
  4. Check that the plan replaces the version of gatehouse and sends all of its traffic to that version, and nothing else. A rollout hold in terraform/rollout.auto.tfvars does not apply while Gatehouse is closed; it applies again once it is open.
  5. Merge the pull request. The Terraform pipeline applies it and deploys the new version.
  6. Check that the gateway answers 503:

    curl -s -o /dev/null -w '%{http_code}\n' https://gatehouse.theleeorganization.com/.well-known/oauth-authorization-server

To open it again, set the value back to false the same way. App access made before the close works again when the gateway is open, unless it has expired.