Skip to content

Security ​

Ossiframe apps hold credentials that are often root-equivalent. This page is the threat model and list of guarantees. Only items with a linked Verified live or Partly verified record were observed on a real server; the rest is implemented but not verified (known-limitations.md). Report vulnerabilities as described in SECURITY.md, not in a public issue.

Trust boundaries ​

The desktop apps connect only to your servers over SSH, and to an AI provider only if you use the optional assistant (the only desktop code that makes HTTP requests is modules/ai-assistant).

BoundaryRule
WebView → Rust backendTyped, intent-level IPC only. Backend validates every field. No command returns a secret. No generic shell or file IPC, except the opt-in terminal and Files commands below. Minimal Tauri capabilities and strict CSP. Apps that enable the terminal also allow inline <style> elements (style-src-elem 'self' 'unsafe-inline'), because the terminal view adds styles at run time; scripts stay 'self' only, and Doctor keeps the strict policy.
Rust → keychainOnly ossiframe-desktop's vault code reads or writes secrets.
Rust → SQLiteNo secrets stored.
Rust → AI provider (optional)HTTPS to a fixed host, user-triggered, after consent, with redacted data. See AI assistant data flow.
Desktop → serverSSH with a pinned host key. Remote output is untrusted input, rendered as text.
SSH user → app usersApplication code (deploy scripts, Composer, Artisan) runs as a per-app Linux user, never as root.
Server → internetOnly for work you approve: Ubuntu package mirrors (provisioning), your Git host (deployment) and Let's Encrypt through Certbot (HTTPS).

Doctor guarantees ​

This section owns what Doctor cannot do. Other documents link here. Doctor has no:

  • terminal (terminal_* commands, ssh-terminal module, terminal features);
  • file access (files_* commands, ssh-filesystem module, sftp and files features);
  • port forwarding (tunnel_* commands, ssh-tunnel module, forward and tunnels features);
  • provisioning or deployment (provision_* and app_* commands, ubuntu-provisioning and app-deploy modules);
  • privileged execution. Its modules get a ReadOnly executor that refuses every privilege except Privilege::User, so Root and RunAs fail with PrivilegeDenied before anything is sent. Checks:
  • Doctor's build.rs command manifest and capability file list only its own typed commands, and drift tests assert that none of the above appears.
  • The CI step "Doctor dependency boundary" (tools/check-doctor-boundary.sh) fails if cargo tree shows one of these modules, crates or features in Doctor's dependency tree.
  • Read-only behaviour comes from exposing only typed operations with predefined commands. A module manifest is not a sandbox. Doctor includes linux-inventory, linux-audit, linux-monitoring, linux-logs and the optional ai-assistant (read-only inventory and audit operations through the ReadOnly executor). Limit: modules are trusted compiled Rust and can build their own executor. The guarantee holds for this repository's code and a Doctor build with no other module. A generated app gets only the modules it enables.

Credentials ​

  • Passwords and key passphrases are prompted at connection. Saving one to the OS keychain is optional and happens only after a successful login.
  • Private keys are referenced by file path. Ossiframe does not copy them or generate SSH keys on the desktop.
  • The server form lists private keys through one typed, read-only command, list_ssh_keys. It takes no input, reads only the first line of files directly inside ~/.ssh (or links resolving inside it), and returns file names, paths and a key type guess, never key contents.
  • Secrets live only in the OS keychain (service name = app identifier) through keyring-core. Only the macOS login keychain has a backend; elsewhere it is reported as unavailable and nothing can be saved. Secrets never go to SQLite, logs, IPC responses, reports or Debug output.
  • Pinned host keys are public and stored in SQLite.
  • app-deploy generates per-app database passwords (40 alphanumeric characters), sends them over stdin and writes them to the app's .env (mode 0600). Deploy keys for private repositories are generated on the server as the app user (ssh-keygen, ed25519); the private key stays there and only the .pub file is read.
  • Secrets reach remote commands through CommandSpec stdin (up to 1 MiB), never argv.
  • Recover a lost keychain entry with the original credentials or the provider console.

Host keys ​

