How to Configure Neo4j Replication User

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a neo4j replication user by creating a database role with cluster sync permissions. Then you assign a dedicated account to that role so nodes can copy graph transactions. Most platform teams start by sharing a single admin account across cluster nodes and operator laptops. That broad setup works at first, but it leaves every graph table open to accidental edits. When one shared key leaks, anyone can read or drop data across the whole cluster. How a neo4j replication user works in a

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You set up a neo4j replication user by creating a database role with cluster sync permissions. Then you assign a dedicated account to that role so nodes can copy graph transactions. Most platform teams start by sharing a single admin account across cluster nodes and operator laptops. That broad setup works at first, but it leaves every graph table open to accidental edits. When one shared key leaks, anyone can read or drop data across the whole cluster.

How a neo4j replication user works in a cluster

A graph cluster needs a clear way to copy changes from leader nodes to follower nodes. In a standard cluster setup, nodes talk to each other over internal network ports. While core node traffic uses certificates, external sync jobs and backup pipelines often need user accounts. Teams create a dedicated neo4j replication user to handle these data copy tasks safely.

First, an admin creates a custom role inside the system database. This role gets read rights on the graph and permission to pull transaction logs. It does not get permission to change user roles or drop databases. Next, the admin creates the user account and links it to the new role. The sync tool or secondary cluster logs in with this account to read new transactions.

Teams also separate machine accounts from human accounts during this step. The replication account runs in the background to keep follower nodes up to date. Engineers get their own accounts for daily checks and debugging. This split helps the security team see if a query came from a sync job or a person.

What native database roles solve and what they miss

Native roles in the database solve the basic problem of who can log in. They stop a sync service from dropping an index or deleting a graph node. They also stop a read-only analyst from creating new user accounts. When you set up clean roles, you shrink the blast radius of a stolen password.

Still, native database roles only check permissions at the table or graph level. Once an engineer or script logs in, the database trusts every valid query from that session. Native roles cannot tell if an approved admin is running a safe check or a bad delete. They also cannot rewrite sensitive fields inside a query result on the fly.

User Provisioning (SCIM) + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

For example, an engineer might query user nodes to fix a broken sync lag. That query can return raw emails, phone numbers, card numbers, or national IDs. Database roles either allow the whole read or block it completely. They do not mask those fields in the result while letting the engineer fix the bug. Also, rotation of static passwords across many sync workers takes manual work and causes downtime.

Best practices for managing cluster sync accounts

Start by auditing every account that connects to your system database today. Remove admin rights from any background worker that only needs to read transaction logs. Give each sync job its own user name so logs show which pipeline ran each query.

Next, stop storing plain text passwords inside config files or build scripts. Store keys in a central secret store and rotate them on a regular schedule. Watch your database audit logs for failed login attempts or unusual read spikes from sync accounts. Finally, put guardrails on human sessions so engineers do not use replication keys for manual fixes.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev sits inline in the protocol beside each supported service as an open-source proxy, a sidecar for your database or API. For every query or command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.

First, hoop.dev guardrails block banned queries before they run or hold risky ones for review, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Why should I avoid using the default admin account for replication?

The default admin account can delete graphs, change roles, and read all data. If a sync script uses it and leaks the password, an attacker gets full control. A scoped account limits damage to only the permitted actions.

Can native Neo4j roles hide personal data during troubleshooting?

Native roles can block access to specific properties on a node or relationship. Still, they cannot mask values like emails or card numbers inside returned query results. You need an external control point to rewrite sensitive fields in flight.

How often should teams rotate credentials for cluster sync accounts?

Teams should rotate static passwords for machine accounts at least every ninety days. You should also rotate them right away whenever an engineer leaves the team. Short-lived session tokens are even better because they expire on their own.

The query runs. The emails stay hidden.