Zeal security architecture -- 2026-10-13 implementation
======================================================

This replaces the earlier recommendation to move the backend to Ashburn. The
owner chose MS-02 for ALL central services. See CENTRAL-OPERATIONS.txt for live
URLs, staff use, enrollment, paths, rollback and remaining public-launch work.

Player -> Cloudflare HTTPS -> MS-02
  accounts/GUID proofs, friends, solo/duo parties, reservations, ratings,
  leaderboard, server registry/monitor, moderation/audit, website/downloads.
Player -> Psychz game UDP (two instances per host)
  authoritative game state, 4v4 rules, loadouts, teams, observed match results.
Player -> protected Psychz voice UDP forward -> encrypted tunnel -> MS-02 relay
  public 108.181.132.237:29901, restricted WireGuard route to the MS-02 relay.
Psychz bridges -> authenticated HTTPS -> MS-02 lobby/results origins
  per-instance credentials; no central database or staff credentials on hosts.

Implemented and deployed
-------------------------
* Signed GUID account proofs, single-use admission tickets and separate private
  party/session proof. Registration and actual authenticated game GUID must agree.
* Central instance registry, private enrollment output, separate hashed lobby/
  rating credentials, credential rotation/revocation and live pool discovery.
* Fresh game-presence monitoring, 5-second stale detection and active/drain/offline
  controls. Failed/unready instances do not receive new party reservations.
* HTTPS for public player/bridge APIs; loopback-only central listeners; verified
  private-CA TLS from Cloudflare to lobby/results origins. No LAN HTTP exception
  enabled. Separate read-only rating credential for lobby/leaderboard lookups.
* Rating service has a read-only mount/view of account/registry data, exclusive
  ownership of the rating DB, and transactional/idempotent settlements. New rated
  rosters must be reserved on that instance, registered, in the approved pool and
  preserve duos. Retries of an already accepted begin survive admission expiry.
* Limited service users and restricted write paths for game, bridge, lobby,
  ratings, account website and tunnel. No game access to central DB/configs.
  Wine specifically needs AF_NETLINK for unprivileged adapter enumeration.
* Central ranked suspensions, voice/social timeouts, kicks, player blocks/reports,
  owner/admin/moderator hierarchy, required reasons and an application audit.
  Dedicated-server kicks and relay mute/block routing enforce central decisions.
  The inherited in-game super-admin GUID no longer grants Ranked privileges.
* Request/body/worker limits, session and invitation budgets, bounded report
  frequency, same-origin browser checks, HttpOnly/Secure/SameSite cookies, CSRF,
  CSP, safe text rendering and no logging of browser capabilities or voice keys.
* Mandatory player components remain embedded in the installer. Website installer
  download uses HTTPS; the old plaintext HTTP base/DLC mirror was removed. SHA-256
  accompanies the installer, and complete corresponding native source is offered.
* Consistent pre-migration SQLite backups and old service/config/native snapshots.

Verified evidence
------------------
Backend tests cover forged/cross-instance admission, role hierarchy, revocation,
expiry, active-session bans, blocked requests/invites/code joins, relay blocks,
read-only result rejection, read-only registry writes, roster/pool/duo validation,
replayed settlement and HTTP origin/CSRF controls. The MS-02 venv ran the actual
SRTP tests. Real Windows native QA connected through the public HTTPS backend to
the test game/search lobby. A central voice timeout appeared in Voice Settings;
a central ranked suspension triggered the native server drop and client notice.
Browser QA exercised signup/report, staff monitor/drain, restriction/release,
report escaping, anonymous denial and desktop/mobile layout. Windows installer
workflow fixtures cover required components, DLC behavior, failures and cancel.
See docs/qa/central-20261013 for the final artifact hashes and exact test counts.

Public game hosts and remaining limits
-------------------------------------
Four instances run on the two Psychz hosts; their inventory, service isolation,
firewalls and restricted public voice path are documented in PSYCHZ-HOSTING.txt.
Game assets and code are root-owned; each game and bridge pair has separate
users and writable state. RCON is disabled. The WireGuard link allows only
voice UDP and cannot reach the home LAN or central SSH/HTTP/database services.
Only Zeal-01 forwards public voice, so its failure also interrupts voice for
Zeal-02 matches. Automatic voice gateway or central backend failover is absent.

Provider UDP DDoS protection is separate from a 1 Gbps port/commit and Cloudflare
HTTPS. Qualify full concurrent matches before adding a third game per host.
Heartbeat health is not proof of Internet reachability or frame-time headroom;
see the deployment QA report for the public connection tests and their limits.

A compromised game host can still lie about its assigned match's outcome. Scoped
credentials and reservation checks reduce its authority; they cannot attest an
honest game engine. A GUID proves possession of a key, not a unique human or an
unmodified client. A banned person can attempt a new identity. Staff GUID keys
need careful backups/protection; a stolen owner key is owner authority.

The relay is trusted and terminates SRTP; voice is not end-to-end encrypted
against its operator. No audio recording is implemented. Normal Cloudflare
website tunnels do not publish raw game/voice UDP to ordinary game clients.

Installer 1.26 downloads base/DLC packages only from zeal.family and checks SHA-256
pins embedded in the executable before any extraction, including local/browser
copies. Packages were built from an allowlist and matched to the working local
assets; this is not publisher attestation. The installer is not Authenticode-signed.
The separate static download service cannot read backend credentials/databases
or write its public files. See DOWNLOAD-HOSTING.txt and the downloads QA report.
Off-host encrypted
backup scheduling and disaster recovery on a second machine remain operational
work. Application audit records are not tamper-proof against a root/DB operator.

Sources consulted for the deployment boundary
----------------------------------------------
https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/configure-tunnels/origin-parameters/
https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/routing-to-tunnel/
https://developers.cloudflare.com/spectrum/get-started/
These explain originServerName/caPool verification and HTTP versus UDP hosting.
No provider or third party was contacted on the owner's behalf.