The check happens during the SSH key exchange (crates/ossiframe-ssh/src/connect.rs). On first connection the app shows the server's fingerprint and sends no credentials or commands until you trust it. A changed key fails the connection before authentication, so no credential is sent. Replacing the pin needs a typed confirmation of the host name. Changing a server's host or port removes its pinned key. Git hosts used by deployments are pinned separately in the app user's known_hosts (shipped keys for known hosts, or scanned keys the user confirmed). Git runs with StrictHostKeyChecking=yes.

AI assistant data flow (optional) ​

Not verified with a real provider key. Without a saved key, nothing below happens.

  • Test connection. A user click that sends one fixed question ("Are you there?") to the saved provider. No server data, tool, consent or conversation. The result is a short message without the key or any provider error body.
  • What leaves the machine. Only when you click an assistant button or send a message: the selected context and read-only tool results go over HTTPS to your chosen provider's fixed host (Anthropic, OpenAI or Amazon Bedrock). For Bedrock the host is bedrock-runtime.<region>.amazonaws.com; the region is validated to letters, digits and -, so the host cannot leave amazonaws.com, and consent is per region. The Bedrock API key is sent only as a bearer token to that host, is limited by AWS to Bedrock actions, and is kept in the OS keychain. The frontend cannot set a URL, prompt template, tool name or command.
  • Consent. Before the first request for a server and provider, a dialog shows what is sent, and nothing is sent until you accept. You can withdraw consent, view the exact data sent with each answer, and see its evidence sources.
  • Redaction. By default the connection address, server IPs and hostname become placeholders. The app never sends .env keys or values, database passwords, API keys, private keys, the SSH key path or the SSH username. Log lines get best-effort secret masking, and lines with authentication headers are dropped. Masking is pattern-based and can miss a secret.
  • Logs. Log tools (service logs, NGINX error log) need a separate consent choice, off by default.
  • API key. Stored only in the OS keychain, entry ai-key:<provider>. The IPC can set, check and delete it but never read it. It is loaded per request, sent only in the auth header, and never written to SQLite, logs, IPC responses or Debug output.
  • Tools. Read-only operations through the read-only executor: linux-inventory and linux-audit in Doctor, linux-inventory in Deploy. The assistant never runs a command it recommends and never creates, approves or runs a plan.
  • No automatic requests. Opening a page, connecting, finishing a scan, an operation failing or a timer never contacts a provider. A failed request is not retried.
  • Limits per question. 8 tool calls, 9 provider requests, 128 KiB sent, 60 s per request, 3 minutes total. You can cancel at any time. Conversations stay in memory and are cleared on disconnect, Clear or exit.
  • Untrusted content. Context and tool results are marked untrusted. They cannot add tools or change limits.

Application HTTPS ​

Enable HTTPS (Deploy; implemented, not verified on a real server) makes the server contact Let's Encrypt through Certbot (HTTP-01) for the application's domain and the contact email you enter. The email is stored locally, is not a secret, and is the only certificate data stored. Ossiframe writes the site file itself and never reads, copies, logs or stores the private key or certificate contents. Remote commands are fixed argument lists with a validated domain and email, and Certbot comes from the Ubuntu archive only. No command returns a secret, and Doctor has none of them.

Opt-in tools ​

Each tool is excluded from Doctor (guarantees), the AI assistant and the operation engine. Generated apps get each only through a generator flag. Each is partly verified (Compatibility).

Interactive terminal (ssh-terminal) ​

The one exception to "no generic shell over IPC".

  • User-driven only. A PTY channel inside ossiframe-ssh, driven by the user's keystrokes and pastes. Modules, the operation engine and the AI assistant cannot write to it.
  • Not logged or stored. Terminal input and output never go to logs, SQLite or IPC errors. Output reaches the webview only through the channel given to terminal_open.
  • Bounded. Limits apply to write and resize sizes and to sessions per server and in total. Output is flow-controlled: at most 256 KiB goes to the view before xterm's write callbacks acknowledge it, and the SSH reader waits.
  • Lifetime. Sessions close on disconnect, host identity change, server removal and app exit.
  • Clipboard is used only on an explicit user action. Multi-line paste asks for confirmation.
  • A terminal can run any command the SSH user can. It bypasses the plan and approval engine and can change the server in ways Ossiframe does not track.

SSH filesystem (ssh-filesystem) ​

