Security Configuration
The [security] section controls SSRF protection, origin allowlisting, and rate limiting for render requests.
TOML Example
[security]
allowed_origins = []
block_private_cidrs = true
rate_limit_per_domain = 10
rate_limit_per_ip = 3
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
allowed_origins | Array of Strings | [] | Restrict rendering to specific origin domains. Empty = no hostname restriction; private-address policy still applies |
block_private_cidrs | Boolean | true | Block requests to private/internal IP ranges (SSRF protection) |
rate_limit_per_domain | Integer | 10 | Maximum render requests per second per target domain |
rate_limit_per_ip | Integer | 3 | Maximum render requests per second per client IP. 0 = disabled |
Detailed Explanation
allowed_origins
When set, PRISM only renders pages whose origin matches one of the listed domains. Requests for other origins are rejected. When empty (default), no hostname allowlist is applied, but private-address blocking still applies. The configured origin retains its exact-authority exemption.
Entries are hostnames, not URLs. A scheme or a port never matches, and the
comparison is case-sensitive, so https://example.com and Example.com both
silently match nothing — which blocks every subresource rather than failing
loudly. A leading dot is not needed: each entry also matches its subdomains.
[security]
allowed_origins = ["example.com", "staging.example.com"]
rate_limit_per_ip
A fraction of the per-domain budget, so no single client can spend all of it. Charged only when a render actually happens, not on cache hits.
Size this before upgrading to 1.4.0. Concurrent requests for a URL the
origin refused to a shared cache — anything marked no-cache, private,
no-store or Vary: * — now each render, where one render used to answer all
of them. Sharing a response the origin said not to share was the bug; rendering
separately is the cost of fixing it.
Behind a CDN this compounds: every visitor resolves to the same edge address
unless server.trusted_proxies lists your proxy, so one burst on a no-cache
page can exhaust the budget for the whole site. Set trusted_proxies, raise
this, or both.
block_private_cidrs
Enabled by default. This prevents SSRF (Server-Side Request Forgery) attacks by blocking the headless browser from making requests to private/internal IP ranges:
10.0.0.0/8172.16.0.0/12192.168.0.0/16127.0.0.0/8(loopback)169.254.0.0/16(link-local)198.18.0.0/15(benchmarking) and192.0.0.0/24(IETF protocol assignments)::1,fc00::/7(IPv6 private),fec0::/10(deprecated site-local)64:ff9b:1::/48(local-use NAT64) and2001::/32(Teredo)
Multicast, reserved, CGNAT and addresses that embed a private IPv4 address (IPv4-mapped, 6to4 and the well-known NAT64 prefix) are blocked as well. A host name is matched without its trailing dot, so db.internal. is refused exactly as db.internal is.
Since 1.4.3, browser HTTP, HTTPS and WebSocket connections use a local policy proxy that resolves the destination, checks every returned address, and connects to a validated address. Redirects and new connections are checked again. HTTPS and WSS retain end-to-end TLS certificate verification; the proxy does not terminate TLS. CDP interception provides additional URL and resource controls.
The configured server.origin is exempt by exact scheme, hostname, and effective
port, so an internal origin works with private-address blocking enabled. A
second port or scheme does not inherit that exemption. allowed_origins limits
hostnames; it does not grant access to additional private hosts.
The proxy accepts up to the larger of 256 and 64 times render.pool.tabs browser connections at once. A connection over that cap is refused, which loses a page subresource: PRISM counts these in prism_egress_connections_refused_total and logs a warning at most once a minute.
PRISM tells the browser, and each render's browser context, to deny downloads, so a page that clicks a download link or loads a Content-Disposition: attachment response leaves no file behind. If a browser does not accept that command, PRISM logs a warning once and keeps rendering.
PRISM fails startup if the egress proxy cannot start. The browser is configured without a direct-proxy fallback; QUIC and non-proxied WebRTC UDP are disabled. Keep deployment network restrictions as defense in depth: this is an HTTP transport boundary, not an operating-system sandbox for a compromised browser.
Chrome's DevTools port
PRISM controls Chrome over the DevTools protocol. By default there is no
DevTools port: Chrome is started with --remote-debugging-pipe and talks to
PRISM over a pair of pipes that no other process can open. PRISM reaches the
pipes through a small helper, a copy of its own executable that starts the
browser, accepts a single WebSocket connection from PRISM on a loopback port
guarded by a 256-bit random token, and closes that port as soon as the
connection exists. Between launch and connection, which takes well under a
second, the port is open and only a request that carries the token is answered;
afterwards nothing listens. This is the "pipe" value of
render.devtools_transport.
With devtools_transport = "port" PRISM starts the browser with
--remote-debugging-port=0 instead. Chrome then opens a TCP port on the
loopback interface, chosen by the operating system, that needs no credentials
and changes every time Chrome is launched. Use this value only if the pipe
transport cannot work in your environment. PRISM also uses it, for that launch
only and with a warning in the log, when it cannot find the browser executable
or its own. The warning begins cannot use the pipe DevTools transport. If an
open DevTools port is not acceptable on your hosts, alert on that line: PRISM
keeps rendering after it, on the port.
Page scripts cannot reach the port: with block_private_cidrs enabled (the
default) the egress proxy refuses loopback destinations, and Chrome is
configured to send loopback traffic through that proxy as well. Any other
process in the same network namespace can reach it, because loopback is shared.
Through the port a process can drive the browser: open pages, read what they
contain, and make requests with the browser's own network access.
The rule that follows when you use "port": nothing untrusted may share
PRISM's network namespace. On Kubernetes, that means PRISM runs in a pod of its
own, which the shipped manifests and the Helm chart give it, with no other
workload added to the pod as a sidecar. On a shared host, no other tenants'
processes may run there; or run PRISM in its own network namespace, such as a
container. With the default "pipe" this rule is no longer needed for the
browser, though it remains good practice for the proxy's other loopback
listeners.
rate_limit_per_domain
Limits how many render requests per second PRISM processes for each target domain. This protects both PRISM and the origin from overload. The default of 10 requests/second per domain is suitable for most deployments.
rate_limit_per_ip
Limits render requests per second from each client IP address. The default is 3; 0 disables this budget. An IP rejection does not consume the shared domain budget.
IPv6 clients are counted by their /64 prefix, because a single customer line owns a whole /64; IPv4 clients are counted by full address, and an IPv4-mapped IPv6 address as its IPv4 address. The per-client cache invalidation budget uses the same keys.
The limiter tracks up to 100,000 client keys at once. When that table is full, a client it is not already tracking is let through rather than refused, so junk addresses cannot lock real crawlers out with 429; the per-domain limit, the render queue and the tab pool still bound the total work. Each such request is counted in prism_rate_limit_table_full_total.
Example Use Cases
Production lockdown
[security]
allowed_origins = ["www.mysite.com"]
block_private_cidrs = true
rate_limit_per_domain = 20
rate_limit_per_ip = 5
Multi-tenant setup
[security]
allowed_origins = [
"tenant-a.example.com",
"tenant-b.example.com",
"tenant-c.example.com",
]
block_private_cidrs = true
rate_limit_per_domain = 5
rate_limit_per_ip = 2
Development (relaxed)
[security]
allowed_origins = []
block_private_cidrs = false
rate_limit_per_domain = 100
rate_limit_per_ip = 0