Security model
Requests
- HMAC-SHA256 over the raw body, per-site secret. A secret only works on its own site’s hook.
- The payload is then validated against the Nix-declared site table: site
name must match the hook, env must be allowed, prod only from
prodBranches, artifact URL (andrun_url) must belong to the site’s repo, fields match strict regexes. - Replay:
tsmust be withinmaxSkewseconds, and eachidis accepted once. /hooks/is rate limited in nginx (hookRateLimit).endpointmust behttps://in the client: the body carries the job’s token.
prodBranches is a guard against mistakes, not against a leaked secret: the
branch is part of what the secret signs. See
Branch policy.
Artifacts
Archives (zip or tar.gz) with absolute paths, .. components, symlinks or
any non-regular file are rejected, as are archives whose total uncompressed
size exceeds maxExtractedBytes (2 GiB) or that hold more than
maxArtifactFiles (50 000) entries, checked before anything is written.
Downloads are bounded in size and never follow a redirect from https to
http.
The host
- The receiver and worker run as the unprivileged
muelleuser under systemdProtectSystem=strict, writable paths limited tobaseDirandstateDir. /status/<id>is public (CI polls it), so unexpected errors show onlyinternal error; the detail and traceback stay in<stateDir>/log/<id>.log. It carries state, message and URL only, never branch names, which stay in the unserved<stateDir>/jobs/.
Headers
Every vhost muelle declares sends headers, one definition per header so
each can be changed or dropped (null) on its own, globally or per site:
Strict-Transport-Security: max-age=31536000, withoutincludeSubDomainsorpreload, since the apex may not be yoursX-Content-Type-Options: nosniffReferrer-Policy: strict-origin-when-cross-originX-Frame-Options: DENYandContent-Security-Policy: frame-ancestors 'none': other sites cannot frame yours (clickjacking)
A site meant to be embedded drops or relaxes the last two:
services.muelle.sites.mysite.headers = {
X-Frame-Options = null;
Content-Security-Policy = "frame-ancestors https://partner.example";
};
Set headers there, not through extraConfig, which would send them twice.
A full Content-Security-Policy for a site replaces the default one, so
include frame-ancestors in it. nginx drops server-level add_headers in
any location that sets its own, so repeat them there.
The listing and /status/ send their own strict Content-Security-Policy
and Referrer-Policy: no-referrer instead.
Previews
next and previews serve untrusted content same-site with the listing; see Preview isolation.