Docs / Security

Security

Put an app behind a password, an IP allow list, or a deny list without changing a line of your code. Sarpius enforces these rules at the edge, in Sarpius Router, before a request ever reaches your container. You can set one policy for a whole Project or a tighter one for a single Component, and password protection is built so an app that already has its own login keeps working underneath it.

What edge security is

Every request to a deployed app passes through Sarpius Router, the edge reverse proxy that terminates TLS and forwards traffic to your container. Edge security lets you attach an access policy to that hop. When a policy is active, Sarpius Router checks the request against it first and only forwards the request if it passes. Because the check runs at the edge, it protects the app no matter what framework or language it runs, and a blocked request never consumes your container.

  • HTTP password protection (Basic auth): the browser must present a username and password you configure before it can reach the app.
  • IP allow list: only addresses inside the listed ranges may reach the app; everything else is refused.
  • IP deny list: listed addresses are refused; everything else is allowed.

A policy can combine all three. You manage it in the Project workspace under the Security section (Project-wide policy) and on a Component under its Security tab (per-Component policy).

How access is decided

When a request arrives for an app that has an active policy, Sarpius Router evaluates it in a fixed order and stops at the first rule that applies.

  1. Deny list. If the client address matches any deny rule, the request is refused with a 403 page. This is checked first, so a deny rule always wins.
  2. Allow list. If any allow rules exist and the client address matches none of them, the request is refused with a 403 page. An empty allow list means "no allow restriction" and this step is skipped.
  3. Password. If password protection is on, the request must carry a valid credential (or a valid session cookie from an earlier sign-in). If it does not, Sarpius Router answers 401 and the browser shows its sign-in prompt.
  4. Forward. If the request clears every active check, Sarpius Router forwards it to a healthy upstream for the app.
Note

IP rules and password protection are independent. The IP checks apply to the address; the password check applies to the person. A request must satisfy both when both are configured.

Project-wide vs per-Component

A policy lives at one of two scopes. A Project-wide policy is the default that every Component in the Project inherits. A Component can override it with its own policy when one part of the app needs different rules, for example locking a staging admin panel while the public front-end stays open.

Each Component chooses one of three modes for how it relates to the Project policy:

  • Inherit: the Component uses the Project-wide policy. This is the default for a new Component.
  • Custom: the Component defines its own password credentials and IP rules, and the Project policy is ignored for it.
  • Public: the Component enforces no policy at all, even when the Project policy is active. Use this to punch a single Component through an otherwise locked Project.
Note

The Component Security tab shows the inherited Project policy alongside the mode selector, so you can see what "Inherit" resolves to before you switch to Custom or Public.

Password protection

Turn on the sign-in toggle and add one or more username and password credentials. When protection is on, Sarpius Router answers any unauthenticated request with a standard HTTP Basic challenge, so the browser shows its native sign-in dialog. Passwords are stored only as a bcrypt hash; the platform never shows a saved password back to you, and the API only ever returns the list of usernames.

http
GET / HTTP/1.1
Host: your-app.sarpius.app

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="your-app.sarpius.app"

The key design point: password protection does not break an app that already has its own authentication. Browsers send Basic credentials on the single Authorization header, which is the same header many APIs use for their own Bearer tokens. If Sarpius Router left the Basic header in place, the two would collide and every Authorization: Bearer request would be rejected at the edge.

To avoid that, the edge does two things on a successful Basic sign-in. It strips the Basic credential so it never reaches your app, and it sets a signed, expiring session cookie in the browser. On every later request the cookie proves the visitor already passed the edge password, so Sarpius Router leaves the Authorization header untouched and your app receives its own Bearer token exactly as it expects.

http
Set-Cookie: __synthrouter_auth=...; Path=/; Max-Age=43200; HttpOnly; Secure; SameSite=Lax

The session cookie is bound to the exact host, to the specific policy it was issued against, and to a fingerprint of that policy's current credentials, and it carries an expiry (12 hours by default). Because of that binding, a cookie from one app cannot authorize another, and rotating or removing a password invalidates every outstanding cookie immediately rather than waiting for it to expire.

IP allow and deny lists

Add addresses as single IPs or CIDR ranges, in either IPv4 or IPv6. Each entry can carry a short label to remind you what it is. Rules are validated as you type; an invalid range is flagged and the policy is not saved until every entered range is valid.

text
203.0.113.42        single IPv4 address
203.0.113.0/24      an IPv4 range
2001:db8::/32       an IPv6 range

The editor offers a "Use my IP" shortcut that reads the address you are currently browsing from and adds it as an exact-match allow rule, so you do not accidentally lock yourself out when you start an allow list. If your active allow rules would not cover your own address, the editor shows a lockout warning before you save.

Heads up

An allow list is exclusive: once you add a single allow rule, every address outside it is refused. Add your own address (or a range that covers it) before you save, or you will lock yourself out of the app.

Configuring a policy

  1. Open the Project workspace and go to the Security section, or open a Component and go to its Security tab.
  2. For a Component, pick a mode: Inherit to use the Project policy, Custom to set its own rules, or Public to disable all checks for it.
  3. To require a password, turn on the sign-in toggle and add at least one username and password credential.
  4. To restrict by address, add allow rules (only these may reach the app) or deny rules (these may not), using single IPs or CIDR ranges. Use "Use my IP" to add your current address safely.
  5. Changes to the toggle and IP rules auto-save after a short pause once every range is valid; credentials save as soon as you add or remove them. There is no separate Save button.

Every change publishes a route-refresh event to Sarpius Router, so a new or updated policy takes effect within seconds of saving, with a periodic full reload as a backstop. You need at least the editor role on the Project to change a policy.

Notes and limits

  • Edge-enforced only. These controls gate traffic that flows through Sarpius Router. They are an access layer in front of your app, not a replacement for authentication and authorization inside it.
  • IP detection behind a CDN. Sarpius Router resolves the real client address from the trusted proxy chain (for example CF-Connecting-IP behind Cloudflare) rather than the immediate connection, so IP rules match the visitor, not the CDN edge.
  • HTTPS is required for the session cookie. The cookie is issued with the Secure flag, so password protection with the seamless cookie experience relies on the app being served over TLS, which is the default for Sarpius subdomains and custom domains.
  • Passwords are one-way hashed. Credentials are stored as bcrypt hashes and are never returned by the API; if you lose a password you remove the credential and add a new one.
  • Blocked requests are cheap. A denied or unauthenticated request is answered at the edge and never reaches or bills your container.

Sarpius is a trading name of Synthwave-technologies.nl · KvK 73239038 · VAT NL002410192B67 · Apeldoorn, the Netherlands

(c) 2026 Sarpius. All rights reserved.

Hosted in the EU