Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/codeql-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"paths": [
"tools/wp826.mjs"
],
"reason": "The WP826 serves a self-signed certificate it cannot be told to replace, so chain validation can never succeed and rejectUnauthorized must stay false to reach the device at all. Trust is established instead by PINNING: verifyPin() compares the certificate's SHA-256 against WP826_CERT_SHA256 before login() sends the password, and exits non-zero on a mismatch (the same pin guards the production health monitor). The rule still fires because the flag itself is unavoidable; the risk it describes is mitigated."
"reason": "The WP826 serves a self-signed certificate it cannot be told to replace, so chain validation can never succeed and rejectUnauthorized must stay false to reach the device at all. Trust is established instead by PINNING: since v0.125.0 pinnedSocket() compares the certificate's SHA-256 against WP826_CERT_SHA256 on every connection before that connection carries a request, the login included, and refuses on a mismatch; verifyPin() also checks once up front (the same pin guards the production health monitor). The rule still fires because the flag itself is unavoidable; the risk it describes is mitigated."
},
{
"rule": "py/weak-sensitive-data-hashing",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ doesn't stop when it has queued a call; it records what actually happened.
- **SSH console (`2300`):** password-only, checked against `console_users`. It
refuses every login until a user is configured, and also refuses exec, SFTP
and port forwarding.
- **Browser terminal (`8100`):** defaults to `127.0.0.1` and has no login until
`console_users` has an entry, so configure one before you move its bind.
- **Browser terminal (`8100`):** defaults to `127.0.0.1`, and starts only once
`console_users` has an entry, which it then asks for.
- **Change the default room secrets before your phones register.**

The threat model, the toll-fraud defences, the accepted LAN-local risks and the
Expand Down
8 changes: 8 additions & 0 deletions switchboard/CHANGELOG-ARCHIVE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
Earlier Switchboard releases, newest first. The most recent ones are in
[CHANGELOG.md](CHANGELOG.md).

## 0.114.2

**A way back from the console to the dashboard.**

- The dashboard's Console button replaced the page with the terminal, and nothing
on the terminal led back. Its nameplate now carries a "← Dashboard" link when it
is the dashboard's own console; the standalone terminal on its own port, which
has no dashboard behind it, does not show one.
## 0.114.1

**The dashboard keeps the wake-up time you entered.**
Expand Down
44 changes: 34 additions & 10 deletions switchboard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
# Changelog

Recent releases. Releases up to 0.114.1 are in the
Recent releases. Releases up to 0.114.2 are in the
[changelog archive](https://github.com/tesseractAZ/Switchboard/blob/main/switchboard/CHANGELOG-ARCHIVE.md).

## 0.125.0

**Fixes found by a documentation review.**

- **Lights menu (`43`): rooms and lights that could not be chosen by name now
can be.** Lights with no area are read out as "Unassigned", but saying it
ended the call, because that area's internal name was also the menu's signal
for "cancel". A room or light whose name holds or sounds like a command word
("Top Floor" is close to "stop"; "Exit Sign", "All Lights") could not be
chosen either, because the command words were checked first. Saying a whole
name now chooses it; a command word on its own still cancels or lists, unless
something is named exactly that word. An area actually named "Unassigned" now
takes the lights with no area (except one named like a light already in it),
instead of standing beside a second "Unassigned" that could not be told apart. The
goodbyes also say what happened: a cancel at the light step was answered as
a mishearing, and two mishearings at the on/off step as a cancel.
- **The standalone web terminal (`:8100`) starts only with a login.** With
`console_users` empty it used to run on `127.0.0.1:8100` with no login. Under
host networking that address is the host's own, so every program on the host
and every other host-network add-on could drive the operator console through
it. It now stays off until `console_users` has a valid entry, and the start-up
log says why. The operator console in the add-on's panel in Home Assistant is
not affected; it is signed in by Home Assistant.
- **`tools/wp826.mjs` checks the handset's certificate on every connection.**
With `WP826_CERT_SHA256` set, it compared the pin once on a separate
connection, then sent the login, password included, on new connections it
did not check. Each request now runs on a connection whose certificate was
checked first, and a mismatch stops the command before that request is sent,
naming it. Its `fingerprint` command, the documented way to get the pin, no
longer needs a password file, and `WP826_PORT` sets a port other than 443 (a
value that is not a port number is refused). The tool is not part of the
add-on image.

## 0.124.0

**No feature code or room can take the place of the emergency notice.**
Expand Down Expand Up @@ -399,12 +432,3 @@ Recent releases. Releases up to 0.114.1 are in the
pages and an index). README and SECURITY links point there, the Word and PDF
manual is built from the guide plus every reference page, and tests keep the
guide under 32 KiB and fail on any dead link or anchor.

## 0.114.2

**A way back from the console to the dashboard.**

- The dashboard's Console button replaced the page with the terminal, and nothing
on the terminal led back. Its nameplate now carries a "← Dashboard" link when it
is the dashboard's own console; the standalone terminal on its own port, which
has no dashboard behind it, does not show one.
5 changes: 3 additions & 2 deletions switchboard/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ There are three ways in:
`-o WarnWeakCrypto=no-pq-kex` silences it.
- **Standalone web terminal (port 8100).** Bound to `127.0.0.1` by default, so it
answers only on the Home Assistant host itself; it is a fallback for the
sidebar console.
sidebar console. Since 0.125.0 it starts only when `console_users` has an
entry, and asks for that sign-in.

Keys: **↑↓** / **j k** move · **R** ring · **C** connect · **H** hang up ·
**T** transfer · **W** set wake-up · **X** cancel wake-up · **M**
Expand Down Expand Up @@ -402,7 +403,7 @@ the options people change most often; all of them, with their limits, are in the
| `announce_token` | `""` | Shared secret for `POST /api/announce` from the LAN. Blank: only the Supervisor can call it. |
| `announce_retry_attempts` | `2` | How many times a handset announcement that never played is sent again (0–3; `0` turns it off). |
| `assistant_enabled` | `false` | The local voice assistant on `47`. |
| `console_users` | `[]` | Accounts (`username`, `password`) for the SSH console and the standalone web terminal. SSH refuses every login while it is empty. |
| `console_users` | `[]` | Accounts (`username`, `password`) for the SSH console and the standalone web terminal. While it is empty, SSH refuses every login and the standalone web terminal does not start. |
| `console_bind` | `0.0.0.0` | The interface the SSH console listens on; `127.0.0.1` keeps it on the Home Assistant host. An upgraded install keeps the value it had saved. |
| `console_web_bind` | `127.0.0.1` | The interface the standalone web terminal (port 8100) listens on. |
| `log_level` | `info` | How much of Asterisk reaches the Log tab. `info` includes the dialplan trace, dialled numbers among it; `notice`, `warning`, `error` and `critical` leave the trace out; `debug` adds trunk detail for diagnosis. |
Expand Down
2 changes: 1 addition & 1 deletion switchboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ LABEL \
org.opencontainers.image.title="Switchboard" \
org.opencontainers.image.description="Asterisk PBX for analog home phones" \
org.opencontainers.image.source="https://github.com/tesseractAZ/Switchboard" \
io.hass.version="0.124.0"
io.hass.version="0.125.0"
65 changes: 36 additions & 29 deletions switchboard/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ these defenses are generated automatically:

These are deliberate design choices, documented here so you can decide whether they
fit your network. Where the add-on can flag one at start-up it does — the web
terminal logs its bind, escalating from INFO to a NOTICE only when it is actually
reachable from the LAN without a login; the SSH console logs its bind, its host-key
terminal logs a NOTICE when it does not start for want of a valid
`console_users` entry, and its bind when it does; the SSH console logs its bind, its host-key
fingerprint and how many console users can log in, with a WARNING when none can;
and a blank `cordless_cert_sha256` prints a NOTE — but the
AppArmor and developer-tool items are structural and emit no start-up line, so
Expand All @@ -631,7 +631,10 @@ standalone web terminal and the Ingress console. Each one guards its own door.
The telnet listener on `:2300`, which had no login, is gone, and that port now
speaks SSH. That is also why the board and the Home Assistant broker listen on
Unix sockets rather than loopback ports: under `host_network`, `127.0.0.1` is
shared with every host-network add-on and process on the machine.
shared with every host-network add-on and process on the machine. For the same
reason, since v0.125.0 the standalone web terminal (`:8100`) starts only when
`console_users` has a valid entry: before, with the shipped defaults it ran on
`127.0.0.1:8100` with no login, so any of those could drive the board through it.

All three can ring, connect, hang up, transfer, page, set message-waiting, and
control lights. Each caps its own sessions (the web terminal 5, the Ingress
Expand All @@ -644,8 +647,9 @@ every SSH login needs a password:
- **Password login only**, against `console_users`, read by the web terminal's own
parser. There is no public-key, keyboard-interactive, host-based or GSSAPI
login, and no anonymous or default account. While `console_users` has no valid
row, **every login is refused**. That includes a value that fails to parse, so
SSH fails closed where the web terminal fails open.
row, **every login is refused**. That includes a value that fails to parse.
Since v0.125.0 the web terminal fails closed the same way: without a valid
row it does not start.
- **A per-address throttle, charged before the password is checked**: 5 attempts
per address in any 300 s. It is the web terminal's rule, with a separate count.
A connection also gets at most 3 password attempts.
Expand Down Expand Up @@ -676,21 +680,19 @@ every SSH login needs a password:
also means `127.0.0.1`: it no longer falls back to `console_bind`, which is now
the SSH bind and defaults to every interface. An upgrade keeps whatever bind is
already stored in its options. Loopback here is the **host's** loopback, so on
the default bind any host-network add-on or process can open an ungated `:8100`
and drive the board. The terminal's same-origin WebSocket gate blocks cross-site
drive-by hijacking, but anyone who can reach the port from a same-origin context
can drive the board.

The **web terminal supports a login**: configure `console_users` (username +
masked password) and both its page and its WebSocket require a signed-in session,
with per-address throttling of failed attempts. With an empty `console_users`
the web terminal has no login at all — **and so it is with a `console_users`
value that fails to parse, or whose rows are missing a username or a password**:
those rows are dropped, and a list left with no valid rows disables the gate
entirely. The start-up log line reports which mode is actually live
(`login gate ACTIVE (n user(s))` vs `no login gate`); trust that line over the
options page. **This is the only login-free network path to the board left**:
the web terminal with an empty `console_users`, moved off loopback.
the default bind any host-network add-on or process can reach `:8100`; since
v0.125.0 what it reaches always asks for a sign-in. The terminal's same-origin
WebSocket gate also blocks cross-site drive-by hijacking of a signed-in session.

**The web terminal requires a login**: both its page and its WebSocket require a
session signed in against `console_users` (username + masked password), with
per-address throttling of failed attempts. Since v0.125.0 it does not start
without a valid row: an empty `console_users`, a value that fails to parse, and
a list whose rows all miss a username or a password (such rows are dropped) each
leave it idle, with a NOTICE saying so in the start-up log. Before, each of
those ran it with no login at all. When it does start, the log line reads
`login gate ACTIVE (n user(s))`. **No login-free network path to the board
remains.**

**Prefer the Ingress console.** Since v0.93.0 the same terminal is served at
`/console/` on the Ingress port, where Home Assistant's own session authenticates
Expand All @@ -707,8 +709,9 @@ exact-match allowlist of two filenames (no directory serving, no path joining on
the parameter), which is the surface that keeps that trade acceptable.

**Mitigations you control:** `console_bind: 127.0.0.1` keeps SSH on the Home
Assistant host. `console_web_bind` stays on loopback unless you change it; if you
do put the `:8100` terminal on the LAN, configure `console_users` first.
Assistant host. `console_web_bind` stays on loopback unless you change it; the
`:8100` terminal starts only with a `console_users` entry, so wherever it listens
it asks for that sign-in.

`console_enabled: false` stops only the SSH service, and `console_web_enabled:
false` only the standalone terminal; neither alone affects the Ingress console.
Expand Down Expand Up @@ -817,8 +820,10 @@ Set **`cordless_cert_sha256`** (obtain it with `WP826_HOST=<cordless-ip> node to
and the device-health monitor verifies the exact certificate **before**
transmitting the admin password, refusing to continue on a mismatch. The
maintenance tool does not read add-on options: it takes the same fingerprint
from the `WP826_CERT_SHA256` environment variable, checks it before logging in,
and exits on a mismatch. Left blank (or, for the tool, unset), the connection
from the `WP826_CERT_SHA256` environment variable and, since v0.125.0, checks it
on every connection before that connection carries a request, the login
included, refusing on a mismatch. (Before, it checked once on a separate
connection and then sent the login on new connections nobody checked.) Left blank (or, for the tool, unset), the connection
still works but is unauthenticated (the tool prints a warning): a LAN-positioned
attacker could impersonate the handset and capture that password.

Expand All @@ -828,8 +833,9 @@ attacker could impersonate the handset and capture that password.
that administers a Grandstream WP826 cordless over its HTTPS API. The phone presents
a self-signed certificate with no validatable chain, so the tool sets
`rejectUnauthorized: false`, compares the certificate's SHA-256 against
`WP826_CERT_SHA256` before it logs in (warning and proceeding unverified when
that is unset), and reads its admin password from a local file. This is
`WP826_CERT_SHA256` on every connection before a request goes out on it
(warning and proceeding unverified when that is unset), and reads its admin
password from a local file, only when a command logs in. This is
an accepted LAN-local risk for a personal device-admin tool and is not part of the
add-on's request path. (CodeQL flags each of the tool's `rejectUnauthorized: false`
settings. The rule `js/disabling-certificate-validation` is listed for
Expand All @@ -844,9 +850,10 @@ where they remain listed among the closed alerts.)
1. **Change the default room secrets** (`change-me-101`, `change-me-102`, …) before
your phones register. Use a strong, unique `secret` per room; the validator
rejects `;`, whitespace, and control characters.
2. **A `console_users` entry, to use the SSH console.** With none, every SSH
login is refused. The same entries gate the web terminal, which defaults to
`127.0.0.1` (`console_web_bind`); configure one before you move that bind. An
2. **A `console_users` entry, to use the SSH console or the standalone web
terminal.** With none, every SSH login is refused and the web terminal does
not start; with one, both ask for it. The web terminal defaults to
`127.0.0.1` (`console_web_bind`). An
upgraded install keeps its stored binds, so check them: a `console_bind` of
`127.0.0.1` keeps SSH on the Home Assistant host.
3. **To allow LAN-triggered announcements**, set a non-empty `announce_token`;
Expand Down
2 changes: 1 addition & 1 deletion switchboard/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Switchboard
version: "0.124.0"
version: "0.125.0"
slug: switchboard
description: >-
Instrumented Asterisk 20 PBX for analog house phones on a Grandstream GXW4216
Expand Down
Loading