The exception to "no generic file access over IPC" and, after the terminal, to "remote work goes through the Core executor".

  • SFTP, not shell. An SFTP subsystem channel inside ossiframe-ssh on the existing connection. It sends typed SFTP requests (russh-sftp) as the SSH user, never sudo or a shell command.
  • User-driven only. Only the Files page calls the files_* commands. The module registers no operations, so plans, the operation engine and the AI assistant cannot reach it, and the page has no AI action.
  • Read-only by default.
    • Write commands are compiled only with the module's write feature: Deploy, and generated apps with --enable-file-write.
    • Builds without it refuse read/write mode.
    • Every server's file session starts read-only and returns to read-only on every new connection.
  • Exclusive with operations. A per-server registry shared with the provisioning engine keeps file writes and managed operations apart under one mutex: an operation cannot start during a write or upload, and a write cannot start while an operation is claimed or unresolved.
  • SSH access protection (best-effort).
    • Delete, rename and move are refused for ~/.ssh, anything inside it and every folder that contains it.
    • New entries and uploads into ~/.ssh are refused.
    • Paths are compared after resolving the parent with realpath, covering a symlinked ~/.ssh and alias folders.
    • It is not race-proof: the server can change between check and request.
    • A custom AuthorizedKeysFile location is not detected.
  • No silent overwrite.
    • Uploads go to a uniquely named remote temporary file (O_EXCL), then a rename that refuses an existing target. Replacing a file needs the user's confirmation and the server's atomic posix-rename.
    • Downloads go to a uniquely named local temporary file (create_new), and replace an existing local file only if the user confirmed in the save dialog.
  • Bounded.
    • Listings stop at 10,000 entries, previews at 256 KiB.
    • At most 2 transfers run per server and 4 in total, and 50 finished transfers are kept.
    • Special files (FIFOs, sockets, devices) are refused for preview and download.
  • Local paths stay in Rust. Rust opens the save and open dialogs. The frontend never sends or receives a local path, and no window has dialog: permissions.
  • Not logged or stored. File contents, previews and transfer data never go to logs, SQLite or IPC errors. Previews render as plain text.
  • Changes apply directly as the SSH user. Ossiframe does not track or undo them, and the page says so.

SSH tunnels (ssh-tunnel) ​

  • Not read-only. Forwarding gives local programs a network path to a service as seen from the server. A database client, admin tool or HTTP client can change that service through a tunnel, and Ossiframe does not see, review or track the traffic. Tunnels are not tied to the operation lock.
  • Local forwarding only. Each connection is a direct-tcpip channel inside ossiframe-ssh on the existing connection. No reverse forwarding, no SOCKS or dynamic forwarding, no remote command.
  • Loopback listeners only. Listeners bind to the constant 127.0.0.1; no command or Rust API accepts a bind address. Any program on this computer can connect to a running tunnel's port, so loopback is not authentication. The page says so.
  • User-started. Tunnels start and stop only on the user's action or an explicit call by the app's own code. Nothing starts on connect or reconnects, and nothing runs after the app exits.
  • Bounded.
    • Running tunnels: 8 per server and 16 in total.
    • Connections: 16 per tunnel and 64 in total, pending channel opens included.
    • Saved tunnels: 32 per server.
    • Stop cancels pending opens and connections and releases the port before it returns.
  • Cleanup. Disconnect, connection loss, server removal and host key change stop every tunnel of that server.
  • Not logged or stored. Forwarded data is never logged, stored or inspected; only byte counts are kept. Saved tunnels hold no secrets.
  • No AI. The module registers no operations and the page has no AI action.

Module composition ​

  • Doctor, Deploy and generated apps share the same code: the audit UI and report export in linux-audit, the app_* commands in app-deploy.
  • linux-audit needs no flag. Its two report commands build and save reports only, and Rust opens the save dialog.
  • A generated app gets app-deploy only with --enable-app-deploy and --enable-provisioning.
  • app-deploy's setup registers the single provisioning engine with the application-aware provisioner and the shared activity registry.

Polling priority ​

Monitoring and log polls are read-only, unprivileged and low priority. A tick is skipped while other work runs on the same server. Polling stops when the page is hidden or unmounted or the server disconnects. History and log text stay in memory.

Privilege ​

IdentityPrivilege
SSH user (Doctor)Privilege::User only. No sudo. Root-only reads are not performed.
SSH user (Deploy provisioning and deployment)Passwordless sudo through sudo -n. This is effectively root, and Deploy says so.
Per-app Linux userNo sudo. Created by app-deploy. Runs application code.

