Hosted console authentication (#237)¶
For the routine operation of a running console (timers, monthly checks, rotation and incidents), see running a hosted console day to day.
Browser user administration¶
Hosted administrators can open Users (/admin/users) to inspect browser
accounts and account audit history. Creation, role/host grant changes,
disable/re-enable, invitation reissue, factor reset, deletion and confirmed
supporter recognition require a two-factor login within five minutes. Viewer,
operator and submitter roles cannot enter these pages or their direct API routes.
New accounts receive a random password and first-enrollment invitation, displayed only in the operation response. Deliver both privately to the verified owner. The user still verifies their email and enrolls an authenticator. Submitters need an explicitly admitted existing authority/project/principal; the administrator must confirm that mapping. The browser cannot silently rebind an existing account to another principal. Use the trusted authority’s operator procedure for that.
Grant changes invalidate verification and enrollment and issue a fresh invitation. Disabling an account revokes sessions and pending authentication but preserves its verified email and enrolled factor for re-enabling. Old sessions remain revoked after re-enabling. Browser account holds do not revoke gateway machine keys: manage them explicitly in the Machine keys section under each linked account on Users, or revoke principal admission when that scope is intended. Existing calculations continue to run.
Administrators see device labels, key IDs, scopes, expiry, last use and revocation state for each account’s explicit project/principal link. This includes external staff bindings configured for My machines. No link is inferred from the email. Accounts sharing one submission identity share its keys and calculations; the page displays that identity before revocation. The same administrator may revoke their own device key without changing their browser account.
Revoke machine key requires recent MFA, same Origin, the current account revision and explicit confirmation. The authority checks the key’s actual owner again under the key-store lock. Revocation denies the key’s next API request; it preserves browser login/factors, other keys and accepted jobs. It never issues, reveals, rotates or extends a key. Removing principal admission or browser login access does not prevent an administrator from revoking its linked keys. An unavailable key inventory is labelled as unavailable; unrelated browser account controls remain usable. Retired/unlinked credentials still require the trusted authority’s CLI rather than guessing a new browser owner.
The signed-in administrator cannot delete or change their own account here;
use a second administrator or the local recovery procedure. Concurrent browser
edits require a fresh account revision, and cooperating browser/CLI account
writers share a lock. Listing and audit views contain no password hashes,
passwords, invitation tokens, TOTP secrets or recovery codes. The equivalent
/admin/api/users endpoint accepts the same form fields as the page, with the
same admin, recent-MFA and Origin requirements.
My machines provides per-machine API keys for accounts with an explicit submission identity and authority policy. The computer uses the HTTPS gateway and never receives browser passwords, authenticator seeds or target SSH credentials. A key does not make an unqualified execution target eligible.
The console uses locally served Vibyverse typography and branding. The theme button initially follows the system preference and remembers light or dark appearance in the browser without storing account data.
Upgrade to supporter opens the account’s support page with Ko-fi and, when
configured, GitHub Sponsors. Set VQ_WEB_GITHUB_SPONSORS_URL to the verified
https://github.com/sponsors/ACCOUNT destination in the supervisor. Without a
configured destination, GitHub Sponsors is labelled as coming soon.
After confirming a contribution, an operator can assign recognition on the trusted authority using the console’s external account configuration:
vq web user supporter person@example.org --provider ko-fi
vq web user supporter person@example.org --provider github
vq web user supporter person@example.org --revoke
The badge is cosmetic. It grants no queue priority, resource entitlement, job visibility or administrative privileges. Recognition is private to the account’s workspace, audited, and bound to its current account record; replacing that record requires reconfirming recognition. A link click or browser-supplied payment status does not verify a contribution.
Implemented in source: hosted MFA, My calculations and host-scoped staff monitoring and controls. Submitters see only their linked principal’s gateway jobs. Hosted viewers and operators need explicit queue-host grants; only admins have global fleet access. Target execution isolation is separate #236 work. An HTTPS deployment has passed external browser checks with generated TOTP codes. The maintainer has confirmed a successful external login with a phone authenticator.
Single sign-on through an identity provider (#264)¶
An operator can offer Sign in with … on the hosted login page. It uses an OpenID Connect provider already configured for the gateway’s external applications, for example a research portal.
Signing in at the provider replaces only the password:
The console sends the browser to the provider (authorization code + PKCE, with the
max_ageof the provider entry) and verifies the returned ID token server-to-server.An explicit
[[web.sso_accounts]]entry maps that issuer and subject to an existing console account. Email addresses, names and domains are never used. An unmapped identity is refused, and no account is created.The console then asks for the account’s own authenticator code, exactly as after a password. Email verification, an enrolled factor, rate limits, the current account record and a disabled flag apply unchanged.
The password form stays available. A provider outage or a configuration error hides only the single sign-on button.
[web]
sso_provider = "portal" # a [gateway.identity_providers] entry
sso_redirect_uri = "https://console.example/fleet/login/sso/callback"
sso_label = "Example Portal"
[[web.sso_accounts]]
issuer = "https://id.example"
subject = "<opaque sub from the provider>"
account = "person@example.org" # an existing console account
Registration. Register
sso_redirect_uriexactly at the provider, in addition to the gateway’s own callback. The provider entry’sclient_idand optionalclient_secret_fileare shared with the gateway connection flow.Cookies and state. The console keeps pending sign-ins in its private authentication database: single use, ten minutes at most, bound to the starting browser by a path-scoped
HttpOnly; Secure; SameSite=Laxcookie.Audit. The audit records
login-ssooutcomes without tokens or claims.Not included. Trusting the provider’s MFA instead of the local authenticator, and creating accounts at first sign-in, are not supported.
Self-service signup (#257)¶
Signup is off unless the console supervisor sets VQ_WEB_SIGNUP=open. Any
other value keeps it closed. It needs working verification mail (see below):
the security checks fail while signup is open without it.
What an applicant does. No account yet? Request access on the sign-in
page opens /fleet/signup. The applicant gives an email address, chooses a
password of at least 12 characters and may add a short note on what they need.
A one-use code goes to that address; entering it confirms the request. The code
expires after 20 minutes and allows five attempts. Confirming does not create
an account or grant anything: the request now waits for an administrator.
What an administrator does. Access requests (/admin/signups, or
GET /admin/api/signups) lists each confirmed request with its note. Approving
or rejecting needs a two-factor sign-in within five minutes, a ticked
confirmation and the request’s current revision, so a second administrator, or
a stale page, gets “already decided”.
Approve with an explicit role: viewer or operator with the queue hosts they may read and control, or submitter with an already admitted authority/project/principal, exactly as for Users. Administrator rights are never granted here; change the role later on Users if needed. The account is created with the applicant’s own password and their proven mailbox, and the one-use enrollment invitation is emailed to them. If that mail fails, the page shows the invitation once so you can pass it on another way.
Reject. The password hash and note are deleted at once, and the address cannot request again for 30 days. Tick Tell the applicant by email to send a fixed message saying the request was not approved and when they may ask again. It contains no reasons and no words from the administrator. Without the tick, no message is sent.
The approved applicant then opens Set up your authenticator, enters their email address, the password they chose and the invitation, and adds an authenticator. Only then can they sign in. Approval does not qualify an execution target; a submitter’s calculations still run only where the gateway policy already admits that principal.
What an outsider learns. Nothing about who has an account. Every request
gets the same answer whether the address is new, has an account, is waiting,
or was rejected, and only addresses that may apply receive a code. A failed
code mail is recorded in the operations audit as signup-mail-failed instead
of changing the answer. Requests share the sign-in rate limits, at most 200
requests may be open at once, and an unconfirmed address is not mailed again
within a minute.
Retention. An unconfirmed request is deleted after 24 hours. A confirmed
request that nobody decides expires after 30 days, with a signup-expire
audit record. A rejection is kept for 30 days without its password hash or
note. Console backups leave requests out. The operations audit records
signup-request, admin-signup-approve and admin-signup-reject.
Verify the hosted account email¶
Use an email address as the hosted username. With your account password, request
a code at Verify your email address on the sign-in page (/fleet/login/email).
Enter the code from that mailbox on the same page. It expires after 20 minutes;
a resend replaces it. Verification does not sign you in or replace your TOTP
or recovery codes. Existing enrolled users verify before their next hosted login
unless the operator has already confirmed ownership during migration. Replacing
the account record invalidates its verification. Gateway principals are unchanged.
Set VQ_WEB_EMAIL_FROM to the site’s sending mailbox in the console supervisor.
Set VQ_WEB_SITE_NAME to the name people know the service by, for example
Example Lab QC (#257). Every message the console sends then comes from
Example Lab QC <sender> with [Example Lab QC] before its subject. The
default is vibe-scheduler. A name longer than 60 characters, or one
containing <, >, ", [, ], \ or a control character, falls back to
the default; Setup overview shows which name is in use.
By default, the console uses the authority’s local SMTP relay on 127.0.0.1:25
without a password. Configure that relay to accept the console’s mail and to
deliver and sign outgoing messages for the domain. A workstation or permitted
cluster management node without a local relay can instead use the remote SMTP
settings below. Confirm mailbox provisioning, relay delivery and the domain’s
mail authentication with the site mail operator.
Sender authentication is operator setup. Publish SPF for the relay that
sends the console’s mail, sign it with DKIM, and set a DMARC policy for the
sending domain, so recipients’ providers accept it. Verify the sender address
with the relay or provider. None of this lives in vq; the console only needs
VQ_WEB_EMAIL_FROM and the relay settings. Test delivery to a disposable
mailbox before any live use.
Notifications and administrator messages (#259)¶
Preferences. Every account has Notifications (/account/notifications,
API /account/notifications/data). Service announcements (maintenance, outages,
news) are on by default and can be turned off. Security notices cannot: email
verification, access approvals, enrollment invitations, and administrator
messages marked as security notices. A preference belongs to the current
account record, so a replaced account starts from the default again. Saving
needs the current revision and is audited without other detail.
Job and storage notices. A submitter can also turn on job notices on the same page. They are off by default and only submitters can turn them on. Each one says that a calculation finished, failed, was cancelled or was lost, whether its results are ready, and links to it in My calculations. It carries no inputs, logs, paths or results, and its subject holds only the job ID.
Notices are sent by vq web notify, which the operator runs from a timer
every few minutes, as the console’s user with its environment
(VQ_WEB_HOSTED_ORIGIN and the mail settings). It sends queued security
notices first (see below), then job notices. vq web notify-jobs sends job
notices only.
vq web notify # or --json for the counts
It reads each opted-in submitter’s own jobs through the same ownership and
gateway-policy checks as My calculations, and contacts no target. A
submitter whose principal the policy no longer admits is skipped. The first
run after someone turns notices on records their already finished jobs
without mailing them; after that each newly finished job is mailed once. A
replaced account starts again from a new record. A notice the relay refused is
tried on later runs, up to three attempts; one whose outcome is unknown is never
sent again. At most 200 notices go out per run, and the rest follow on the next
run. The audit records a job-notices entry with counts only.
The same choice covers storage notices: one email when a submitter’s stored uploads and results pass 90% of their storage quota, and one when it is full. Use must fall below 80% before the level resets, so use that hovers around a threshold does not send repeated mail. The numbers are the ones on Usage & limits, read in the same pass. A quota of 0 sends nothing, because that is an administrator’s decision to deny new work. Delivery follows the same rules: refused notices are retried, unknown outcomes are not.
Security notices. These are always sent and cannot be turned off. The account holder gets one when:
a recovery code was used to sign in to their account;
their authenticator was replaced;
an administrator reset their authenticator, changed their role or host access, disabled or re-enabled their account, or revoked one of their machine keys.
The notice is recorded in the same step as the event and sent by the next
vq web notify run, so signing in never waits for mail. It goes only to an
address that was verified for the account when the event happened, so a grant
change that clears verification is mailed, but a later reset of the same
account is not. The text is fixed for each event, says when it happened and
links to Signed-in sessions. It never contains a code, password, address or
device detail. Each notice is sent at most once: one the relay refused is
retried up to three times, one with an unknown outcome is never resent, and one
still undelivered after seven days is dropped as stale. Console backups leave
queued notices out, so restoring a backup cannot resend old ones. The audit
records a security-notices entry with counts only.
Administrator messages are off unless the console supervisor sets
VQ_WEB_ADMIN_MESSAGES=on; any other value keeps them off. Enabling them does
not authorize a message to live users: try them with test accounts and a
disposable mailbox first. Administrators then find Messages
(/admin/messages, API /admin/api/messages):
Compose and preview. Choose a service announcement or a security notice, optionally a role and a queue host (accounts with a read or control grant on it), a one-line subject and a plain-text message. The preview shows the exact recipients and the exact text, including the footer each recipient sees, and how many accounts turned announcements off. Recipients are enabled accounts with a verified mailbox. Nothing is sent.
Send. Tick the confirmation. Sending needs a two-factor sign-in within five minutes and the preview’s digest: if the text or the recipients changed since the preview (an account was added, say), nothing is sent (409) and you preview again.
Each recipient gets their own message from VQ_WEB_EMAIL_FROM, with only their
own address on it. The subject must be one line, so nothing can be added to
the message headers. A message may have at most 500 recipients, and at most 10
messages can be sent in a day.
Deliveries. The message page lists each recipient’s delivery:
sent: the relay accepted it.failed: the relay refused it, or the mail settings are incomplete, so it certainly was not delivered. Retry refused deliveries tries those again, up to three attempts each.unknown: the connection was lost during the delivery, or the console stopped while sending. It is never retried automatically, so nobody gets the message twice; ask the recipient if it matters.
Sending the same reviewed preview again within a day, for example after a
reload, returns the first message and mails nobody again. Bounces that arrive
later in the sender’s mailbox are not read by the console. The audit records
admin-message-send and admin-message-deliver with the message number and
counts only, never the subject, the text or a recipient.
Setup overview (#261)¶
Hosted administrators can open Administration → Setup overview, or read
GET /admin/api/setup, for a redacted configuration summary. The console section
uses the actual settings held by the serving process, including its title,
listener scope, fleet mode and refresh interval. It does not re-resolve defaults
and present them as the active configuration.
The mail section validates the sender format and SMTP configuration from that process’s environment, without opening the SMTP password file or making a connection. A configured authentication identity does not mean the credential file is readable or authentication has succeeded. Invalid metadata is reported without including its values.
The gateway section reads configuration available to this console and shows only enabled/mode flags, whether authority/public URL are configured, and counts of hosts, projects, key-issuance policies, execution bindings and principal quota overrides. Project/principal/host names, endpoints, paths, usernames and secrets are omitted. Missing execution-binding policy retains the legacy trusted-group model; an empty binding map denies new submissions. Neither is an isolation qualification. If configuration cannot be loaded, this section says unavailable and does not turn the error into a healthy default.
This is a read-only view. It performs no proxy/TLS, mail, gateway, connector or
execution-host probe. A separate gateway process may use different configuration.
It does not change grants, enable public signup or federation, send email, or
restart services. Non-admin accounts cannot use the page or direct API; query
selectors and write methods are unsupported. For full local values and their
source layers, operators can use vq web config in the appropriate environment.
Audited apply and rollback from the browser remain planned follow-ups.
Check a configuration change before applying it (#261)¶
Before replacing the configuration file, check the new version:
vq config check proposed.toml # what would change, values hidden
vq config check proposed.toml --show-values # with old and new values
vq config check proposed.toml --against other.toml --json
It validates the file exactly as vq loads it (TOML syntax, unknown settings,
ranges, the version floor) and exits 1 with the error if it is not valid. For a
valid file it lists every setting that would be added, removed or changed,
compared with the configuration in effect (or with --against), and says what
makes each one take effect:
console settings read at start (
[web]listener, port, title, fleet and log level): restart the console;gateway listener settings (bind, port, TLS files,
enabled,mode): restart the gateway service;other
[gateway]settings, such as project policy and quotas: the gateway and the console read them on their next request;other
[web]settings: the console reads them on its next request;everything else, such as hosts, the broker and multi-user settings: restart the daemon on the affected hosts. This is the safe default, because some of these values are read only when the daemon starts.
Values are hidden unless you pass --show-values, so the report can be shared.
Settings naming credential files (secrets, passwords, tokens, key files)
stay hidden even then. The check never writes anything. Apply a checked file
through your usual configuration workflow, then restart what it named.
Security checks (#262)¶
Hosted administrators can open Administration → Security checks, or read
GET /admin/api/security (schema vq.security-health/1). The report checks
the console’s own security posture. Each check reports ok, warn, fail or
not_configured, with a remedy for every warning and failure:
Check |
Passes when |
|---|---|
Hosted origin |
The origin is HTTPS, so session cookies never travel in clear text. |
Listener |
The backend binds to loopback. A non-loopback bind is a warning when acknowledged with |
Authentication state directory |
It is a real directory owned by the console’s user with no group or world access (0700). |
Session database |
It is an owner-only (0600) regular file with one hard link. |
Account store, session signing secret |
Each is an owner-only regular file, not a link. |
Authenticator encryption key |
|
Mail relay password |
When |
Identity provider client secrets |
Every configured |
vq configuration file |
No other user can change it. |
Administrator accounts |
At least one active administrator exists, and each has an enrolled authenticator. |
Previous authenticator key |
Not set, or, during a rotation, an owner-only file; while set it is a warning to finish the rotation. |
Operations audit journal |
No other user can change it and every hash link is intact; readable by other users is a warning. |
Self-service signup |
Closed, or open with a valid mail sender and relay so requests can be confirmed. An unrecognised |
Administrator messages |
Off, or on with a valid mail sender and relay. An unrecognised |
The checks use lstat metadata, configuration flags and account counts. The
audit journal check also hashes the journal’s lines and reports only counts.
The checks never read a secret’s contents, follow a link to a secret file, write a
file or open a network connection, and the authentication database is opened read-only.
Results name the kind of file, never its path, the configured value or an
account name. The report covers this console process. The reverse proxy, TLS
certificate, firewall, backups and a separate gateway process are outside it,
and a passing report is not a security audit. Non-admin accounts cannot use
the page or API, and query selectors are rejected.
On the console host, run the same report as the console’s user, with the console’s environment:
vq web security-check # table; exit 1 when a check fails
vq web security-check --strict # also exit 1 on a warning
vq web security-check --json # the API document
Portable SMTP transport (#261)¶
Configure the console supervisor externally; these settings are not accepted from browser forms and do not modify execution hosts or scheduler runtimes.
Environment variable |
Meaning and default |
|---|---|
|
Required valid sender mailbox. |
|
Relay hostname or IP address; defaults to |
|
|
|
Defaults to 25 for local, 587 for STARTTLS, or 465 for implicit TLS; valid range 1–65535. |
|
Optional SMTP authentication identity; pair with a password file. |
|
Absolute path to the private SMTP password file; required when a username is supplied. |
For example, with a provisioned remote relay:
VQ_WEB_EMAIL_FROM=dashboard@example.org
VQ_WEB_SMTP_HOST=smtp.example.org
VQ_WEB_SMTP_SECURITY=starttls
VQ_WEB_SMTP_USERNAME=dashboard@example.org
VQ_WEB_SMTP_PASSWORD_FILE=/absolute/private/smtp-password
Remote SMTP requires TLS. Both TLS modes verify the relay’s certificate and
hostname using the system trust configuration. STARTTLS must succeed before
authentication or message delivery; there is no plaintext fallback. local
permits only loopback IP addresses or localhost and refuses authentication.
TLS relays that do not require authentication can omit both credential settings.
Connections use a ten-second socket timeout.
Provision the password through the site’s credential store as an owned regular
file with mode 0600, no symlink and no additional hard links. Its content is
one nonempty line of printable ASCII, at most 4,096 bytes including an optional
terminal newline. Usernames are printable ASCII without spaces, at most 254
characters. Passwords are not placed in URLs, browser responses or command-line
arguments. A delivery failure invalidates the newly issued verification code;
the browser receives a generic error without relay or credential details.
Supervisor environment changes require the normal console restart or rollout. An atomically replaced password file is read on the next delivery. Neither operation requires replacing a calculation runtime or restarting the job daemon. Before enabling a new relay in production, verify delivery to a disposable mailbox and check the site’s sender authentication. The source tests use a simulated SMTP transport; they do not qualify a live relay or send mail.
Provision in a separate environment¶
Use the existing selected authority and its external operator configuration.
Build a replacement environment separately from any serving runtime. The new
optional mfa extra adds PyOTP, cryptography and qrcode; ordinary web installations
and existing jobs do not change. Install vibescheduler[web,mfa] from the
qualified release once available, or for an isolated source trial. Add the
avatar extra (Pillow) as well if people should be able to upload
profile pictures:
python -m pip install -e '.[web,mfa]' ./packaging/vibe-queue
vq web user add alice@example.org --role viewer --read-host compute-a
vq web user mfa-keygen /absolute/private/console-mfa.key
export VQ_WEB_MFA_KEY_FILE=/absolute/private/console-mfa.key
vq web user mfa-enroll alice@example.org
Run the enrollment command after the account owner has verified their email.
The key command refuses to overwrite any existing path. The key must be an
owned, non-symlink regular file with mode 0600. Keep it separate from the
account/session database and its backups; anyone holding both can decrypt
factors. Terminal enrollment runs on a trusted authority terminal, verifies the account
password, displays an otpauth:// URI and manual setup key, and requires a
code from the authenticator. Do not record the terminal or paste this material
into a chat or log. Alternatively, issue a private browser invitation on the authority:
vq web user mfa-invite alice@example.org
Deliver it privately to the verified account owner, separately from the password when possible. It expires after 24 hours. A new invitation invalidates the old one; it cannot overwrite an enrolled factor. At Set up an authenticator on the hosted sign-in page, enter the username, password and invitation. Scan the locally generated QR code or enter the manual key, then confirm a code within five minutes on the same browser and connection peer. Save the ten recovery codes immediately. Setup does not sign you in. Refreshing after consumption or abandoning setup may require a new invitation. Never send the QR, setup key or authenticator codes through a QR-generation service or a support ticket.
Store the ten recovery codes privately; they are printed once and only their hashes are stored. Enrollment consumes its verification code; wait for the next authenticator code before signing in. Account password or role replacement invalidates the enrolled factor as well as sessions; use the audited recovery procedure and re-enroll after such a change.
Enable the hosted boundary¶
Configure the serving supervisor with both variables; these are per-process security settings, not browser input:
export VQ_WEB_HOSTED_ORIGIN=https://console.example
export VQ_WEB_MFA_KEY_FILE=/absolute/private/console-mfa.key
vq web run --fleet --host 127.0.0.1
The origin must be HTTPS with no path or trailing slash. Hosted mode requires fleet mode, the optional dependencies and a valid key at startup. Removing the hosted-origin variable selects the historical local-console behavior; preserve it in the supervisor and any replacement service configuration. The environment setting is deliberately independent of fallback defaults for a broken fleet config. Neither this command nor installing the extra publishes a service.
Terminate TLS at the configured reverse proxy. Restrict the backend to that
proxy and explicitly trust only its forwarded headers in the ASGI server.
One deployment uses a private Unix socket in a directory traversable only by
the console and reverse proxy. In that configuration the supervisor starts
uvicorn vq.web:create_app --factory --uds SOCKET --proxy-headers with the
hosted settings and fleet mode enabled. The proxy preserves the canonical Host
and overwrites forwarded scheme and client address. Trust all peers only
on such an access-controlled socket; never apply that setting to an exposed
TCP listener. Keep the console interpreter, credentials, supervisor and TLS
renewal separate from calculation runtime activation.
Requests must resolve to the exact configured HTTPS origin; raw forwarded
headers alone do not grant trust. Do not expose the backend directly or trust
forwarded headers from arbitrary clients. Alias origins are rejected. The
service’s authentication boundary covers fleet, single-host, API, documentation,
log and write routes, even when the account store is empty. Only static login
assets, login routes and minimal /health/live liveness are public.
Password verification creates a five-minute pre-authentication challenge, never a full session. A TOTP or recovery code completes login. The challenge is bound to the peer seen by the trusted server, allows five code attempts, and is single-use. Codes accept at most one 30-second time step of clock skew; accepted steps cannot be reused, including across concurrent workers or restarts. Login admission is also rate-limited by the existing account/peer/global store.
Cookies are Secure, HttpOnly and SameSite=Strict. Hosted responses are not cacheable. Mutating requests require an exact Origin header, including login and logout. Legacy password-only cookies and all Authorization bearer headers are refused in hosted mode; API-key automation continues through the separate submission gateway. Single-host actions which require a legacy bearer token are consequently unavailable through this profile; use the existing audited fleet session actions instead.
Staff: grant access by queue host¶
Use exact host keys from the authority’s external configuration. For example,
this operator may monitor both queues but control individual jobs only on
compute-a:
vq web user add lab-operator@example.org --role operator \
--read-host compute-a --read-host compute-b --control-host compute-a
vq web user mfa-enroll lab-operator@example.org
vq web user list
Hosted role |
Can read |
Can control |
|---|---|---|
Viewer |
Explicit read hosts |
None |
Operator |
Explicit read hosts |
Single jobs on hosts with both read and control grants |
Admin |
Whole fleet |
Existing fleet controls and audit |
Submitter |
Own gateway jobs in My calculations |
Only explicitly granted own-job cancellation |
There is no wildcard, default host, or inheritance between a scheduler lane, its
driver and neighboring lanes. Give each native queue a single canonical host
key. Known duplicate enrollments are withheld. Older hosted viewers/operators
without grants see no hosts. To change access, replace the account with
vq web user add NAME --force, specifying its role and all desired grants;
then use the audited factor reset and re-enroll. Replacement invalidates sessions
and challenges. Explicitly scoped accounts cannot sign in to the legacy console.
After MFA, open /fleet or /fleet/jobs. Each host shows its observed
reachability and job count. An incomplete listing is labelled; last-known rows
are separate from current jobs and cannot be controlled. The jobs page, its
fragments and the JSON views at /api/v1/fleet and /api/v1/fleet/jobs all
use the same filtered observation. Add ?host=compute-a to narrow the view.
Open /fleet/jobs/ID?host=compute-a or /api/v1/fleet/jobs/ID?host=compute-a
for one job’s status. An inaccessible job and a missing job both return 404.
Driver diagnostics, raw logs, previews, global refresh, doctor, campaigns,
audit and the legacy single-host interfaces are unavailable to scoped staff.
Use the job page buttons or POST to
/api/v1/fleet/jobs/ID/ACTION?host=compute-a with the MFA session and canonical
Origin. Actions are pause, resume and kill; the backend’s state restrictions
still apply. The console checks a listed job and records the request before
dispatch. The owning driver checks the stored job ID and scheduler target under
its job lock before acting. An older driver without the scoped helper cannot
perform the action. There is no fallback to an unscoped command or automatic
replay. An accepted request does not confirm a process has exited; refresh the
observation. If the outcome is uncertain, check the job and audit before retrying.
My calculations: provision an explicit browser grant¶
The console must run against the selected authority’s existing gateway state and
operator configuration. It reads durable ownership from the gateway job index in
local mode, or relay records in relay mode. It does not infer ownership from the
browser username, target account, a job name/tag, or a client-supplied filter.
Historical jobs with no authenticated gateway ownership remain staff-only.
The gateway must be enabled and have a stable execution_authority matching the
browser grant. Existing API keys are neither copied into cookies nor used as
browser credentials.
Provision a separate submitter account on the trusted authority terminal:
vq web user add browser-alice@example.org --role submitter \
--gateway-authority authority-one --gateway-project group-a \
--gateway-principal alice
vq web user mfa-enroll browser-alice@example.org
These are synthetic names. Select the existing gateway authority, project and
principal from external operator records. Each account has one explicit binding;
accounts deliberately mapped to the same project/principal share that owner’s
jobs. A principal name in a different project is a different owner. API-key
rotation retains ownership. Browser access is a separate grant: revoking one
API key does not revoke the browser account; remove the browser account or
remove the principal from the project’s allowed_principals to revoke access.
The submitter signs in with password and authenticator code at /fleet/login
and lands on /my. The My calculations workspace provides:
A paginated list and job detail, scoped before pagination to durable ownership.
Bounded stdout/stderr reads, result-collection status and manifest-selected downloads with SHA-256 headers. A relay’s stale connector state is labelled; local mode reports broker placement state, not a fresh target-process probe.
Optional cancellation of one owned job. Grant it explicitly with
--cancel-ownwhen provisioning the account. Without it the account can read/download only. The existing gateway cancellation transaction handles retries and uncertain outcomes; the browser never cancels a host queue or replaces a calculation.
Refresh reloads status. Results become available after the existing gateway or connector collection path completes. The workspace exposes no fleet inventory, project queue counts, host credentials or private runtime paths. To display a host, map its configured target name to a public label on the console authority. For example:
[web.calculation_host_labels]
compute-a = "Lab A"
Only a label on an owned job is shown; no list of configured hosts is exposed. In local mode it identifies the recorded placement attempt or bound target; in relay mode it identifies the immutable requested target when present. It does not assert that a process is running. Unlabelled or unknown targets show Unreported. Select a label or enter it in the filter; matching happens within the owner’s records before pagination. Unknown and inaccessible labels both return an empty page.
The same owner checks protect /my/api/jobs, detail, logs, results, downloads
and cancellation. Known foreign IDs return 404; unauthorized actions return 403.
Submitters cannot use legacy fleet/single-host APIs, fragments, raw job URLs,
OpenAPI, admin routes, uploads or submission routes through the console. Staff
roles do not implicitly acquire a gateway identity or enter /my. Use vq remote for submission and API automation.
Every request rechecks the current account and gateway admission policy. Changing an account’s binding, cancellation grant, password or role invalidates existing sessions and enrolled factors. Provisioning/removal is recorded in the private console audit. Replacement requires audited factor reset and re-enrollment; never edit an account to silently attach another person’s principal. Revoking access does not cancel accepted work. Keep gateway state, ownership and relay journals with their existing authority; do not point a browser grant at copied or unrelated state.
All hosted responses, including denials and downloads, use Cache-Control: no-store and Vary: Cookie. The user workspace has no shared fleet cache; it
revalidates on restored navigation and tab return. Logs and file names render as
text. Do not configure a proxy/CDN to cache authenticated responses. Cancellation
and logout require the canonical Origin as well as MFA. Submitter login is refused
by the historical non-hosted password flow; retain hosted mode in the supervisor.
Reboots and service hardening¶
The gateway, scheduler driver and console units, their sandbox, what survives a reboot, the post-boot checks and the guarded weekly reboot are in reboot-safe, hardened hosted deployment (#272).
Recovery and revocation¶
A recovery code replaces the TOTP after password verification. Each code works once. Recovery invalidates other sessions and pending challenges. Logout revokes the current browser session. Removing/changing the account, resetting its factor, losing/corrupting the factor database, or losing the key denies existing MFA sessions. Neither denied access nor revocation cancels calculations.
If all factors and recovery codes are lost, a local operator must verify the user’s identity through the site’s recovery process before running:
vq web user mfa-reset alice@example.org
vq web user mfa-enroll alice@example.org
Reset records started/outcome audit entries, revokes sessions and challenges, and requires new enrollment. It never turns a hosted account into a password-only account. To replace your own authenticator, sign in again with both factors and open Manage authenticator within five minutes. Re-enter your password and confirm a code from the new authenticator in the same session within the freshness window. Until confirmation the old factor remains active. Confirmation revokes all sessions, pending login challenges and old recovery codes. Sign in again with the new factor. An older session, another account or a password alone cannot replace a factor. A lost authenticator with no recovery code still requires audited local recovery.
The existing private web-auth/sessions.sqlite3 now also holds encrypted
factors, consumed-step state, recovery hashes and challenge hashes. Back up the
factor database securely and the encryption key separately. Do not copy a live
authentication database file into a running service: it can resurrect used
codes and challenges. An operator recovery must stop console workers only,
revoke sessions and reset or re-enroll affected factors before reopening
browser access. Do not stop calculation daemons or replace runtime generations
for console work.
Backups and restore drills (#262)¶
Run these as the console’s user, with the console’s environment, on the console host:
vq web backup create /srv/backups/vq-console # an existing private directory
vq web backup verify /srv/backups/vq-console/vq-console-backup-20261114T090000Z \
--key-file /secure/elsewhere/mfa.key
What create writes. It makes a new owner-only (0700) directory named
after the UTC time, containing:
web-users.json, the account store;auth.sqlite3, a consistent online snapshot of the authentication database, holding authenticators, profiles, verified addresses and supporter badges;fleet-audit.jsonl, the operations audit journal;manifest.json, with each file’s size and SHA-256, the counts of accounts, administrators, authenticators, profiles, verified addresses, supporters and audit records, andaudit_head, the hash of the journal’s last record (see audit integrity).
Every file is mode 0600. A failure part-way removes the half-written directory.
What it leaves out:
Signed-in sessions, login limits, pending MFA setups and challenges, pending email verifications and in-flight SSO requests. They are deleted from the snapshot with
secure_deleteandVACUUM, so not even a free database page keeps a session token hash. A restored console therefore signs everyone out and cannot revive a revoked session.The session signing secret. A restored console creates a new one.
The authenticator encryption key (
VQ_WEB_MFA_KEY_FILE). Factors stay encrypted under it, so keep the key’s own backup somewhere else: neither copy alone exposes a factor.Gateway state (machine keys, jobs, uploads, results). It belongs to the gateway process and its own backup.
What verify proves. This is the restore drill. It copies the backup into
a temporary directory and never into the live console. It then checks:
the directory and file permissions;
every digest, and that no unexpected file is present;
SQLite integrity, and that no session or other short-lived record survived;
the account store’s format;
that the counts it recomputes match the manifest;
that the audit journal’s head matches the manifest. A broken hash link in the copied journal is a warning: the backup is still a faithful copy.
With --key-file, it also proves that every authenticator decrypts with the
separately kept key, without printing any of them. It exits 1 on any problem.
Rehearse it after every backup, and again after rotating the key.
Restore. First, while the live database still exists, list the authenticators that moved on since the backup:
vq web backup verify BACKUP --key-file KEY --compare-live
It names three groups of accounts:
those that used a recovery code since the backup;
those whose authenticator was replaced since the backup;
those that enrolled after the backup.
It reads both databases read-only. Then stop the console workers only; calculations keep running:
Move the current
web-auth/sessions.sqlite3(with any-wal,-shmor-journalsidecars) andweb-users.jsonaside.Copy the backup’s
auth.sqlite3toweb-auth/sessions.sqlite3andweb-users.jsonback into place. Each must be an owner-only 0600 file with one hard link.Make sure
VQ_WEB_MFA_KEY_FILEnames the matching key.Start the console and run
vq web security-check.
Everyone signs in again with their existing password and authenticator. Account changes made after the backup are lost. Recovery-code and one-time-code state is as of the backup, so a recovery code used after the backup becomes valid again, and a replaced authenticator comes back.
Reset the factors of the accounts
--compare-livenamed withvq web user mfa-reset.Have those accounts, and anyone who enrolled after the backup, enroll again.
Keep the live audit journal: it already holds every record in the backup and the later ones. Check it with
vq web audit verify --expect-head <audit_head from the backup manifest>. Only if it is lost, or fails that check, move it aside for investigation and put the backup’sfleet-audit.jsonlin its place; the next recorded action continues that chain.
Rotating the authenticator key and session secret (#262)¶
Run these as the console’s user, with the console’s environment.
Authenticator encryption key. Stored authenticator seeds, and seeds of setups
in progress, are encrypted with the key in VQ_WEB_MFA_KEY_FILE. Replace it in
four steps, with no time in which nobody can sign in:
vq web mfa-key create /secure/new-mfa.key # a new owner-only key; never overwrites
# point VQ_WEB_MFA_KEY_FILE at the new key and VQ_WEB_MFA_PREVIOUS_KEY_FILE at
# the old one in the console supervisor, then restart the console
vq web mfa-key rotate # re-encrypt every seed, all or nothing
vq web mfa-key rotate --check # exit 0 once no seed needs the old key
# remove VQ_WEB_MFA_PREVIOUS_KEY_FILE and restart
While both are set, the console decrypts with either key and encrypts with the
new one. rotate changes nothing if any seed decrypts with neither key: find
the key it was written with first. The security checks warn while a previous
key is configured. Keep the old key’s backup for as long as you keep console
backups made before the rotation: their seeds are still encrypted with it, and
their restore drill needs it.
Session secret. vq web session-secret rotate --yes replaces the
cookie-signing secret and ends every signed-in session and pending sign-in.
Everyone then signs in again with their password and authenticator. Accounts,
authenticators, machine keys and calculations are not affected. Use it after a
suspected leak of the secret file, or to sign everyone out at once. Both
rotations are recorded in the operations audit.
Audit integrity and retention (#262)¶
Every record in the operations audit journal (fleet-audit.jsonl in the
console’s vq state directory) carries prev, the SHA-256 of the line before
it. Changing, inserting, reordering or deleting a record breaks the chain at
that point. New journals are created owner-only (0600). Several console
workers append under one lock, so they keep a single chain.
vq web audit verify # every link; prints the current head
vq web audit verify --expect-head SHA256
verify is read-only. It reports line numbers, never record contents, and
exits 1 on a broken link. Records written by an older vq, before the chain
existed, are reported as an unprotected prefix; the chain starts with the next
action. A record that a crashed write left half-written is ended by the next
action, which marks itself as following it, so it shows as a warning rather
than an edit.
What the chain proves, and what it does not. The chain alone shows that
the journal was not edited by hand or partly overwritten. Someone who can write
the file could still recompute every later link, or cut the newest records
off. A head recorded somewhere else closes that gap: with --expect-head,
every record up to that head must still be present and unchanged. Each console
backup manifest records audit_head, so keeping the manifests off the console
host gives you a series of anchors. You can also record the head that
verify prints, for example in your change log.
Signed checkpoints. A head printed on the console host is only as trustworthy as that host. To vouch for a head with a key the host never sees, make a key pair once, keep the private key offline, and record its fingerprint somewhere you trust:
vq web audit keygen /offline/audit-signing.key /srv/audit-signing.pub
vq web audit verify --json # on the console: note "head" and "records"
vq web audit sign-head HEAD --records N --note "monthly" \
--private-key /offline/audit-signing.key --out checkpoint-2026-11.json # offline
vq web audit verify --public-key /srv/audit-signing.pub \
--checkpoint checkpoint-2026-10.json --checkpoint checkpoint-2026-11.json
verify checks each checkpoint’s Ed25519 signature and that its head is still
in the chain; add the archives with --archive for checkpoints older than a
prune. It prints the key’s fingerprint: compare it with the recorded one,
because someone who controls the console host could swap both the public key
and the checkpoints for their own. A rewritten or truncated chain, an edited
checkpoint or one signed with another key fails with exit status 1. The
private key must be an owner-only file and is never needed on the console
host. Keep checkpoints off the host too.
vq web security-check and Administration → Security checks include the
journal: they fail on a broken link or a journal that other users can change,
and warn when other users can read it. A journal created by an earlier vq keeps
its old mode; chmod 600 it.
Retention. Move records older than a retention period into an archive:
vq web audit prune --keep-days 400 --archive-dir /srv/audit-archive # mode 0700
vq web audit verify --archive /srv/audit-archive/fleet-audit-through-20251009-20261114T090000Z.jsonl
prune refuses a journal that does not verify, so it cannot hide a break. It
writes the oldest records to a new owner-only archive file and syncs it. It
then replaces the journal atomically with the records it kept plus an
audit-retention record. That record names the archive file, its SHA-256 and
the hash of its last line. The shortened journal still verifies on its own.
With --archive (oldest first, repeatable), verify checks the archives and
the journal as one chain, and that each archive is the one a retention record
names. A head recorded before the prune is found again only with the archives
that hold it. Console workers keep appending during a prune; none of their
records is lost. Deleting old archives is left to your own retention policy;
prune never deletes one.
For rollback to a console version without this profile, close hosted proxy access and stop console workers first; do not expose that older version as the hosted service. See version compatibility.
Acceptance and remaining work¶
tests/test_web_mfa_237.py exercises the two HTTP login stages, concurrent OTP
replay, challenge expiry/attempt bounds, recovery reuse, revocation, key/store
loss, wrong-origin/backend requests and legacy credential bypasses. These tests
use isolated state and do not contact a live fleet. They are not evidence of a
completed deployment or of per-user execution isolation.
tests/test_web_own_jobs_237.py exercises the browser workspace over real
local/relay ownership records: same-project users, cross-project identities,
known foreign IDs, every legacy route, downloads, explicit cancellation grants,
policy/mapping revocation, restart, logout and account switching. It reuses the
MFA login flow; password-only cookies and API keys cannot grant access. A local
Chromium exercise over disposable loopback HTTPS also verified two password/TOTP
sign-ins, isolated list/detail pages, log rendering, file download, logout/account
switching and denial of a known foreign job and download. It used synthetic jobs,
a test certificate and generated TOTP codes, not a public deployment.
tests/test_web_staff_hosts_237.py exercises two MFA viewers and a scoped
operator across pages, fragments, APIs and legacy routes, including mismatched
job/host pairs on a shared driver, stale observations, remote helper refusal,
auditing and grant revocation. Driver mutations use disposable queue state.
Browser enrollment and replacement are covered by tests/test_web_factor_setup_237.py,
including expiry, replay, rotation and revocation. The account-owner external login with an authenticator app has been confirmed. The selected
authority’s dedicated console and TLS proxy have served a verified external
browser: a temporary admin reached fleet/audit, a temporary submitter reached
only My calculations, and logout revoked access. Those qualification accounts
were removed. No site credentials or private host configuration belong here. See the roadmap.
Implementation references: PyOTP and Fernet authenticated encryption.