Pyrite ITMenu Download the alpha
Documentation index

Documentation · Reference

Security and operations

How to run Pyrite on a local network, how the engine protects apps and data, and which checks are the responsibility of the people who build and approve apps.

01 /Use one address for the portal and apps

Single sign-on uses the engine’s session cookie. The browser associates cookies with the server’s hostname regardless of port. To share a session, open the portal and all apps using the same hostname or IP address.

For example, if you open the portal at http://192.168.1.20:8080/ and an app at http://server-app:8101/, the browser treats them as different hosts and the app asks you to sign in again. Choose one form of the address and use it everywhere, including bookmarks, links and emails. The addresses in this example are fictitious.

If each app has its own name (Network rules), whoever opens an app without being signed in goes through the portal, writes the password once and comes back to the app by itself: no cookie is valid for the whole domain. With name and port nothing changes (see Sign-in: one sign-in, wrong attempts, the console).

02 /Firewall and ports

03 /Internal network only

The local network first

Without a certificate the engine uses HTTP, so passwords and data travel across the local network in cleartext. You can enable HTTPS on the Certificates page. One certificate covers the engine and all app ports. You can use your company CA, a .pfx or .pem file, or an internal CA created by Pyrite. You can also have Let’s Encrypt (with the Cloudflare DNS or with port 443) and more than one certificate: see HTTPS and certificates. Some apps can be opened to the internet (Network rules), but only with HTTPS on, one app at a time and only for non-sensitive data. The console is never reachable from the internet.

04 /Central administration

05 /The console and access levels

Importing people and groups from Excel on the People page respects access levels. An Admin can add only User-level accounts, only to groups they can edit, and with grants only to apps they manage. Other apps appear nonexistent to that Admin. Nobody can import an Owner. The import adds entries only and is applied in full or rolled back. Temporary passwords appear only in a file available for a single download within ten minutes. They are excluded from events, responses and notes.

Smart import on the Import tab writes directly to the app database with server privileges, outside the app’s API rules and routes. If an app relies on routes or hooks to maintain consistency (for example, movements, history or status), use app.json field import.consoleCollections to list only the collections where console import and undo are permitted. Set it to [] to permit none. If the field is omitted, the tab warns that all collections are visible. The two-stage import is atomic, with limits of 50,000 rows and 60 seconds of writes. “Undo” reverses the whole import, unless other records reference the imported ones or imported records have since changed. Imports from app pages require a recipe approved by the administrator (toolAccess) and observe its row limits. JSON files are limited to 128 MB per file and 16 MB per item.

06 /Access and sessions

07 /App isolation

Each database-backed app runs in its own process with its own data. The engine enforces three additional boundaries.

  1. A separate key for each app. The engine communicates with each app using its own unique key. The app receives the key at startup and immediately removes it from the environment so that app scripts cannot read it.
  2. Restricted internal port. An app’s internal port accepts only requests from the engine with the correct key. Another app or program on the same server cannot use that port to bypass the gateway.
  3. Confined scripts. App scripts (hooks and migrations) cannot start programs or terminate the process. They can read only files in the app folder and write only to its data folder, state. The app.json manifest, code in release, and logs are read-only to scripts. An app therefore cannot change its own access settings, roles or tools. The database cannot be used to read or write files outside the folder, either. Paths through symbolic links or Windows junctions inside the app folder are rejected even if the link points back into the folder. The only exception is the state folder itself. The administrator can relocate it to another drive using a junction (see Data, backups and disk space).

Engine tools called by app scripts, including import, operate within the same boundaries. They access files in that app’s folder and its own database.

An app cannot call the engine (console, portal) nor another app of the same server: it gets a refusal (403) and an event appears in the console. The limit, stated plainly: the fence greatly reduces what a script can do, but it is a defense inside the program. The script runs in the same process of the engine of that app, with the same Windows user. The full guarantee, one Windows user for each app, is not in this version: see What an app can do.

Outbound network

A fourth boundary controls calls that app scripts make outside the server. Scripts can reach only addresses declared in the app.json manifest’s network field (allow for HTTPS, or allowHttp to permit HTTP for internal systems that lack HTTPS). With no network declaration they can reach no addresses. The engine also verifies the actual address after DNS resolution. An exact hostname may resolve to an internal server. Wildcards are limited to public addresses. Each app’s Outbound network tab offers Block and Warn modes. Warn allows all calls and counts those that would have been blocked. Apps start in Block mode. The AI page shows calls to AI models and their costs.

Slow routes

The engine waits up to 4 minutes and 50 seconds for an app script route to respond. On timeout it returns a 504 with an explanation. If the app closes the connection without responding, even abruptly, it returns a 502. An app that is stopped or restarting returns the usual 503. The engine never retries a request it has already sent. Check the outcome before retrying because the route may have completed its work. Both 504 and 502 leave a warning in the engine history. The engine reuses connections to apps to avoid spurious “unavailable” messages under load.

08 /Limits of engine protection

The engine controls who can enter an app and enforces its isolation. The remaining protections depend on the app and whoever approves it.

09 /Credentials and passwords

10 /Data, backups and disk space