Repository navigation
Security
This page describes what ownpanel does to protect your server, in plain words, and what it does not do yet. It is based on the code; it is not an audit. ownpanel is early software (Home).
- Passwords are stored as argon2id hashes. Passwords must be 10 to 200 characters. People sign in with their name or their e-mail address; there is no way to sign up from outside.
- A sign-in session ends after 3 days without use, and in any case 30 days after signing in. Only a SHA-256 hash of the session secret is stored.
- Over HTTPS the cookie is
__Host-ownpanel_session:Secure,HttpOnly,SameSite=Strict,Path=/and noDomain, so no other host and no plain-HTTP page can set or overwrite it. A cookie under the old nameownpanel_sessionis ignored over HTTPS and removed. Plain HTTP (local development) usesownpanel_session. - Changing your own password or e-mail address needs the current password, so a sign-in left open on someone else's device cannot take over the account by redirecting the links for a new password. Wrong guesses count toward the same limit of 5 per account. Admins change other people's addresses without it.
- Changing a password ends the person's other sessions; a password set by an admin or chosen with a link ends all of them. Sign out everywhere (account menu, or
POST /api/account/logout-everywhere) ends all of them, the current one included. - A sign-in for a name that does not exist takes as long as one with a wrong password, and the message is the same.
- Forgot password is offered only when the panel can send e-mail through its own mail server. The link goes only to the e-mail address stored for the person, and not at all when that address is in a mail domain of this panel that belongs to another member (it is then treated like an unknown address and admins see it in the activity log), works once and for 1 hour, and only a hash of it is stored. Asking for a link answers the same whether or not the address exists; links are limited to 3 per address and 20 requests per network address per hour. The link points at the panel domain as it is set when the link is requested, never at an address taken from the request.
- Failed sign-ins are throttled: 5 per account from any address, and 20 per address across all names, in 15 minutes (counted per address as given; the setup code and the mail service count IPv6 per /48). Successful sign-ins do not count, so many people can sign in from one shared address. The counts are kept in the database, so a restart does not reset them. At most 16 password checks run at the same time; further sign-ins are turned away (
429) instead of piling up memory (Users and Access). - The first admin can only be created with a one-time setup code, kept in a file only the daemon's user can read, and compared in constant time. Once someone exists, setup is closed.
-
Changing requests made with the cookie must carry the header
X-Ownpanel-Request: 1, which other web sites cannot send without a CORS preflight, and the API never allows CORS. A mismatchingOriginis refused as well. -
The web interface is served with
X-Frame-Options: DENY,X-Content-Type-Options: nosniffandReferrer-Policy: no-referrer. API answers areno-store. -
The web interface has a strict Content Security Policy:
default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'Scripts and style sheets only come from the panel itself; nothing inline is allowed, neither scripts nor styles, and there is no
'unsafe-inline'or'unsafe-eval'. The page has no inline script. The UI library adds its CSS as constructed style sheets (an emptycsp-noncetag inindex.htmlasks for that), which the policy does not block, so no nonce is needed.data:images are the small icons inside the panel's own style sheet. If someone managed to inject markup into the page, the browser would refuse to run scripts from it or send data to other sites. -
API answers carry
Content-Security-Policy: default-src 'none'; frame-ancestors 'none'andnosniff, so an answer opened directly in the browser can neither load nor run anything. Site icons get their own policy that allows only the icon's inline styles. -
MCP does not accept cookies at all, and refuses cross-site browser requests.
- Tokens start with
op_and are shown once. Only their SHA-256 hash is stored. - A token can be read-only and limited to chosen sites, and never has more rights than its user. Revoking works at once.
- A token can expire (30, 90 or 365 days, or never; the web interface suggests 90 days). An expired token is refused exactly like an unknown one.
- Tokens cannot create tokens or change passwords, and managing users needs an admin with a password sign-in or an unrestricted
writetoken (Users and Access). - Sites you may not see answer "not found", so names do not leak.
- Permission checks live in one place,
internal/panel; the API and MCP only authenticate and translate (Architecture).
Archives are treated as untrusted. Only regular files and folders are accepted (no links), entry names are checked, writes cannot leave the version's directory, and the size and entry limits are enforced on the bytes actually read, including ignored entries. A zip's entry count is checked before its directory is loaded, so a large upload cannot make the panel hold its whole list of entries in memory. See Sites and Publishing.
- Caddy runs as its own system user. Its admin API is a Unix socket (never TCP), with mode 0660 in a directory only the
caddygroup can enter; only ownpaneld's user is in that group. On TCP, every local user could rewrite the web server's config. - ownpaneld runs as its own, unprivileged user with
NoNewPrivileges,PrivateTmp,ProtectSystem=fullandProtectHome=true. Caddy's data directories are mode 0700. - The database file is created with mode 0600.
Time limits keep a slow or stalled client from holding connections open. Caddy applies them to everyone (sites and the panel share one server, so they suit both: large downloads and 512 MB uploads on slow links keep working as long as data keeps flowing):
| Caddy (every server) | Value |
|---|---|
| Request headers complete | 10 s |
| Request body stalls (no data arrives) | 1 min |
| Whole request, including the body | 1 h (512 MB at about 1.2 Mbit/s) |
| Response stalls (the client reads nothing) | 1 min |
| Kept-alive connection without a request | 2 min |
There is no limit on the whole response, so slow downloads of large files are not cut off; only a stalled one is.
Between Caddy and the panel: connecting 5 s; waiting for the panel's answer after the request has been passed on 10 min (time to unpack and publish an archive).
ownpaneld has its own limits, also when it is reached directly: request headers 10 s, a whole request 1 min, until the response is written 5 min, kept-alive connections 3 min (longer than Caddy keeps its idle connections to the panel, so Caddy closes them first). Archive uploads (POST /api/sites/{name}/deployments, upload links) and MCP requests get 1 h to arrive and 1 h 10 min until the answer.
Updating replaces binaries and restarts services, which needs root; the panel runs as ownpanel and must not get root. So the two only talk through files:
- The panel may only ask: it writes
request.json(orauto.jsonfor automatic updates) into/var/lib/ownpanel-update/requests. That directory isroot:ownpanelwith mode 1770 (sticky) inside the root-owned/var/lib/ownpanel-update, so the panel can create its own files but cannot replace or delete the status file root writes there, nor the directory itself. - Root never works by path inside a directory the panel's user owns. The panel's data directory
/var/lib/ownpanelbelongs toownpanel, which could put a link at any name in it; so what root manages during an install or update lives elsewhere: the update requests and the backups in/var/lib/ownpanel-update, Caddy's certificates and home in/var/lib/ownpanel-caddy(owned bycaddy). The backup before an update copies the database asownpaneland writes the archive only into root's own directory. -
ownpanel-update.service(root, started by a path unit or a timer) first moves the request into a root-only directory, so it cannot be swapped for a link afterwards, then refuses anything that is not a small regular file owned byownpanel(a file of any other owner, root included, is refused) and does not match exactly{"id":"<32 hex>","channel":"stable|nightly"}or{"id":"<32 hex>","version":"vX.Y.Z"}. The content of a refused request is never echoed. Only those values are passed toupdate.sh. - Root writes
status.jsonby creating a new file and renaming it into place (mode 0640, groupownpanel), never by opening an existing file the panel could have prepared.auto.jsonis read asownpanelwith a time limit, so a link or a pipe there gains nothing. - What gets installed is decided by GitHub's release and
checksums.txt, downloaded by asset id, and the archive'sVERSIONmust match; the panel can only choose the channel or a version name. - Only admins (signed in, or with an unrestricted write token) can request updates or change automatic updates; read-only and site-limited tokens cannot. Every request and every result is in the activity log.
- The update unit runs with
NoNewPrivileges,PrivateTmp,PrivateDevices,ProtectHome,ProtectKernelModules,ProtectKernelLogs,ProtectControlGroups,ProtectClock,ProtectHostname,RestrictSUIDSGID,RestrictNamespaces,RestrictRealtime,LockPersonality, native system calls only and a short list of address families. It cannot useProtectSystemor a capability limit: an update writes to/usr/local,/etc/systemd/systemand/etc/ownpanel, may create users and open the firewall, just likeinstall.sh.
Sites will be built on the server from their source (#58). A build runs code nobody reviewed: the site's own build scripts and every package they download. This section describes the environment builds run in (issue #112) and how the panel publishes what they produce (#113). Builds start from a push to a site's linked repository, from Build now, or (administrators only) from an uploaded source archive. The owner of a site chooses its build command: the isolation below is what makes that safe for the server and the other sites.
Threat model. We assume the build command and everything it runs are hostile and try to read the panel's data or other sites, reach the server's own services or the networks behind it, use up the server's processors, memory, processes or disk, outlive their time, leave something behind, or publish files from outside their folder. We do not protect a site's build from itself: its own source, its own variables and its own cache are its to use.
How builds are run.
- Each build runs in a container of its own, with rootless Podman, started by the build service
ownpanel-build.serviceas the system userownpanel-build: not the panel's user, not root. Root inside the container isownpanel-buildoutside; every other user inside is an id from its own range of 65536 subordinate ids (/etc/subuid). The panel never runs anything as root and has no sudo rule. - The panel talks to the build service only through a Unix socket (
/run/ownpanel-build/worker.sock, mode 0660 in a 0750 directory; the userownpanelis in the groupownpanel-build). It can say: build number N for this site, with this image name from a fixed list, this command, these variables and these limits (lowered to the server's maxima); here is the source tree; start, cancel, status, log, output. It cannot name a path, a mount, an image of its own, or an option of Podman. The service builds Podman's command line from fixed text, numbers and paths of its own, and runs Podman directly (no shell). The command and the variables are files in the container, never part of a command line. - Everything root has to do is done by
install.sh/update.shand byownpanel-build-setup.service, a root unit they install: the build disk, its quotas and the packet filter below. The build service is bound to that unit and never runs without it.
| Property | How it is enforced | Checked by |
|---|---|---|
A build cannot read the panel's data directory, secret.key, the database, the mail and Caddy data, other sites or the sockets of the panel, Caddy, the mail service, the build service or Podman |
The container sees only its image, its workspace, its site's cache and its own control files. The build service's own mount namespace makes the panel's, Caddy's, the mail service's and the updater's directories and /etc/ownpanel inaccessible (InaccessiblePaths=), so not even the service could hand them on. Podman runs without an API socket |
TestBuildCannotReadPanelData (looks for every path and for a file with the secret key's checksum, from inside; checks the service's namespace from outside) |
| Other builds and other sites' caches are out of reach | One workspace per slot, emptied after every build and when the service starts; one cache per site, mounted only into that site's builds |
TestBuildCacheIsolation, TestCachesPerSiteAndEviction
|
| No capabilities, no privilege gain, no devices, no host namespaces |
--cap-drop all, no-new-privileges, Podman's system call filter, read-only root file system (/tmp, /run are memory file systems), workspace and cache mounted nosuid,nodev, own process, network, IPC, UTS and cgroup namespaces, never --privileged, no devices besides the usual pseudo devices (also limited by the service's device policy) |
TestBuildPrivileges (capability sets 0, NoNewPrivs 1, Seccomp 2, mknod and mount refused, root file system read-only, the build's processes run as ownpanel-build on the server) |
| Processor, memory (swap included), processes | The service's control group is delegated to it (Delegate=yes); each container gets cpu.max, memory.max with memory.swap.max 0, and pids.max from the kernel. Defaults 2 CPUs, 2 GB, 1024 processes; maxima 4 CPUs, 4 GB (at most half the server's memory), 2048 |
TestBuildForkBomb, TestBuildMemoryLimit
|
| Disk | Everything of builds is on the build disk: a file of fixed size (15 % of the disk, 8 to 32 GB by default), reserved in full when it is made, mounted nosuid,nodev with project quotas. Builds together can never use more of the server's disk. Inside it, the kernel limits each slot's workspace (4 GB by default), each site's cache (1 GB), the images, the waiting sources and the kept results. The build service may give its folders a project but only root sets quotas, and nothing inside a container can change a file's project. Memory file systems (/tmp) count against the memory limit |
TestBuildDiskLimit (writes 500 GB and fills workspace and cache; the server's free space does not move) |
| Time | The service kills the container at the time limit (default 15 minutes, at most an hour) with SIGKILL and then every process left in its control group with cgroup.kill; Podman has its own hard stop 60 s later as a backstop |
TestBuildTimeLimit (a build that ignores signals and starts detached children) |
| Log size | The log is cut at its limit (2 MB, at most 4 MB); what a build prints never goes to the journal (Podman's log driver is none) |
TestLogLimitAndFollow |
| Network | Builds have their own network stack in user space (slirp4netns, without access to the server's loopback). Root's packet filter (an nftables table of its own, tied to ownpanel-build's user id and its subordinate ids, so it covers every connection a build can make) refuses every address of the server, loopback, private, carrier-grade NAT, link-local (cloud metadata), multicast and reserved ranges (IPv4 and IPv6) and port 25. Only DNS to the server's own resolvers is let through (the real ones: with systemd-resolved, those behind its local stub; public ones when the server only names a resolver on itself). The build service fetches the images through the same filter, with those resolvers as its /etc/resolv.conf, and ownpanel-build-resolvers.path sets filter and resolvers again when the server's resolvers change. The build service tests the filter before every build and every 5 s during it; without it no build starts and running ones are stopped. Restarting nftables puts it back |
TestBuildNetwork (the panel, a service on every server address, loopback via the user-space network, 169.254.169.254, private ranges and port 25 refused; a public HTTPS server and the npm registry reachable), TestBuildWithoutFilter
|
| Source and output are untrusted | The source is checked when it arrives and unpacked through os.Root: only files, folders and links, no .. or absolute names, nothing written through a link, no devices, owners or set-user-ID bits, size and count limits on the bytes read. The output is packed through os.Root too: only plain files and folders (a link, a device or a pipe fails the build), modes 0644/0755, no owners, size and count limits, and only after every process of the build is gone. It then goes through the same checks as an uploaded archive |
TestBuildOutputEscape, TestBuildHostileSource, TestUnpackSource, TestPackOutput
|
| Secrets in variables | Never on a command line (they are in a file only the build user can read, removed right after the build), never in the service's log, error messages or the activity log; their values (4 characters and longer) are replaced with *** in the build's log |
TestBuildSecrets (searches every process's command line, the system journal and the build disk; checks that only the build user can read the variables), TestMasker
|
| Images | A fixed list in the release, pinned by digest (official Node images from Docker Hub); a build names one, never a reference. The service fetches what is missing when it starts and removes everything else; a new release moves the list forward |
TestBuildImages, TestImagesArePinned
|
| The panel publishes only what a successful build produced | The panel fetches the output only after the build succeeded, reads at most the output limit plus room for the archive's headers, and publishes it through the same unpacking as an upload (os.Root, plain files and folders only, size and count limits, a new version appears only when it is complete). A failed, cancelled or timed-out build, and an output that fails these checks, adds no version and leaves the live one as it is. Whatever happens, the build is removed from the build service afterwards; at its start the panel removes builds of an earlier run of itself |
TestBuildSiteUntrustedOutput, TestBuildSiteFails, TestBuildSiteTimeout, TestBuildSiteCancelled, TestRemoveStaleBuilds
|
| Secrets in the panel | The panel passes secrets to the build service and keeps them only for the length of the request. Build settings print without their command and variables; activity entries name the site, the version or the failure reason only; error messages name variables, never their values. The end of the log in an answer has the secrets blanked out again by the panel, and is left out when a secret is too short to be blanked out |
TestBuildSiteFails, TestBuildSiteRefusals, TestBuildSiteRoute, TestBuildSiteTool
|
| A site's build settings and output | The variables of a site's build settings are stored encrypted as a whole with secret.key (purpose ownpanel site build variables); secret values are never returned by the API, MCP or the web interface, only their names. The panel keeps each run's output (at most 1 MB, plus the last 64 KB of a longer one) with the run and removes it with the run; secret values (each line of a secret of several lines, 4 characters and longer) are blanked out again by the panel as the output arrives, and no output is kept when a secret is too short to be blanked out. Who may see the site may read its runs' output; who may change the site may change its settings and start or cancel builds |
TestRunnerBuildsAPushAndPublishes, TestBuildSettings, TestRunLogLimits, TestBuildNowLiveLogAndCancel
|
| Sources from GitHub | The commit is downloaded with a token that may only read the contents of that one repository, valid at most an hour, never stored or logged. GitHub answers with a redirect to a download address that carries its own short-lived credentials: the token is never sent there, the address must be https, and it is never logged or put into an error. The download is limited in size (the source limit) and time (15 minutes) and goes to the build service, which checks it like any source. A run fails when the site is linked to another repository by then |
TestTarball, TestTarballRedirects, TestRunnerSourceChecks
|
| Untrusted builds get a cache of their own | A build marked untrusted (a pull request from a fork) gets an empty cache folder in its slot (the slot's quota, emptied with the slot) instead of the site's cache, and no variables |
TestUntrustedBuildCache, TestPullRequestFromFork
|
| Nothing is left behind | Every build runs below the service's control group: stopping or crashing it kills them all; at start the service removes all its containers and empties workspaces, waiting sources and results. Parallel builds are limited (1 or 2 slots by default, one per site) |
TestBuildServiceRestart (restart and kill -9) |
What is not protected, or not enforceable.
- Builds can reach the Internet. Package registries need it, so a build can send its own source, its own variables and its own cache anywhere, and could attack other servers on the Internet, including other public servers of yours. Only this server, private networks and port 25 are closed.
- DNS to the server's resolvers is allowed, even when they are on a private address. A build can ask them about names; it cannot connect to what they answer when that is private.
-
The kernel is shared. A kernel bug that lets a process out of its container would leave the build as the unprivileged user
ownpanel-build, inside the build service's mount namespace (no panel data visible), but a further kernel bug could go further. Keep the server's kernel updated. -
The build service itself is less hardened than the mail service: rootless Podman needs the set-user-ID helpers
newuidmap/newgidmapand user namespaces, soNoNewPrivileges=, system call filters andRestrictNamespaces=cannot be set on the unit; each container gets them instead. -
A build can see the paths of the image layers in
/proc/self/mounts(that is how overlay mounts look), not their contents beyond its own image. - Masking secrets in the log is a courtesy, not a barrier: a build can print a secret in another form (reversed, encoded). Secrets are given to the build on purpose; only give a build the secrets it needs.
- The images are trusted as far as Docker's official images are: they are pinned by digest, but not built by ownpanel.
-
Not tested on a real Ubuntu 24.04 kernel with AppArmor's restriction of user namespaces (
kernel.apparmor_restrict_unprivileged_userns=1). If it blocks rootless Podman, the build service reports builds as unavailable; it does not run them unprotected.
- DNS API tokens, the secrets of GitHub connections, the variables of sites' build settings, the private halves of sites' deploy keys and the secrets of their notification addresses are stored encrypted (AES-256-GCM) with a key in
secret.key(mode 0600), never in the database. The API never returns them, and they are scrubbed from error messages and left out of the activity log. See DNS. - Passwords, session secrets and access tokens are never written to the log.
- A backup contains the database and the key together, so it must be protected like the server.
Administrators connect GitHub accounts and organisations through an app the panel creates on GitHub (GitHub).
-
What is stored: per connected account, the app's id, name, owner and address, and three secrets: its private key (signs the panel's requests as the app), its secret for signing GitHub's notices and its client secret (unused so far). The three are encrypted with
secret.keybefore they reach the database, like DNS tokens, are never returned by the API or MCP, and never appear in the log, the activity log or error messages. Also stored: where the app is installed and how many repositories each installation sees, as GitHub last reported. -
Not stored: the short-lived tokens the panel asks GitHub for (at most an hour, narrowed to one use: listing repositories may only read metadata, fetching code may only read the contents of one repository, reporting a build may only write the commit statuses of one repository, reporting a preview may only write the commit statuses and pull requests of one repository), and the signed requests (JWT, at most 10 minutes) it makes as the app. They are printed as
[redacted]if code ever tries to log them. - What the app may do on GitHub: read the contents and metadata of the repositories you chose, write commit statuses and pull requests (the panel only reads pull requests and writes one comment of its own on them). It cannot push code or change settings. It is a private app: only the account that owns it can install it, so no stranger can install it and push their repositories into your panel.
-
A copy of the database without
secret.keyreveals which GitHub accounts are connected, the apps' names and ids, and where they are installed. It does not reveal the keys: withoutsecret.keynobody can act as the app. A copy of the database withsecret.key(for example a backup) lets someone act as the app until you delete it on GitHub or create a new private key there: read the chosen repositories, write commit statuses and comment on pull requests. -
The way back from GitHub: GitHub sends the browser back to the panel with a one-time code (valid for an hour) and the panel's
state. That request comes from another site, so the browser leaves out the session cookie (SameSite=Strict). The panel therefore changes nothing on it: it only checks the shape of the values and redirects to a fixed address of its own web app, the values in the address' fragment (which reaches neither a server log nor another site; the app removes them at once). The app then sends them in an ordinary request with the session and theX-Ownpanel-Requestheader, and the panel checks that thestatewas made for this very sign-in, is unused and at most 20 minutes old before it exchanges the code. A forged or replayed return, one started by another person or in another browser, or one with a usedstateis refused, and there is no open redirect. - Builds from a repository run only for runs the panel recorded itself (a signed push or pull request notice, or Build now by someone who may change the site), always with the commit id recorded in the run, fetched from the repository the site is linked to at build time. To GitHub the panel reports the result as a commit status, with a link to the site page, and for pull requests in one comment of its own.
-
Pull requests are built as previews that are not live (GitHub). A pull request from the same repository is trusted like a push to it: whoever can open one can push to the repository. It gets the site's variables and cache. A pull request from a fork (GitHub's id of its head repository differs from the base repository's) is built only when the site switched it on, and then without any of the site's variables and with an empty cache of its own in its build slot, removed with the slot (
build.Spec.Untrusted), so it can neither read the site's secrets nor leave something in the cache for a later build that has them. The build service decides the cache from the request; the panel never asks for a fork's build with variables. Whether the site still wants the pull request built is checked again when the runner takes the run. Closing a pull request cancels its runs and removes its previews (never the live version); tagged previews have their own cap, so pull requests cannot push out the live version or the one to go back to. - The preview's key on GitHub: the panel's comment and status carry the preview link with its key only on pull requests of private repositories, asked of GitHub with the panel's own token when it posts (an error counts as public). On public repositories they link to the run in the panel, which shows the preview link only to those who may see the site. A repository made public loses all its pull requests' previews, so keys posted while it was private stop working. The comment contains nothing a pull request supplies (no title, no build output, no failure reason), so a pull request cannot put text or links into the panel's comment. The panel only ever changes a comment written by its own app's bot that carries its marker.
-
Proposing build settings downloads the newest commit of the linked branch (at most 256 MB, 2 minutes) and keeps only the plain files at its top (at most 2000, each up to 1 MB) in a temporary folder that is removed afterwards; links and everything deeper are skipped, and the files are read through
os.Root, as text, never run. - Linking a site to a repository: the ids a client sends prove nothing by themselves. The panel links only a repository the installation currently shares (asked of GitHub as the app), only for administrators (members get "not found", as for a repository that does not exist), and only a branch that exists and passes Git's naming rules, checked before anything reaches GitHub. The link stores GitHub's repository id and the branch, no token.
-
Installations: the
installation_idGitHub puts into the address proves nothing. The panel only records it with a validstate, and only after GitHub, asked as the very app of thatstate, confirms the installation is its own. Changes made on GitHub without coming from the panel only lead to asking GitHub afresh. -
GitHub's notices (
POST /api/github/webhook) come without a session or token; the only proof is the signature. The panel checks, in this order: the method andContent-Type: application/json; the size, read with a hard limit of 5 MB before anything else (at most 8 notices are read at a time); an overall rate limit (bursts of 300, then 10 per second); the app named inX-GitHub-Hook-Installation-Target-ID; the HMAC-SHA256 signature inX-Hub-Signature-256over the raw body, with that app's secret, compared in constant time; a rate limit per app (bursts of 120, then 2 per second, counting only correctly signed notices); the delivery id; and only then the JSON, strictly (one object, the expected types, valid UTF-8). An unknown app, a wrong or missing signature and a malformed notice all get the same400answer, and an unknown app costs the same work as a wrong signature, so the answer tells nothing about which apps or repositories exist. The notice is handled within the request (only a few database writes, never a request to GitHub), well inside GitHub's 10 seconds; building happens elsewhere. The answer contains nothing of the notice. -
Replayed notices: the panel remembers the
X-GitHub-Deliveryid of every notice it accepted for seven days (at most 200,000 ids) and ignores one that comes again. GitHub keeps that id when someone redelivers a notice: a redelivery of a notice the panel had not accepted (it failed on the panel's side) is handled, one it had accepted is ignored. A push older than seven days is ignored too, so an old notice replayed after its id was forgotten cannot bring back an old commit. - What a notice can do: only what its app may see. A push or pull request creates runs only for sites linked to that repository (by GitHub's numeric id) through an installation of the same app that signed it, and a pull request only when its base repository is that repository; a notice about another app's installation is ignored. Commit message, pull request title, author and pusher are untrusted text: cut to their first line and a fixed length, stripped of control and formatting characters (which could reorder what is shown), stored and shown as text, never as markup. Nothing of a notice (signature, body, message) is written to the log or the activity log; the log names only the delivery id, the event, the connection and the result.
-
The page that sends you to GitHub is the one page of the panel that posts a form elsewhere. It has its own content security policy: one script by hash, forms only to GitHub, nothing else. The rest of the panel keeps
form-action 'self'. - Members cannot see the connections or list or use their repositories; to them such a repository looks like one that does not exist.
Sites can take their code from any Git repository by its address (Git repositories). The address, the server it names, everything the server sends and the files of the repository are untrusted.
Where the repository is fetched. In the panel, by its own code (internal/gitsource), which speaks the fetch side of Git's protocol itself: it never runs git, ssh or any other program, so there is no command line to inject into, no configuration, hooks, filters, submodules or helpers of an installed Git, and the deploy key never touches the disk unencrypted. The alternatives were weighed: running the git binary would need the private key in a file and trusts Git's large client with a hostile server; fetching inside the build service would hand the deploy key to the service that runs unreviewed code. The panel holds the key, so the key is used in the panel's memory, for one connection at a time. No new dependency was needed: SSH comes from golang.org/x/crypto/ssh, which the panel already used.
-
Addresses are SSH (
git@host:owner/repo.git,ssh://user@host:port/path) or HTTPS only. Refused: local paths,file://,ext::and every other transport, plainhttp://andgit://, user names, passwords or tokens in HTTPS addresses, queries, fragments, percent-encoding, spaces, quotes and shell characters, non-ASCII, any part (user, host, path segment) that starts with-,.and..segments, host names without a dot or underlocalhost,local,internal,testand similar, numeric host spellings like2130706433or127.1, and IP addresses that are not public. - Only public servers. The address a name resolves to is checked when the connection is made, after resolving (the check sits in the connection itself), against the same list the mail service uses: loopback, private, carrier-grade NAT, link-local (cloud metadata), multicast, documentation and reserved ranges, IPv4 and IPv6, NAT64 forms included, and the server's own addresses (those set as its public addresses and those of its network interfaces). A name that resolves to the server's own network a moment later gains nothing. HTTPS follows redirects only to HTTPS on the same host and uses no proxy.
-
Server keys are pinned per site. Linking shows the fingerprint (
SHA256:…) of the key the server shows and links only with the fingerprint the person confirmed, after asking the server again. Every later connection must show exactly that key, with the algorithms of that key only; anything else ends the connection before authentication, so the deploy key's signature never reaches a server pretending to be the Git host. The site then shows the old and the new fingerprint; trusting the new key needs the right to change the site and the fingerprint the server shows at that moment. Old algorithms (ssh-rsawith SHA-1, DSA) are not offered. -
Deploy keys are Ed25519 key pairs made per site with the system's random source; the private half is sealed with
secret.keyunder its own purpose and opened only in memory for a connection. The public half is shown to copy (it is not secret). Make a new key replaces it at once. - Limits on a fetch: 10 minutes in all (15 s to connect, 45 s for a check), and every step (reading the pack, walking the folders, checking links, packing the files) stops when the time is up; 1 GB of everything the server sends after the list of branches, counted on the raw connection (progress messages and empty packets included); 1.5 GB of objects unpacked into a temporary file; 300,000 objects; 100 MB per object; 100,000 files, folders and submodules with 1 GB of files together; 128 MB of folder listings read while walking, counted every time a listing is named (a small pack can name one large folder from thousands of places); 64 levels of folders; paths of 4096 characters. Only the one commit the branch points at is asked for, with a depth of 1. Object ids are computed by the panel, the pack's checksum is checked, and deltas must stay inside their base and their announced size (memory grows with what a delta writes, not with what it announces).
-
Temporary files (the unpacked objects and the tar.gz handed to the build) live in
tmp/in the panel's data directory (/var/lib/ownpanel/tmp, mode 0700), on its disk rather than in a memory file system, and are removed when the fetch or the build ends; the directory is emptied whenever the panel starts. At most about 2.5 GB per fetch. - How many at once: at most two fetches in the whole panel and one per site; at most four checks (fetching a server key, asking for branches, after a notification) in the whole panel and two per person or site at a time; a check waits at most 20 seconds for a free place and is then refused as busy.
-
The files handed to a build are a tar.gz of plain files (modes 0644 and 0755), folders (0755) and links, with no owners and fixed times. Names Git itself refuses (empty,
.,.., containing/or a zero byte,.gitin any case), names with control characters and the same name twice in a folder (also in different case) fail the fetch. Links must stay inside the tree: absolute targets fail, and so do targets that leave the tree when resolved through the tree's own folders and links (a link to a link to..), and loops (more than 40 links in a row). Checking them is bounded: a target has at most 256 parts, the different targets together at most 16 MB, and resolving all links through each other at most a fixed amount of work per fetch, whatever the links do; a tree that needs more is refused. Submodules are left out; the panel never fetches other repositories. The build service checks the tree again when it arrives (Builds). - Only the branch's current commit is built. A notification only tells the panel that the branch changed: the panel asks the repository where the branch points and records a run of that commit, and a build fetches the commit the branch points at when it runs and fails if that is not the run's commit. So neither a notification nor anyone else can make the panel build an older or foreign commit.
- What servers say (error messages) is cut to one line of 200 characters without control or formatting characters before it is shown or stored, and never written to the log.
- Rate limits: checks that connect to Git servers (checking an address, linking, checking access, trusting a key) are limited per person: bursts of 20, then one every 5 seconds. They connect only to the host and port of the address and speak only SSH or HTTPS; a person can learn whether a public host answers on a port, nothing more.
Notification addresses (POST /api/git/notify/<id>) come without a session or token. The id is 128 random bits; the secret is 256 random bits, sealed with secret.key, shown once and never returned again (not through MCP either). The panel checks, in this order: the method and Content-Type: application/json; the size, read with a hard limit of 5 MB (at most 8 notifications and GitHub deliveries are read at a time); an overall rate limit (bursts of 300, then 10 per second); the address; the proof, in every form the hosts use, all compared in constant time: an HMAC-SHA256 of the raw body in X-Hub-Signature-256 or X-Hub-Signature (sha256= only; a SHA-1 signature, which Gitea, Forgejo and GitHub send next to their SHA-256 one, is ignored, never trusted), X-Gitea-Signature, X-Forgejo-Signature or X-Gogs-Signature, or the secret itself in X-Gitlab-Token (hashed before comparing, so its length tells nothing). At least one must be there and every one that is there must be right. Then a rate limit per address (bursts of 60, then one per second, counting only proven notifications); the delivery id (X-GitHub-Delivery, X-Gitea-Delivery, X-Forgejo-Delivery, X-Gogs-Delivery, X-Gitlab-Event-UUID, X-Request-UUID or X-Request-Id), which is required (every supported host sends one): one already accepted for the address in the last seven days is ignored; and only then the JSON, strictly. An unknown address, a wrong or missing proof and a malformed body get the same 400, and an unknown address costs the same work as a wrong proof. A notification can only make the panel look at its own site's linked branch, once more for several that arrive together, off the request (the host gets its answer at once): the panel asks the repository where the branch points and records a run of that commit, unless the site's newest run that makes a version live (previews of pull requests do not count) is already of that commit and waiting, building or published. The commit a notification names is never built; its message and names are shown only when it names the commit the panel found, as untrusted text treated like GitHub's (GitHub). Nothing of a notification is written to the log beyond the site, the delivery id, the event and the result.
What is not protected.
- GitLab's token is the secret itself, sent with every notification over HTTPS; GitLab signs nothing. Anyone who can read the notification (the Git host, a proxy in between that ends TLS) can send further ones. They can only make the panel look at that site's branch again, which builds nothing new unless the branch changed.
-
Old self-hosted versions that send no delivery id (GitLab before
X-Gitlab-Event-UUID, for example) are refused; there is no way to accept them without losing replay protection. - The first fingerprint is only as good as the person's comparison. The panel shows it; checking it against what the Git host publishes is up to the person.
- Members may make the panel connect to any public SSH or HTTPS server of their choosing (within the rate limit), as they may make it fetch any public repository.
- A fetch writes up to about 2.5 GB of temporary files in the data directory, at most two at a time; keep that much free there.
-
The panel's service has no memory limit of its own (
MemoryMax=): it also unpacks uploads and build outputs, and a limit that is safe for every existing server was not settled. The fetch limits above bound what a repository can make it use. - Memory: a fetch holds one object at a time, but resolving a delta needs the base, the delta and the result together, up to about 300 MB with the limit of 100 MB per object; two fetches may run at once. Before the pack, the panel reads at most 32 MB of branch and tag names for a fetch and 8 MB for a check, keeping only the branches it needs (one, or the first 1000 to list them), and 256 KB of other lines.
- SHA-256 repositories are not supported (refused, not misread).
- The mail server runs as its own service and user (
ownpanel-mail) with its own data in/var/lib/ownpanel-mail(0700). It cannot read the panel's database orsecret.key; the panel cannot read stored mail. They talk only through a local socket of the groupownpanel-mail. Caddy reaches the mail service only through a second socket,/run/ownpanel-mail-web/web.sock(groupownpanel-mail-web, of which onlycaddyis a member), which serves the mailbox users' account pages and nothing of the admin API;X-Forwarded-Foris trusted only there. The unit keeps only the capability to open ports below 1024, with a read-only system and no access to home directories. - Mailbox passwords are argon2id hashes; mail programs sign in only over encrypted connections. Failed sign-ins are limited per address and network and per network, never per address alone (that would let anyone lock a mailbox). Unknown addresses take as long as wrong passwords.
- DKIM keys are stored encrypted with
secret.key. Password hashes and keys never appear in API answers, logs or the activity log. -
App passwords (
op_<id>_<secret>, 160 random bits of secret) are shown once when created and never stored readable: the panel keeps only an HMAC-SHA-256 of the secret, bound to the mailbox and the id, under a server key that the panel makes once and keeps encrypted withsecret.key. The panel pushes the key and the HMACs to the mail service, which looks an app password up by its id and checks it with one HMAC in constant time (never a slow password hash, so the time tells nothing about how many exist). They work for mail programs only. A revoked app password stops working at once, including in open connections. Their last use is recorded with the network only (/24 or /48), at most once an hour. No MCP tool creates, shows or revokes them, and neither app passwords nor their HMACs appear in answers after creation, logs or the activity log. A main password that looks like an app password is refused. - Only allow mail programs with app passwords makes the mailbox's own password useless in mail programs; open connections signed in with it end.
-
The mailbox's own page (
https://<mail server name>/) is served by the mail service itself, not the panel: the panel only delivers the page's files and keeps no mailbox sessions, so a mistake in the panel cannot reach another mailbox. Only the mailbox password signs in there, never an app password, also with "only app passwords" on. Sign-ins have their own throttle (5 failures per address and network, 30 per network, in 15 minutes; IPv6 per /48; when the tables are full new sign-ins are refused) and their own password-check slot, so a flood there cannot slow mail programs, nor the other way round. Sessions are kept in the mail service's database as a SHA-256 hash of a random 256-bit id; the cookie__Host-ownpanel_mailboxisSecure,HttpOnly,SameSite=Strict,Path=/. A session ends after 30 minutes without use, after 12 hours in any case, on sign-out, and at once when the mailbox is deleted or its password is no longer the one it signed in with (changed on another device, or reset in the panel). Changing requests needX-Ownpanel-Request: 1and are refused whenOriginorSec-Fetch-Sitenames another site; changes are limited to 30 per session in 15 minutes, request bodies to 16 KiB (256 KiB for filters). Changing the password needs the current one. Changes reach the panel as events with the new hash or HMAC only; a new app password is returned once and never stored, logged or reported. -
Calendars and contacts (
https://<mail server name>/dav/) are served by the mail service on the same web socket as the mailbox's own page. Programs sign in on every request with HTTP Basic over the TLS connection Caddy terminates (nothing is ever sent unencrypted; the mail service is reached only through its Unix socket). The same rules as IMAP and SMTP apply: the full address with the mailbox password (not when Only allow mail programs with app passwords is on) or an app password, checked by the same sign-in check with its throttle (5 failures per address and network, 30 per network, in 15 minutes; IPv6 per /48) and its cache, so a revoked app password or a new password stops working on the next request. Requests are limited to 3000 per mailbox in 5 minutes. A mailbox sees only its own calendars and address books, and the read-only directory of its own organisation; paths of other mailboxes answer404(the check sits in one place, so sharing can be added there later). Uploaded entries are parsed and checked before they are stored (1 MB each, one entry per resource, time zones resolved without loading anything from outside); request bodies are XML of at most 1 MB with at most 32 levels and 20 000 elements, document type declarations refused, entities never loaded; recurring entries are expanded at most 20 000 times and 20 years ahead. - A reset in the panel wins at once: when an administrator resets a mailbox's password (or changes its name or the "only app passwords" switch), the push tells the mail service when, and it drops what the mailbox changed itself before that moment, even if the panel has not seen that change yet. A change of one of these never undoes the mailbox's own change of another (an administrator renaming a mailbox does not bring back a password the mailbox replaced).
- One mailbox cannot stop mail for everyone: data of a single domain, mailbox or alias that the mail service would refuse is left out of the push (and logged) instead of stopping every update. The mailbox users' sign-in page failing to start never takes SMTP or IMAP down; Mail health shows it.
- Organisations are pushed to the mail service as random ids that say nothing about who owns the domains. Only administrators can group domains of different owners, and the activity log records it; the check and the change happen together. A member sees in their organisations only the domains they may see.
-
Filters and out-of-office are the person's data in the mail service; the panel never stores them. Filter scripts are untrusted input: at most 10 per mailbox of 64 KiB each, checked when saved, and run by an interpreter of the mail service's own (no outside program) with a step limit, a time limit of 2 seconds, at most 100 actions, regular expressions of at most 1 KiB in Go's linear-time engine, and at most 1 MiB of a message's text for body tests. A filter that fails keeps the message. Refusing mail after it was accepted (
reject) is not offered, so filters cannot make the server send bounces to forged senders. Forwarding by filters is never done for spam or mail that failed DMARC, goes to at most 5 addresses per message, uses a rewritten return address and the domain's hourly limit, never goes to the mailbox's own addresses, stops loops (a marker that does not reveal the address,Delivered-To, a hop limit), and can be turned off per mailbox by the domain's owner. Out-of-office replies follow RFC 3834 (no replies to lists, automatic mail, the empty sender, spam or unconfirmed senders; once per sender and period; sent with the empty sender), count against the mailbox's sending limit and, when it is reached, are skipped without counting towards blocking the mailbox. The domain's owner can set or clear out-of-office and forwarding (logged; the person sees who), and sees whether a reply is on, not the text the person wrote. The ManageSieve port (4190) needs encryption (STARTTLS) before sign-in and uses the same sign-in and throttle as IMAP, so app passwords work there and "only app passwords" applies. A shared mailbox has no password: people with the Manage right on it change its filters with their own sign-in (the self-service page's?mailbox=, ManageSieve's authorization identity). The right is checked on every request and command against the current grants, which never cross an organisation; without it the mailbox answers "not found", and on ManageSieve the right is only looked at after a correct password. - A domain receives mail only once its MX record points at the mail server (or an administrator says so), so nobody can catch mail sent from this server to a domain they do not own.
- A mailbox can only send as its own address or forwarding addresses that deliver to it. Sending limits stop a hijacked mailbox; only administrators can allow it again.
- Accepted mail is written to disk before the server confirms it.
- Backups never read the mail data as root:
ownpaneld backupreads it in a child process running asownpanel-mailand keeps only plain files and folders from its output, so a taken-over mail service cannot make root copy or hand over other files through links. - Administrators can read any mailbox by setting its password.
- Download all mail reads a whole mailbox without its user noticing, so only administrators and the owner of the mail domain may, signed in with a password or with an unrestricted write token (never read-only or site-limited tokens, never through MCP). Every download is noted in the activity log, which the domain's owner and administrators see; one runs per mailbox at a time.
- Importing mail takes another account's password. It goes to the mail service only, is kept in memory while copying, and is never stored, logged, returned or written to the activity log (it is asked for again after a restart). The mail service connects only to public addresses on ports 993 and 143, checks the other server's certificate and signs in only over an encrypted connection; the old account is opened read-only. Uploaded files are untrusted: zip files are checked for unsafe names, size and number of entries before anything is read, and an import stops at the mailbox's storage limit and before the disk runs low.
Versions can be opened before they go live on <label>.<preview domain> (Sites and Publishing). How they are protected:
-
Anyone with a preview link can open that version. The label (130 bits) and the key in the link (160 bits) are derived with a secret of this panel (stored encrypted with
secret.key) and cannot be guessed. The label alone is not enough: with public certificates, each opened preview's name appears in the public certificate logs, so the files also need the key, which the link carries once and the browser then keeps in a__Host-cookie (Secure,HttpOnly,SameSite=Lax, noDomain) for that one address. Another preview cannot set or overwrite it. Treat links like the files they show: whoever has one can pass it on. -
No filesystem path is built from a host name. The web server config lists one route per kept version, generated from the panel's list of versions; any other name below the preview domain answers
404. -
Certificates on demand, only for real previews. One wildcard route takes the names below the preview domain; their certificates are obtained during the first visit, one name at a time, and only after the web server asked the panel
GET /api/previews/certificate-allowed?domain=<name>. The panel says yes only for the address of a kept version. That endpoint answers only requests made directly from the server itself (loopback, withoutX-Forwarded-FororVia), so it cannot be asked through the web server from outside; local users on the server learn nothing from it without knowing a label. No certificate is ever requested for the wildcard itself or for versions nobody opens, so many versions do not run into the certificate authority's limits. - Previews answer with
X-Robots-Tag: noindex, nofollow.
Choosing the preview domain. The files of sites are untrusted, and previews show them on the preview domain. The panel's session cookie is __Host-ownpanel_session over HTTPS: host-only (no Domain), Secure, HttpOnly, so no page on another name can read, set or overwrite it. Changing requests made with the cookie must carry X-Ownpanel-Request: 1 and a matching Origin (see "Requests from browsers" above), and answers never allow CORS, so pages on other names cannot act as the signed-in person or read answers. That holds for any preview domain. But a preview domain below the panel's own domain (or below the same registrable domain, like preview.example.com for panel.example.com) is same-site with the panel: browsers then send the panel's SameSite=Strict cookie along with requests started by preview pages, so SameSite no longer adds protection and the header and Origin checks are the only line. Pages there can also set cookies for the shared parent domain, and read cookies other services on that domain set for it without HttpOnly. Recommended: a domain of its own, like example-preview.net, the way large hosts serve user content from separate domains. preview.<panel domain> works and is what the panel suggests for convenience. The same reasoning applies to sites whose domains share the panel's registrable domain. Plain HTTP (-tls off, local development only) uses the cookie ownpanel_session without the __Host- protection.
All previews share the preview domain, so they are same-site with each other: a preview could set a cookie for the whole preview domain that other previews receive (never the key cookies). Previews are meant for checking a version, not for running separate applications.
One-time links are valid for 15 minutes, for one site, and work once. They are re-checked against the creating token when used, so revoking the token ends them.
-
Sign-in throttling trusts
X-Forwarded-Forfrom local connections (that is how it sees the visitor's address behind Caddy), so a local user can get around the per-address limits. - Anyone who knows a name or e-mail address can lock that account for 15 minutes with 5 wrong passwords, again and again. The limit is per account so that guessing from many addresses does not help; the price is this lockout.
-
The panel listens on plain HTTP on a loopback port (
127.0.0.1:8600by default). HTTPS exists only through Caddy with-panel-domain. Do not expose the port directly. Local users on the server can reach it. - No per-site system users or quotas. All site files belong to one user, and there is no limit on how many sites or how much disk space a person can use, beyond the per-upload limits.
- Upload links are kept in memory, so a restart invalidates them (safe, but surprising).
- Preview links work for anyone who has them until the version is removed; there is no way to revoke a single link other than removing the version or changing the preview domain (which changes every link).
- No second factor for sign-in, and no list of a person's sessions to end them one by one; "sign out everywhere" ends all of them.
- Access tokens may be created without expiry. Revoke those when they are no longer needed.
- Not tested on a real server yet: the installer, the updater and the hardening of the systemd units have not been verified in production (Roadmap). The build environment was tested in systemd containers on Debian 12, Debian 13 and Ubuntu 24.04 (see Builds for what is not enforced there).
- E-mail has not been tested on a public server, and there is no virus scanning. See E-Mail.
- Removing a GitHub connection leaves the app on GitHub until it is deleted there (the panel links to it). Its key is gone from the panel, but a backup made earlier still contains it.
- Preview links posted on pull requests of private repositories can be opened by everyone who can read the pull request, and they reach GitHub's notification e-mails. They stop working when the pull request is closed or the repository is made public; the comments stay on GitHub.
- Pull requests from the same repository get the site's secrets. Anyone who may push a branch to the repository can open one; protect the linked branch on GitHub and switch previews of pull requests off for sites whose secrets must only reach reviewed code.
- Repositories by address have been tested against a local Gitea (fetching over SSH with a deploy key, a changed server key, real signed push notifications, a replayed and a tampered one) and with test notifications in each host's format, not with real deliveries from GitHub, GitLab, Forgejo or Bitbucket, and fetching over HTTPS only against a test server.
- GitHub's notices have only been tested against a stand-in of GitHub, not with real deliveries from github.com. A notice refused for its size or a rate limit is lost unless someone redelivers it on GitHub (GitHub does not retry by itself).
- A rollback does not restore the database. If a new version migrated it and the old one cannot read it, restore the backup made before the update.
To report a problem, open an issue at https://github.com/danielgtmn/ownpanel.
ownpanel: https://github.com/danielgtmn/ownpanel. This wiki is generated from the wiki/ folder in the repository; edit the files there, not in the wiki.
ownpanel
Get going
Using ownpanel
- Sites and Publishing
- GitHub Action
- GitHub
- Git repositories
- Users and Access
- DNS
- Redirects
- MCP
- API
- Backup and Restore
Background