Why the Synapse admin API and replication listener need private networks
Restricting the Synapse admin API and replication listener starts with a question many teams answer only after an incident: which of your server's paths can a stranger on the internet reach? A typical self-hosted Synapse sits behind a public reverse proxy that forwards client and federation traffic. The admin API, served under /_synapse/admin, lets an operator with an admin access token manage users, rooms, media and devices, so it is among the most sensitive surfaces on the server. The replication listener carries internal traffic between the main process and worker processes, which Synapse coordinates through Redis when it scales out. The metrics endpoint exposes operational data about the server. Each path has a legitimate use: administrators need the admin API for user lifecycle and moderation, operators need workers for scaling, and monitoring systems need metrics. None of those users should come from the public internet.
The risk is rarely a deliberate exposure. It usually comes from a proxy rule that matches a broad path prefix, a location block copied from a generic template, or a listener bound to all interfaces because the default layout was never changed. Token authentication protects the admin API, but it is a single control. A leaked admin token, a stolen session on an administrator's laptop or a misrouted request can then reach the endpoint with no network barrier in front of it. Private networks add a second, independent layer. The public proxy should forward only the client, federation and discovery paths it needs, while the admin, replication and metrics paths answer only from a management subnet, a VPN or the worker network. Federation has its own listener, normally on port 8448, and the Synapse federation documentation recommends firewalling the federation listener when federation is restricted, so that listener belongs in the same review.
Before you change anything, inventory what your server actually exposes. List every listener in the Synapse configuration, note which resources each one serves, and compare that with every location block in the reverse proxy and every firewall rule in front of the host. Confirm the exact resource names and bind options for your installed version in the Synapse configuration manual, because a wrong name can leave a path open without any error. Then test from outside your network, not from an administrator's workstation inside it. Request each admin, replication and metrics path from an external vantage point and confirm that the request is refused or never answered. Record who is allowed to reach each path and how that access is granted, since the rules in the rest of this page turn those decisions into proxy and network configuration.
Options for restricting each endpoint
This table compares four ways to keep the Synapse admin API, replication listener and metrics endpoint off the public internet. Read each row for when the option fits and what it leaves exposed, because most production setups combine two or more of them. Configuration keys named here come from the Synapse configuration manual, so confirm them against your installed version before you change anything.
| Option | Fits when | Does not cover | Verify before relying on it |
|---|---|---|---|
| Reverse proxy path blocking | Public traffic reaches Synapse only through a proxy you control, and you need to return 404 or 403 for /_synapse/admin and other internal paths | Anything reachable directly on the listener port, requests that bypass the proxy, and traffic from other hosts on the same network | Your proxy rules match the paths your Synapse version serves, and direct access to the backend port is blocked |
| Loopback or private interface binding | Listeners such as the client or metrics listener only need to be reached by a local proxy or a sidecar on the same host | Multi-host worker layouts, where workers on other machines must reach the replication listener | The bind_addresses value on each listener in homeserver.yaml, and that the proxy connects to the same address |
| Host or network firewall on replication and metrics ports | Workers run on separate hosts or containers and must reach the replication port, and you want a network boundary without changing Synapse | Clients on an allowed subnet, compromised hosts inside that subnet, and requests that reach the admin API over the client listener | Which ports your version exposes for replication and metrics, and that the allowed source ranges match your worker and monitoring hosts |
| Separate internal listeners with authentication | You run workers that need replication traffic across hosts and want listener-level controls in addition to network rules | Misconfigured shared secrets, exposure of the same listener through a public route, and weak access to the admin API itself | The worker replication secret setting and listener resources in the configuration manual, and that the admin API still requires an admin access token |
How to lock down admin, replication and metrics paths
This sequence moves Synapse's admin, replication and metrics listeners off the public path so that only the reverse proxy, workers and approved scrapers can reach them. Each step closes with a check you can run from outside and from inside your network.
Inventory every listener in homeserver.yaml
Whoever operates the homeserver lists each entry under
listenersinhomeserver.yamland each worker configuration file, recording the port, bind address, resource names (such as client, federation, replication, metrics or admin) and whether TLS is terminated upstream. Also record which hostnames the reverse proxy serves and which paths it forwards. The output is a single table that maps every port to its purpose and its intended audience, which becomes the baseline for the firewall and proxy rules in the next steps.Bind internal listeners to private addresses
The operator changes the bind address of listeners that only internal components need, such as replication and metrics, so they listen on a private interface rather than all addresses. Client and federation listeners stay on the addresses the proxy reaches. After restarting Synapse and each worker, run
ss -ltnpon the host to confirm that the replication and metrics ports are bound only to the private address. The check is done when no internal port shows a public interface in the output.Deny admin and internal paths on the public host
On the reverse proxy serving the public homeserver name, the operator adds rules that return a not-found or deny response for
/_synapse/adminand for any other path that belongs to internal resources, while still forwarding the client and federation paths that Matrix clients and remote servers need. Admin access is then routed only through a separate internal hostname or address that the operator controls. Confirm the rules by requesting/_synapse/admin/v1/server_versionfrom an outside network and checking that the response is refused, while a normal client request to the public host still succeeds.Firewall the replication and metrics ports
The network team restricts the replication and metrics ports with host or cloud firewall rules so that only the Redis host, worker hosts and the monitoring server can connect. Federation traffic is restricted separately, since the Synapse federation documentation recommends firewalling the federation listener when federation is limited. Verify from a host outside the allowed set with a connection test, such as
nc -zvto the replication port, and confirm the connection is refused or times out. Keep a record of the allowed source addresses in the change log.Authenticate internal scrapers and workers
The operator sets up authentication for internal traffic: the replication channel uses the shared secret configured for Redis-backed workers, and the metrics endpoint is limited to the scrape server's address or protected by a credential that the monitoring system sends. Confirm the exact option names and whether metrics support a built-in token in the Synapse configuration manual for the installed version before writing them down. The check is that Prometheus or the chosen scraper still gets metrics, and a request without the credential or from another address is rejected.
Test that the admin path is refused from outside
From an external network, the operator sends requests to the admin path on the public hostname and to any other internal path that was blocked in the proxy. The expected result is a refusal for every one of them, with the proxy's log recording the denied requests. The same test is repeated from an internal administrator host to the internal admin hostname, which should still answer an authenticated admin request. Store both results with the change record so the team can rerun the test after each upgrade.
Confirm workers still connect after the lockdown
The operator restarts the main process and each worker, then checks the Redis connection status and the worker logs for replication connection messages. Client traffic is tested by logging in through the public host and sending a message in a test room, and federation is tested with a known remote server. The sequence is complete when workers report connected to replication, the test message is delivered, and the metrics scrape shows fresh values. If a worker cannot connect, the firewall or bind rule from the earlier steps is the first thing to recheck.
Where the trust boundaries sit between public and internal traffic
The diagram starts with internet clients and federated servers, which reach only the reverse proxy. The proxy forwards client, federation and media routes to the public-facing workers, and nothing else. The admin API, replication listener, Redis and metrics endpoint sit inside the private network, where only operator hosts and internal workers can reach them. Check each arrow against your proxy rules and firewall policy, and confirm that no public route quietly reaches a private listener.
Public routes reach only the proxy and public workers; private listeners stay internal.
Security and operational risks to control
The Admin API, replication listener and metrics endpoint each expose internal control surfaces on the same Synapse process. The cards below cover the failure modes that most often leave them reachable, and the test that shows whether each control holds.
Proxy rules that miss path variants
A reverse proxy rule that blocks /_synapse/admin by exact prefix can miss encoded, double-slash or differently cased variants of the same path, and the Synapse listener may still serve them. Map each admin path your proxy must deny, then send requests for variants of each one from outside the network and confirm every response is refused at the edge. Repeat the test after every proxy configuration change.
Metrics scraped over an open port
The metrics endpoint is often enabled for Prometheus and then bound to an interface or port that the public proxy or a flat network can reach. Confirm which listener serves metrics, bind it to a loopback or monitoring-only address, and check from an external host that the port does not answer. Scrape only from the monitoring network.
Replication port reachable from outside
Worker replication traffic runs over a dedicated listener, and Redis relays messages between the main process and workers. If that listener or the Redis instance is reachable from outside the cluster, an attacker can inject or read internal traffic. Firewall both at the host and network layers, and test from an untrusted network segment that the replication and Redis ports time out.
Synapse workers docsAdmin tokens reused in scripts
Admin access tokens copied into cron jobs, CI variables or chat bots remain valid until revoked and carry full administrative rights. Issue separate, named credentials for each automation, store them in a secrets manager, and rotate them on a schedule. Check that each script authenticates with its own account and that a revoked token stops working on the next request.
Credential handling for internal scrapers
Monitoring and backup tools that call internal endpoints need credentials, and those credentials often end up in plain configuration files readable by many users. Keep scraper secrets in a restricted file or secrets store, limit file permissions to the service account, and confirm that the scraper credential cannot call admin routes. Test by using the scraper token against an admin path and expecting a refusal.
Drift when new releases add listeners
A Synapse upgrade can add listeners, change default bindings or introduce new endpoints, and firewall or proxy rules written for the old layout will not cover them. Read the upgrade notes for each release before deploying, diff the listener configuration against your baseline, and rerun the exposure tests after every upgrade. Record the result in change tickets so the check is repeatable.
Synapse upgrade notesQuestions teams ask before protecting Synapse internals
Is a reverse proxy alone enough to protect the Synapse admin API?
No. A reverse proxy that blocks /_synapse/admin from public routes is necessary, but it is one control among several. The admin API, the replication listener and the metrics endpoint are served by the Synapse process itself, so the proxy must be the only path to them and the network must stop direct connections to the listener ports. Pair the proxy rules with firewall rules on the listener ports, with authentication for any internal caller, and with a review of every route your proxy forwards, including bridges, load balancers and monitoring agents that might reach these paths. The Synapse configuration manual also recommends firewalling the federation listener, which follows the same principle.
How can we test that admin paths are blocked from outside?
Test from outside the network, not from a host inside it. Request /_synapse/admin, the replication port and the metrics path from an external address and confirm each one returns a refusal or a timeout, not a Synapse response. Repeat the test from a host on the internal segment that should be allowed, and confirm authenticated admin calls still work. Then test the proxy itself with path variations, encoded slashes and alternate hostnames, since a missed rule is the usual gap. Keep the results as dated evidence and rerun the same checks after every proxy or Synapse change. Ask any outside tester for a written list of paths, source addresses and expected results.
What does the change need from our team?
Your team needs to provide the inventory of what currently reaches Synapse, including the reverse proxy configuration, the listener definitions in the homeserver configuration, firewall or security group rules, and any worker or Redis topology. They also need to name the internal callers that legitimately use the admin API, such as provisioning scripts, bots or monitoring, so those paths can be allowed with authentication. Someone with access to the proxy, the network and the Synapse host must be available for the change window and for testing. Expect to keep an owner for the internal allow list afterwards, because new tools tend to need access over time.
What drives the cost of an outside review?
The main cost drivers are the number of listeners and workers in scope, how many proxies, load balancers and network zones sit in front of them, whether you run ESS on Kubernetes or a manually installed Synapse, and how many internal callers need a working authenticated path. A review that only verifies an existing setup costs less than one that also changes configuration and retests. Ask the provider for a fixed-scope quote that lists the systems covered, the tests performed, the changes delivered and whether a retest is included. DeployOpen agrees scope, deliverables and timelines in writing before work starts and provides a quote from that written scope.
How long does it take to verify the change?
The duration depends on the size of the topology and how many findings the first test pass produces, so no fixed figure applies here. Verification is usually quicker for a single homeserver with a known proxy than for a worker deployment across several zones. Ask for the schedule in the written scope, with separate milestones for inventory, configuration change, outside testing, fixes and retest. If you need a firm date, confirm it against your change calendar and your own environment, not against a general estimate.
Can our own team do this without an outside review?
Yes, if you have engineers who know Synapse listener configuration, your reverse proxy and your network policy well enough to test from outside. The work is well defined: inventory the listeners, restrict them at the proxy and firewall, allow authenticated internal callers, then test from outside and keep the evidence. An outside review adds value mainly as an independent check, a second pair of eyes on path variations and a written findings list with fixes and a retest. Decide based on whether your team can produce that independent evidence for your security reviewers.
How do Synapse upgrades affect these rules?
Upgrades can change listener behavior, route paths and default settings, so the rules must be rechecked after every upgrade rather than assumed to carry over. Read the upgrade notes for each release you pass through, since the Synapse upgrade notes warn that rollback can be difficult because of database schema changes. Keep the test suite from the previous step and run it against a staging copy before production. Also check your proxy and worker configuration, because a new Synapse release may require updates there. Ask any provider to include upgrade retesting in the written scope or in a retainer.
Limits to confirm in your environment
The controls on this page depend on details that vary by Synapse release, deployment method and network layout. Each item below is a point to verify against the Synapse documentation for your exact version before you write proxy rules or firewall policy.
Exact listener and resource names
Listener blocks, resource names and the endpoints assigned to each listener change between releases, so the resources names you copy from an older example may not match your server. Check the listener and resource documentation for your installed version, then list every listener in your homeserver.yaml with its bind address, port and resources. Confirm each resource name before writing a rule that matches it.
MAS and ESS route ownership
When Matrix Authentication Service or Element Server Suite handles login, session and some account routes, those requests may not reach Synapse at all, or may reach it through a different path. Map which hostnames and paths each component serves before you deny anything at the proxy. A rule that blocks a path Synapse never owns can break sign-in, while a rule that misses a path MAS owns leaves that path open.
Client address forwarding
Rules that restrict admin and replication traffic by source address only work if the reverse proxy and Synapse agree on the real client address. Confirm how your load balancer sets forwarding headers, which proxy addresses Synapse trusts, and whether the x_forwarded listener option is set. If the address is wrong, an allowlist may admit the proxy itself or block legitimate administrators.
Metrics scraping across networks
Your monitoring system must reach the metrics endpoint without exposing it publicly. Confirm whether your Prometheus or other scraper runs in the same network segment as Synapse, whether it can authenticate, and whether it crosses a firewall or a Kubernetes network policy. Test the scrape path from the scraper's host, not from your workstation, before you close the public route.
Internal tooling and admin paths
Scripts, bots, backup jobs and moderation tools that call /_synapse/admin may depend on routes you plan to restrict. Inventory every service account and automation that holds an admin token, record the source addresses it uses, and decide whether it moves to a private network. Ask each team owner to confirm their calls before the proxy change goes live.
How to test that internal endpoints stay private
Test the exposure from outside first, because that is the view an attacker has. From a host with no route into your private network, request /_synapse/admin, the replication listener port and the metrics endpoint through the public hostname and through any other address that reaches your reverse proxy, including the federation port if you expose it. Each request should return a refusal, a 404 from the proxy or a connection failure, not a Synapse response. Run the same probes against the server name and any delegated host, because a rule written for one virtual host often misses another. Record the exact request, the source address, the response code and the time, so the result can be repeated later. Ask your proxy and firewall team to confirm which listener ports are bound to private interfaces only, since a service bound to 0.0.0.0 can bypass a proxy rule entirely.
Then test from inside. Run checks from the hosts that should reach the replication listener, typically the main process and the workers listed in your worker configuration, and confirm they still connect. Then run the same requests from an ordinary application host or a worker host that should not have admin access, and confirm the admin API still rejects them. Admin calls should fail without a valid admin access token, and a non-admin account token should be refused. Check that the internal listener requires the shared secret or other authentication configured for replication, and confirm this in the Synapse configuration manual for your version rather than assuming the default. Keep the list of permitted source addresses in version control so reviewers can compare it with what the firewall enforces.
Repeat both sets of checks after every Synapse and reverse proxy upgrade, and after any change to worker layout, listener configuration or proxy templates, because upstream releases can add or move endpoints. Keep the outputs as evidence: dated probe results, the proxy and firewall configuration at the time of the test, the Synapse version, and the name of the person who ran the test and reviewed the result. This record supports an internal or external security review, but it does not amount to an audit or certification. Ask your assessor which artifacts they expect before you start, and confirm your retention period with your compliance team.
How DeployOpen works on this
DeployOpen plans and implements self-hosted Matrix servers inside your own infrastructure, including the network placement of the Synapse Admin API, replication listener and metrics endpoint. The work starts with a written scope that names every listener, route and internal client, and ends with documented controls your security and operations teams can review.
How we scope
- Inventory every Synapse listener, port and path that carries admin, replication or metrics traffic today.
- Record which internal hosts, monitoring systems and operator workstations need access to each endpoint.
- Agree in writing which reverse proxy rules, firewall changes and authentication methods are in scope.
- Engagements are fixed-scope, so deliverables and timelines are confirmed before any change is made.
How we build
- Restrict admin paths at the reverse proxy and confirm that public requests to them are refused.
- Bind the replication listener and metrics endpoint to private interfaces and isolated network segments.
- Configure authentication for internal traffic, such as shared secrets or network-level identity, as agreed in scope.
- Test each rule from outside and inside the network, then keep the test results with the configuration.
How we hand over
- Deliver the final configuration files, proxy rules and firewall policy with a record of each change.
- Document which endpoints are private, who may reach them and how access is granted and revoked.
- Walk your operations team through the verification steps so they can repeat them after upgrades.
- Provide a retest plan that your team can run whenever the homeserver or proxy configuration changes.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- Retained support can recheck exposed paths after each Synapse release and reverse proxy change.
- Confirm with us before the engagement which upgrade and testing responsibilities your team keeps.
- Ask for the support scope, response expectations and reporting cadence in the written quote.

