How to Configure Neo4j Backup User

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up a neo4j backup user, create a custom role with read and backup rights. Then, assign that role to a dedicated service account for your backup jobs. Many teams take a shortcut and use the main admin account for backups. That shortcut gives backup scripts the power to change or delete production graph data. A compromised backup server can then wipe out the whole database. How a neo4j backup user works in graph databases Neo4j uses role-based access control to manage what accounts can d

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.

To set up a neo4j backup user, create a custom role with read and backup rights. Then, assign that role to a dedicated service account for your backup jobs. Many teams take a shortcut and use the main admin account for backups. That shortcut gives backup scripts the power to change or delete production graph data. A compromised backup server can then wipe out the whole database.

How a neo4j backup user works in graph databases

Neo4j uses role-based access control to manage what accounts can do. Built-in roles often grant far too much power for simple daily tasks. The default admin role lets an account drop databases and manage other users. A backup process does not need those broad rights to do its job.

Instead, teams should build a custom role made just for backup tasks. This custom role needs permission to run backup actions and read the graph. It also needs read rights on the system database to check cluster state. Without system read rights, the backup tool cannot map the database layout.

Once you build the role, create a new user account for the backup tool. Give this account a strong key and attach the custom backup role. Do not attach any other default roles to this specific account. The backup tool will log in with this account on a set schedule. It will stream the graph data to a safe storage bucket.

Where native backup roles fall short in production

Native roles do a good job of stopping backup scripts from writing data. They make sure the backup job can only read the graph store. Still, native roles only check who logs in at the start of a session. They do not inspect what individual queries do while the session runs.

A neo4j backup user has full read rights across the entire graph. If an engineer finds the backup login key, they can log in right away. They can run manual queries to read sensitive nodes and edges. The database sees a valid role and allows the read query to run.

Graph databases often store private data like emails, phone numbers, and card numbers. A leaked backup account lets an attacker pull all of those records at once. Native roles cannot mask emails or national IDs in query results. They also cannot require a team lead to approve an unusual login.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Managing backup credentials and audit logs

Static login keys for backup accounts create another big risk for operations teams. Scripts often store these keys in plain text files on backup servers. Rotating these keys takes manual work across both the database and the host. Because rotation is hard, teams often leave the same password in place for years.

Native database logs also struggle to tie shared accounts back to real people. When ten engineers know the backup password, the log just shows one account name. Teams cannot tell which person ran an unplanned query with the backup login. You need a way to tie every database action to a single person.

To keep graph data safe, teams must separate automated tasks from human access. Backup jobs should run without exposing raw database keys to the wider team. When humans need to check backup state, their queries should pass through strict checks. Masking rules can rewrite card numbers and phone numbers in query results.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.

Before a query runs, hoop.dev guardrails check the statement against your rules, an AI Analyzer you configure can score intent or hold risky calls for human approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can I use the built-in reader role for a Neo4j backup user?

No, the basic reader role only lets a user query data in standard graphs. A backup job also needs specific system privileges to export the full database state.

Does an online Neo4j backup lock the graph database for writes?

No, online backups let apps keep reading and writing data during the run. The backup process copies the graph files and then applies recent transaction logs.

How often should teams rotate the password for a backup account?

Teams should rotate static backup keys at least once every ninety days. You should also rotate the key right away if an engineer leaves the team.

The query runs. The emails stay hidden.