Ossiframe creates no dedicated management user and generates no management key. It uses the SSH user the person provides.

Privilege model ​

  • Only passwordless sudo is supported. There is no sudo password path.
  • Privileged commands are Privilege::Root specs with an absolute program path, rendered as '/usr/bin/sudo' '-n' '--' '<program>' .... sudo -n fails instead of prompting, and every word is individually quoted. The one privileged command before approval is the preflight probe /usr/bin/sudo -n -- /usr/bin/true. A non-zero exit is never read as passwordless.
  • Passwordless sudo is root-equivalent. Enforcement, in layers:
  1. Registered modules. An app can run only the modules it registers. ubuntu-provisioning registers zero run_operation operations.
  2. Typed IPC. The ten provision_* commands take ids, component ids and a digest, and no program, argv, path or privilege. They exist only when an app enables the provisioning feature, calls provisioning::setup, and lists them in its handler, build.rs manifest and capability file.
  3. Opt-in. Deploy enables provisioning. Doctor does not. Generated apps get it only with --enable-provisioning.
  4. ReadOnly guard on run_operation. Modules get an executor that rejects every privilege except User with PrivilegeDenied before anything is sent.
  5. Approval binding. Privileged work runs only from an ApprovedPlan, built only by the plan store after the approval checks. The backend runs its own stored plan, not content from the frontend. Limits:
  • Modules are trusted compiled code, not sandboxed. Trusted Rust code can build its own executor and call sudo. The ReadOnly guard checks only the Privilege field: it does not classify commands or stop a user-level command from changing server state.
  • The plan digest binds consent to what the user saw and detects tampering with a stored plan. It does not protect against a compromised frontend or desktop.
  • The remote lock is cooperative. It excludes other Ossiframe instances only, not a person or tool running apt. A reboot clears it.
  • APT installs transitive dependencies and runs maintainer scripts as root. The package source allowlist (Ubuntu archive hosts) and the candidate gate limit where packages come from, not what their scripts do. The plan lists this before approval.
  • Ossiframe does not roll back, does not run dpkg --configure -a, does not remove packages and never terminates apt, dpkg or a step unit.
  • Operation history stores bounded, best-effort redacted output and no secrets.

Verification status ​

  • Partly verified: one full base-stack install on a fresh Ubuntu 24.04 server, with the sudo -n preflight probe, the allowlisted package sources, the remote lock held and released, and every component verified. See s04-infrastructure-provisioning.md and s05-application-deployment.md (one static app).
  • Pending: recovery checks (verify-only re-run, UnknownOutcome reconcile after a disconnect, lock contention). See known-limitations.md.

Main threats and controls ​

ThreatControl
Compromised frontend runs commandsTyped IPC; plan then approve for mutations; backend executes only what it planned
SSH impersonationHost key pinning; fingerprint shown before first trust; hard fail on change
Credential theftKeychain only; redaction; no secrets in logs, IPC or SQLite; secrets over stdin, not argv
Command injectionValidated types; argv-based commands; one quoting function with focused tests
Path traversalPaths built from validated names under fixed roots
Malicious server outputBounded parsing; size caps; text rendering
Malicious repository contentRuns as the per-app user only
Broken configBackup, validate (nginx -t), reload, verify, restore on failure
Concurrent changesPer-server remote lock unit (cooperative, Ossiframe-only); one active operation per server locally
Unknown outcome retriedUnknownOutcome state; no automatic retry; read-only reconcile; user-initiated mark-resolved gated on fresh evidence
SSH or firewall lockoutNever remove the last working access path; Files refuses changes to ~/.ssh; Ossiframe makes no firewall changes
Public database exposureBind to localhost by default; Doctor flags public bindings
Supply chainCommitted lockfiles, cargo audit, pinned CI actions
Leaky reportsReports exclude secrets, key paths and the SSH username; "Omit connection address" is optional. Reports are not anonymized, so review before sharing
Data sent to an AI providerOpt-in key; per server and provider consent; redaction; log consent off by default; user-triggered only; read-only tools; HTTPS to a fixed host
Out of scope: malware already running as the user on the desktop; kernel-level isolation between hosted apps.

Released under the MIT License.