Security

A Studio holds the team's git tokens, cloud credentials, SSH keys and passwords, on a server open to the internet. This is what stands between them and a stranger, what an administrator decides, and what is left to good habits.

Administration → System → Security: the two-factor requirement (optional, administrators, everyone) and the latest lines of the security log, each with its level, address and browser
Administration → System → Security. Who must have two-factor set up, and the latest of the security log: a confirmed second factor, two refused sign-ins from the same address (fail2ban counts them), an administrator's sign-in.

Accounts#

Invite-only
Nobody signs up: an administrator creates each account and hands the first password over once. Passwords have twelve characters at least and are refused when they appear in the leaked lists (Have I Been Pwned's range API: five characters of the hash leave the server, never the password).
Second factor, required or not
After the password: an authenticator app, a passkey or security key of the same account, or a code by email — whichever each person set up in Settings → Security. Administration → System → Security makes one optional, required of the administrators, or of everyone. Whoever must and has none is sent to Settings → Security and nowhere else, and cannot remove the last one; Administration → People flags who still has to. A session opened through single sign-on counts on the provider's second factor. Ask it at least of the administrators: they hold everything.
Sessions
Twelve hours idle, then the sign-in page again. Changing your password closes your other sessions and kills every other remember-me cookie; a session ends by itself when the password changes elsewhere (an administrator's reset). "Remember me" lasts thirty days. The SSH terminal, the password manager, the databases and the infrastructure pages ask the password again after an hour (AUTH_PASSWORD_TIMEOUT).
Attempts
Five a minute per account and address, twenty a minute per address whatever the accounts tried; then on a server fail2ban bans the address for an hour after ten refusals in a quarter of an hour. Forgot your password? answers the same whether the address is an account or not.
The security log
storage/logs/security.log: every sign-in, failed attempt, second factor, passkey, password change, door and policy, with the address and browser it came from, one line each, for fail2ban. The latest of it in Administration → System → Security; logrotate keeps half a year on a server.
The audit log
Administration → Audit log: the same events and every change made to accounts, projects, members, resources, domains, backups and settings, with who and from where, filters and a CSV export — kept the way the GDPR asks.
Hidden dashboard
Nothing says a Studio lives at studio.<domain> until a browser came in through the door link (Domain & visibility). A wrong key counts as a refusal for fail2ban too.
Settings → Security: the authenticator app, passkeys and codes by email
After the password: a passkey of this account, or a code by email

The server#

Firewall
ufw admits SSH, 80 and 443, nothing else. Caddy's plain-http listener for the processes of the server (the ask of the certificates, the login in front of the project hosts, the bridges' events, the SSH gateway's tickets) is on 127.0.0.1:8081; those endpoints answer 404 on https://studio.<domain>, from Caddy and from the app itself.
Caddy's admin API
On a socket in /run/caddy that only root and caddy enter, not on 127.0.0.1:2019: a project's PHP or a workspace's agent, which run as users of their own on the same server, cannot reconfigure what serves every host.
Headers
HSTS, X-Frame-Options: SAMEORIGIN and a Content-Security-Policy on every page of Studio: nobody frames it, scripts and styles come from Studio, previews from any https host. The project hosts get frame-ancestors that let Studio frame them, and nobody else. No Server or X-Powered-By header anywhere.
Secrets at rest
Tokens, keys, passwords and credentials are encrypted in the database with APP_KEY; the database alone, or its dump, says nothing. /opt/studio/shared/.env holds that key, readable by root and the studio user only; each project and workspace runs as a user of its own with its own .env, mode 600. The only way to root is studio-admin, a fixed list of commands with their arguments checked.
Updates
Every night: Ubuntu's packages (unattended-upgrades and studio-update system) and Studio's own release (Updates). A release can be signed; see Releasing.

What stays with you#

Root's SSH: keys only, no password login, the port of your choice (the firewall follows it). Backups of /opt/studio/shared and the database, somewhere else (Tools → Backups does that too). An administrator who leaves: delete the account the same day, rotate the tokens it knew (Administration → Connectors, the git host, the clouds), and the door link if the dashboard is hidden. Redis on the server has no password and is shared by the projects: an app's cache and queue are readable by the others; a project that needs isolation gets a Redis of its own. The preview pane shows a project's own code inside Studio, in a sandboxed frame that cannot navigate Studio's page: a preview on a client's domain does not get the sign-in cookie there and opens in a tab instead.