Security

23 min read · Edit this page on GitHub

What borgo does for you before you write a line, what it deliberately leaves to you, and how to change either. If you are the person who has to approve this framework for production, this is the page to read.

The short version: borgo ships a locked-down default posture — security headers, a strict Content-Security-Policy, CSRF on form actions and on browser /api/* mutations, signed HttpOnly session cookies, bounded request bodies and timeouts — and it stays out of policy decisions like account lockout, which routes are rate limited, and TLS, which belong to your proxy and your product. For those it gives the pieces: a limiter to put on a route, a hook that is told of every sign-in.

Security headers#

Every response on the public port leaves with four headers set, only where it does not already carry them — so you can override any of them per route. That is every response, by where it leaves and not by who wrote it: a rendered document, a static file, what an /api/* handler returns, and the refusals borgo writes itself — the 403 of a failed csrf check, the 413 over BORGO_MAX_BODY, the 503/504 of a render service that did not answer.

Header Value
X-Content-Type-Options nosniff
Referrer-Policy strict-origin-when-cross-origin
X-Frame-Options DENY
Cross-Origin-Opener-Policy same-origin-allow-popups

With SESSION_SECURE=1 there is a fifth, Strict-Transport-Security: max-age=31536000: that variable is what borgo is told about the site's scheme at startup, and a browser ignores the header over plain http anyway. It covers this host for a year and promises nothing about subdomains or the preload list — those are statements about names borgo does not know, and the proxy is where to make them; a value already on the response is left as it is.

X-Frame-Options: DENY means your app cannot be framed. If you deliberately embed it somewhere, replace the header (and the CSP's frame-ancestors) rather than dropping the whole set.

Cross-Origin-Opener-Policy, new in 1.1, means a page from another origin that opens yours gets no handle on its window, and yours none on the opener: window.opener is null in a page of your app that another site opened. The value is same-origin-allow-popups and not same-origin because the stricter one would also cut off the popup an OAuth sign-in opens from the page that is waiting for it; windows your own pages open keep their handle. An app that is itself meant to be opened as a popup by other sites, and to answer through window.opener, sets the header on that route to unsafe-none: a value already on the response is left as it is.

Two more headers are the operator's to set, and borgo sends neither by default:

BORGO_HSTS=0                                           # never send Strict-Transport-Security: the proxy sends its own
BORGO_HSTS=1                                           # send it though SESSION_SECURE is unset
BORGO_HSTS="max-age=63072000; includeSubDomains; preload"   # the whole value, as written
BORGO_PERMISSIONS_POLICY="camera=(), microphone=(), geolocation=()"

BORGO_HSTS separates the header from the cookies. Unset, it follows SESSION_SECURE as before. A boolean turns it off or on by itself; the header's own value — max-age= and a number of seconds, then includeSubDomains and preload if wanted — is sent as written, which is how to state those two once you can promise them for the names involved. Anything else refuses the boot. BORGO_PERMISSIONS_POLICY is sent as a Permissions-Policy header, as written, on every response that carries none. It has no default: which browser features an app uses is the app's to say, and a guess would turn a camera or a map off in somebody's product. Both are dropped with the rest by BORGO_SECURITY_HEADERS=0.

Content-Security-Policy#

The default policy, applied to HTML documents and SVG responses:

default-src 'self'; base-uri 'none'; object-src 'none'; frame-ancestors 'none';
form-action 'self'; img-src 'self' data: blob:; font-src 'self' data:;
style-src 'self' 'unsafe-inline'; connect-src 'self'; script-src 'self' 'nonce-…'

The interesting part is script-src. Server-rendered pages carry their loader props in an inline <script>, which a strict policy would block — so borgo mints a random nonce per response, puts it on that script tag, and names it in the header. React's own streaming boundary scripts inherit the same nonce. The result is a policy with no 'unsafe-inline' for scripts in production, without you configuring anything.

In development the policy uses 'unsafe-inline' instead of a nonce, because the dev client and the error overlay inject scripts outside the render.

CSP on cached pages#

A cached page is one render served many times, and a nonce shared across responses is no nonce at all — anyone can read it off the page and inject a script that names it, which is exactly what the header exists to block. borgo export refuses a nonce for that reason: a file cannot change. A live server can, so it re-mints instead: the cached copy keeps the nonce its render produced as a substitution key — a value that never ships, not even on the first response — and every replay swaps a fresh one into the body and the Content-Security-Policy header together. Each response a cached page produces therefore carries a nonce as unpredictable as a fresh render's, and a page nonced by anything other than borgo's own render is refused from the cache rather than guessed at.

style-src keeps 'unsafe-inline' in both modes: React writes inline styles, and so does almost every component library.

Changing the policy#

BORGO_CSP=0                      # no CSP header at all, other headers stay
BORGO_CSP="default-src 'self'; script-src 'self' {nonce} https://plausible.io"
BORGO_SECURITY_HEADERS=0         # drop the CSP and every header of the section above

A custom policy is used verbatim, with {nonce} replaced per request by 'nonce-<random>'. Keep {nonce} in your script-src unless you also add 'unsafe-inline' — without either, your own pages will not hydrate. Adding a third-party script is the common case:

BORGO_CSP="default-src 'self'; base-uri 'none'; object-src 'none'; frame-ancestors 'none'; form-action 'self'; img-src 'self' data: blob: https://cdn.example.com; font-src 'self' data:; style-src 'self' 'unsafe-inline'; connect-src 'self' https://api.example.com; script-src 'self' {nonce}"

CSRF protection#

One double-submit token, echoed back in two different places — because the two request shapes borgo serves have nothing in common. The render service issues a single borgo_csrf cookie with every rendered page, and this is the whole scope of what it then demands back:

Request What must echo the token Who attaches it
POST to a page route (a form action) the __borgo_csrf field of the form body <CsrfField />
POST, PUT, PATCH or DELETE to an /api/* route the X-CSRF-Token request header apiFetch
GET, HEAD, OPTIONS — anywhere nothing. Safe methods are never checked —

Both checks run before your code does. The /api one reads no body at all: it compares a cookie with a header, and a rejected call never reaches your handler. The form one has to read the body, since the token is a field of it — after the BORGO_MAX_BODY cap has been applied — and a rejected form never reaches its action. Both answer 403.

Form actions#

import { CsrfField } from "borgo-framework";

export default function NewPost() {
  return (
    <form method="post">
      <CsrfField />
      <input name="title" placeholder="Title" />
      <button>Publish</button>
    </form>
  );
}

A cross-site form cannot read the cookie, so it cannot produce the field.

/api/* routes#

A header rather than a body field, and that is not a lesser mechanism — on this path it is the stronger one. An /api body is JSON and has no hidden input to carry an echo; meanwhile the one request shape a browser will send cross-origin with no preflight is a simple form POST, and a form cannot set a custom header at all. A cross-site fetch that sets one is preflighted, and borgo approves no CORS, so the preflight is where it stops.

Calls you write by hand from a hydrated page go through apiFetch, which is fetch with the token attached on unsafe methods:

import { apiFetch } from "borgo-framework";

async function remove(noteId: number) {
  await apiFetch(`/api/notes/${noteId}`, { method: "DELETE" });
}

async function logout() {
  await apiFetch("/api/logout", { method: "POST" });
}

Everything else about it is fetch: same arguments, same return, safe methods passed straight through. Under borgo dev the check is off unless BORGO_CSRF=1, so a bare fetch that works through all of development meets it on the first deploy. A plain fetch("/api/x", { method: "POST" }) from a page in a browser holding the cookie answers 403 — that is the check doing its job, and swapping the call for apiFetch is the fix. If you would rather roll it yourself, csrfCookieValue(document.cookie) reads the token and CSRF_HEADER is the header name.

Loaders and actions need none of this. Their api client and apiUrl address the api's internal listener — loopback, behind the key minted for this boot — and the header check guards the public port, not that listener, so a server-side api("POST /api/login", …) is not checked here and cannot start failing because of it. The form action that called it already passed the field check on the way in.

What you get for free when you write your own POST /api/…: a Go handler mounted at an /api route is covered the moment a browser calls it, with no annotation and no per-route wiring — the check sits on the public port, not on the handler. The obligation that remains is the browser side: use apiFetch.

What arms the check, and what stays untouched#

Both halves arm on presence of the borgo_csrf cookie, not on a live session. If the check only applied to authenticated requests, an attacker could cross-post to a login route with their own credentials and silently log the victim into the attacker's account, where everything the victim then types belongs to someone else. Covering anonymous requests closes that. (The form-action check additionally arms on a borgo_session cookie. The /api check does so only for a POST whose body a plain HTML form can send - multipart/form-data, application/x-www-form-urlencoded, text/plain or no type at all - because a browser keeps the session cookie after the borgo_csrf one has ended with its session, and a form posted from a sibling subdomain reaches a borgo.BindMultipart route. A mobile app holding a session cookie and sending JSON is unaffected. A page served from the shared cache mints no token, so a browser in that state gets its own render of it, which does.)

Clients that carry neither cookie — curl, a mobile app, a server-to-server caller — are unaffected on both paths, and one that holds only a session is unaffected on /api as long as it posts JSON. Nothing arms for them, so nothing 403s. That is deliberate: a check that armed on cookie-less callers would break every non-browser client of your API on the day you turned it on.

Conflicting duplicate borgo_csrf cookies read as no token, and the request is refused rather than waved through — see duplicate cookies. The check still runs: an attacker who can plant a duplicate must not be able to switch the check off by making the browser look token-less.

BORGO_CSRF=1    # force both checks on in development
BORGO_CSRF=0    # disable both (do not do this in production)

What this is actually defending against#

Worth being precise, because the token is not the only thing holding this line. SameSite=Lax on both cookies already stops the classic cross-site POST: a form on evil.com aimed at your app is sent without your cookies, so it is anonymous, and the token cookie is not there to arm anything.

The token is for the attacker SameSite says nothing about: a same-site, cross-origin one — a sibling subdomain you do not control, a stored XSS on another host of the same registrable domain, anything at blog.example.com shooting at example.com. The browser sends every cookie to that attacker's requests. They still cannot read the host-only borgo_csrf cookie, and they still cannot set a custom header cross-origin without a CORS approval borgo does not grant. That is the gap the double-submit closes, on both paths.

A second layer sits behind the /api one and is worth knowing about: borgo.Bind requires Content-Type: application/json and rejects anything else — including a request with no Content-Type at all, which matters because an empty-type Blob is a CORS-safelisted body that earns no preflight. So a handler that calls Bind was never reachable by a cross-site simple form post in the first place. A handler that does not call Bind — a body-less POST /api/logout, say — had nothing, which is exactly why the check above is on the public port and not in Bind. See the typed bridge for what Bind accepts.

Cookies and sessions#

Session cookies are signed with HMAC-SHA256 over a payload that includes the expiry, so neither the data nor its lifetime can be edited by the holder. Attributes:

Attribute Value
HttpOnly always — JavaScript cannot read the session
SameSite Lax
Path /
Secure when SESSION_SECURE is 1/true

Set SESSION_SECURE=1 in production. It is off by default only so that http://localhost works. A value that is neither a true nor a false spelling is refused at startup rather than read as "not secure" — that check used to be == "1", which meant SESSION_SECURE=true silently issued a cookie the browser would send back over plain http.

SESSION_SECRET is treated differently depending on how it is wrong, because the two cases fail in opposite directions.

Absent is reported, not enforced. borgo boots, and logs borgo: SESSION_SECRET not set (or under 32 bytes): sessions and auth refuse until it is once, at the first request that carries a session cookie or tries to set one: an app with no sessions is a legitimate app, and nothing at boot can tell one from the other. The failure is per request and it is closed — SetSession returns ErrNoSessionSecret, and borgo refuses to verify a session too, so a deployment that loses the variable logs everyone out rather than letting anyone in.

Shorter than 32 bytes refuses to boot. A short key is not a weaker secret, it is a searchable one: the security of the cookie rests on nobody being able to produce its HMAC, and a handful of bytes can be exhausted offline from a single captured cookie. Setting one is a deliberate act with a wrong value, so borgo treats it like any other malformed environment variable and stops, naming the length it got and the length it needs. Everywhere else in the framework a secret under the floor is indistinguishable from no secret at all.

The absent case is the one whose failure mode is per request, and you should know its shape: /healthz stays green, every page that does not touch a session keeps working, and SetSession returns ErrNoSessionSecret, which LoginHandler and RegisterHandler answer as a 500 with {"error":"session write failed"}. Nothing is logged at startup: sign in once after a deploy, or have your deploy script do it and assert on the answer — the line at that first session request is the only warning you get. Making it fatal is on the table for a future major (api stability lists it as breaking), because tightening it would stop apps that boot fine today.

Generate one properly:

openssl rand -base64 48

Replacing the key does not have to sign anybody out: SESSION_SECRET_PREVIOUS lists the keys that signed before, which still verify and never sign. Rotating the session key is the procedure, and it says when to skip the list — a key that leaked.

If a request carries two valid borgo_session cookies - with the same value or not - borgo behaves as if there were none. Two borgo_csrf cookies with different values are none as well, and Go, the render service and the browser runtime all agree on it.

This defends against cookie tossing. A cookie on a sibling subdomain (blog.example.com, or anything an attacker gets to run on your domain) can be set with Domain=.example.com, and the browser will then send two cookies with the same name. The order is not something you control — it depends on path length and creation time, both attacker-influenceable — so "take the first one" meant an attacker could decide which session or which CSRF token your server read. Refusing to guess is the only safe answer.

Request limits and timeouts#

Limit Default Override
JSON body decoded by borgo.Bind 1 MB borgo.BindMax[T](r, bytes) per route
Request body read on the public port 32 MB BORGO_MAX_BODY (bytes, 0 for no limit)
Waiting for the render service's response headers 30 s BORGO_RENDER_TIMEOUT (duration, 0 disables)
Reading a client's request headers 5 s BORGO_READ_HEADER_TIMEOUT
Idle keep-alive connection 2 m BORGO_IDLE_TIMEOUT (duration; malformed is refused before the port binds — borgo.Serve exits naming the variable, ServeContext returns the error)
A request body without progress, a response without a write 60 s on the public port BORGO_READ_TIMEOUT, BORGO_WRITE_TIMEOUT (duration, 0 disables)
Api requests served at once no limit BORGO_MAX_INFLIGHT (a whole number; the next request is answered 503)
An api handler, from its first line to its last no limit BORGO_HANDLER_TIMEOUT (duration; the request's context is cancelled)
Requests one client makes to one route no limit borgo.Limit(most, per, key) around the handler

Over the Bind cap the client gets a 413; a missing or non-JSON Content-Type gets a 415. Both come from borgo.BindError. Over BORGO_MAX_BODY the read of an /api body fails: the front counts the bytes as your handler reads them, and the read that passes the limit returns an error — Bind hands it to BindError, which answers the same 413, a handler that reads the body itself gets the error from Read, and one that reads nothing is not stopped. The count is of bytes as they arrive — a body with no Content-Length, chunked, is cut at the same byte as one that declared its size, so the declaration is not what the limit reads. The render service applies the same number to the one body it reads itself, a form action's, and answers its own 413 before the action runs.

The read and write deadlines are not limits on the whole exchange. net/http's own are, and any value for those would eventually kill a legitimate stream or a slow upload - so borgo moves each deadline forward whenever the exchange makes progress: a read of the body moves the read deadline, a write of the response moves the write deadline. A peer that stays silent for a minute is cut; one that keeps sending or keeps reading never is. An event stream clears its write deadline at its first byte and keeps its own, and borgo.SSE bounds each of its writes at 10 seconds.

The deadlines a client meets are all on the public port, which is Go's, and they are separate numbers by construction: BORGO_READ_HEADER_TIMEOUT and BORGO_READ_TIMEOUT bound what a client sends, BORGO_WRITE_TIMEOUT what the server writes. Setting a read deadline therefore cannot cut a stream, and that is the whole reason this section is now a few paragraphs instead of a page.

It used to be a page. The public port was bun's, and bun's idleTimeout bounds the wait for an inbound request's headers and body and the response write with one number — so the deadline that stopped a slowloris was the same one that cut an event stream. Switching it off left every body-reading path unbounded and did not come back: server.timeout(req, 0) disarms the connection, not the request, and bun re-arms one only when a next request completes, so a client that sent one GET /healthz, read the 200 and went silent held the socket until the process restarted. What borgo ran instead was a two-second sweep that re-armed a short fixed deadline for a request already fully received — measured, documented, and deleted in 0.30 with the listener it protected. If you are looking for BORGO_FRONT_READ_TIMEOUT, that is where it went.

A hung render cannot take the front with it: past BORGO_RENDER_TIMEOUT the request answers 504 and the render's body is cancelled. A hung Go handler is a hung handler in the process that answered the port, and by default no deadline stops one that writes nothing. BORGO_HANDLER_TIMEOUT is that deadline: when it passes the request's context is cancelled, and a handler that then wrote nothing is answered 503. It reaches a handler through its context and no other way, so a query made without r.Context() runs on. BORGO_MAX_INFLIGHT bounds the other axis, how many handlers run at once. Deploy has both.

Rate limiting a route: borgo.Limit#

borgo.Limit(most, per, key) wraps a handler so that one key is answered at most most times in per. Past that it gets 429 with Retry-After and {"error":"too many requests, retry in a moment"} until the window is over, and the handler is not called:

// one book per call: these two routes do not share a count
var (
	contactLimit = borgo.Limit(5, time.Minute, nil)
	exportLimit  = borgo.Limit(3, time.Hour, bySession)
)

// counted by who is signed in; "" is not counted at all
func bySession(r *http.Request) string {
	me, ok := borgo.GetSession[Me](r)
	if !ok {
		return ""
	}
	return me.Username
}

func sendContact(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusAccepted) }
func exportData(w http.ResponseWriter, r *http.Request)  { w.WriteHeader(http.StatusAccepted) }

func init() {
	borgo.Handle("POST /api/contact", contactLimit(sendContact))
	borgo.Handle("POST /api/export", exportLimit(borgo.Authed(exportData)))
}
  • The key says what a request is counted under. nil is borgo.ByClient: the address borgo.ClientIP reads, behind the proxies you trust. A request whose key is "" passes uncounted, so a key by session lets anonymous requests through — put borgo.Authed inside it, as above, or fall back to borgo.ByClient(r).
  • An IPv6 address is counted by its /64. One customer line holds a whole /64, and counted by address it would hold eighteen quintillion separate allowances. The sign-in limit counts the same way since 1.1.
  • The window is fixed. It opens at a key's first request and lasts per; the most-th request in it is the last one answered.
  • Each call to Limit is its own count. Two routes wrapped by one value share it; two calls do not.
  • It is this process's count. With more than one instance behind a balancer each keeps its own, and the limit a client meets is the sum — see more than one instance. A book holds at most 50,000 keys at a time.
  • borgogen does not read through it. borgo.Authed(h) keeps h's generated types; a route mounted as borgo.Limit(...)(h) serves, and borgogen warns that its request and response types stay unknown. Where the types matter, apply the limit in api/middleware.go and mount the handler bare.

Limit panics when built with a count or a duration that is not positive, which happens at startup.

An audit trail: Auth.OnEvent#

borgo.Auth tells the app nothing about who signed in unless the app asks. OnEvent is how it asks: one function, called for every sign-in, failed sign-in, refused sign-in, sign-out and new account the Auth's handlers see, with what happened, the username that was sent, the client's address and the time.

// writeAudit stands for an insert into a table of yours
func writeAudit(ctx context.Context, kind, username, client string, at time.Time) {}

var audited = borgo.Auth[User]{
	Lookup:    lookupUser,
	Principal: func(u User) any { return Me{Username: u.Username} },
	OnEvent: func(r *http.Request, e borgo.AuthEvent) {
		writeAudit(r.Context(), string(e.Kind), e.Username, e.Client, e.At)
	},
}
Kind When Username
borgo.AuthLogin a sign-in that set a session as sent
borgo.AuthLoginFailed a wrong password, or a username nobody has as sent
borgo.AuthLoginLimited refused with 429 before the body was read empty
borgo.AuthLogout LogoutHandler ran empty
borgo.AuthRegistered a new account, through RegisterHandler or Signup as sent
  • Treat a failed username as data to store carefully, not to print. It may be nobody's, and it may be a password typed in the wrong box. It is whatever the client sent, on its way to a log, so the event carries it cut to 256 bytes and with control characters replaced by spaces: it cannot write lines of its own there.
  • It runs on the request's goroutine, before the response is written. A slow hook is a slow sign-in: hand the event on and return. A hook that panics is logged, and the response is what it would have been.
  • A sign-out does not say who. LogoutHandler clears the cookie whatever it holds; a hook that wants the name reads the session itself, with borgo.GetSession, which still answers at that point.
  • It sees these handlers and no others. A session your own handler writes with SetSession, a password change, a revocation: those are your code, and your code writes its own line.

This is the hook an audit log, a "new sign-in" mail or a lockout of your own hangs on. borgo still keeps no log itself.

Realtime surface#

A WebSocket on /ws — answered by the Go process on the public port since 0.30, behind api/middleware.go like every other path — whose Origin header names a different scheme or host is refused, because browsers attach cookies to WebSocket handshakes regardless of origin — without the check, any page on the internet could open a socket as your logged-in user. An absent Origin is refused too, as of 0.21: admitting it meant the one header an attacker can simply leave out switched the check off. Non-browser clients send none and are now refused; BORGO_WS_ALLOW_NO_ORIGIN=1 admits them, and admits every other originless caller with them.

The shape of that refusal matters to whoever reads the client's log. A non-101 answer to a handshake reaches the browser as close code 1006 with no reason, indistinguishable from a server that is down, so the origin refusal is not a 403: the handshake completes, and the socket is closed at once with code 4403 and a reason naming the origin it saw — or, for a handshake with no Origin, the switch that would admit it — origin "http://evil.example" is not this server (app.example.com): /ws accepts the page's own origin only. The socket is subscribed to nothing and lives one tick. borgo's own client treats exactly that code as final (onRefused fires, once) rather than redialling a refusal every 30 seconds for the life of the tab — see realtime. A refusal of the topics a handshake asks for stays a 400: a client may subscribe to at most 32 topics of at most 128 characters, and must name at least one. A request that is not a WebSocket handshake at all is a 426, and one past BORGO_MAX_SOCKETS a 503. A single message is capped at 1 MB. A topic the socket may not hold is the same 4403, with the topic in the reason.

What a socket may hold is your app's decision: borgo.CanSubscribe is asked for every topic at the handshake, with the session the front verified, and borgo.CanPublish for every message a browser publishes — see who may hold a topic. A production relay with no CanSubscribe refuses every subscription and says so at startup, because a relay with no rule is a relay with the wrong rule. Go pushes to browsers with a call: borgo.Push publishes into the relay in its own process, so there is no endpoint to guard and no key to share. The push road of 0.2x — /__borgo/publish, BORGO_PUSH_KEY, BORGO_PUSH_INSECURE — is gone, and the two variables refuse the boot by name if still set.

What borgo does not do#

Deliberate omissions. Each is a policy decision that belongs to your app or your infrastructure, and pretending otherwise would be worse than the gap:

  • No lockout, and no rate limit you did not ask for beyond sign-in. The login handler caps concurrent password hashing and sheds excess with 503 plus Retry-After, which stops a flood from starving the rest of the API, and it stops listening to an address after ten failed sign-ins in a minute (BORGO_LOGIN_ATTEMPTS), answering 429. That covers one address guessing; a guesser spread over many, per-account lockout, and the choice of which other routes are limited are yours — in the reverse proxy, with borgo.Limit on a route, or in api/middleware.go.
  • No WAF, no bot detection, no captcha.
  • No TLS. Terminate it at Caddy, nginx, or your load balancer. borgo deploy init caddy writes a config that runs as written on a certificate from Caddy's own local CA, and gets a public one after two edits: your domain, and the tls internal line deleted.
  • No OAuth, no SSO, no 2FA, no email verification, no password reset. borgo.Auth gives you the mechanics — hashing, session issuance, guards — over your user store. The policy is yours. See auth and sessions.
  • No secret management. SESSION_SECRET and friends come from the environment; use your platform's secret store.
  • No audit log of its own. /metrics counts requests by route and status; it is not an audit trail. Auth.OnEvent tells your code of every sign-in, and where that is written is yours.
  • No dependency scanning of your app. The borgo package your binary links imports nothing outside the Go standard library (the module's one requirement, golang.org/x/tools, belongs to borgogen, a build-time tool), and the npm surface is small: that is the part borgo can control.

Before you go live#

  • SESSION_SECRET set, 32+ random bytes, out of version control — confirmed by a sign-in that works after the deploy, since nothing stops a secretless boot and nothing is logged until a request uses a session.
  • SESSION_SECURE=1, and TLS terminating in front of the app.
  • borgo.CanSubscribe registered in api/ if the app uses WebSocket topics — without one every subscription is refused — and deciding by the session, never by how hard a topic name is to guess.
  • CSRF left on (BORGO_CSRF unset in production), <CsrfField /> in every <form method="post">, and apiFetch — not bare fetch — behind every browser POST/PUT/PATCH/DELETE to /api/*.
  • The default CSP kept, or a custom one that still nonces or allows your own scripts — load a page and check the browser console for violations.
  • Rate limiting for /register and anything expensive: in the proxy, or borgo.Limit on the route.
  • /healthz wired to your monitor and /readyz to your balancer; if you enable /metrics, BORGO_METRICS_TOKEN set unless the port is reachable only from your own network.
  • A backup and restore you have actually tested for whatever DB_PATH points at.

See deploy for the environment reference and the deployment layouts, and auth and sessions for building login on top of this.