How to Configure Neo4j Service Account

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a neo4j service account by creating a non-human user and binding a role. This dedicated identity lets backend apps run graph queries without using personal logins. Many teams start by sharing one admin login across multiple automated jobs. That shortcut creates risk when an app has broad rights to alter or delete data. How a neo4j service account works In a graph database, a service account is a standard database user or cloud credential. Teams create this account to represent one

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 service account by creating a non-human user and binding a role. This dedicated identity lets backend apps run graph queries without using personal logins. Many teams start by sharing one admin login across multiple automated jobs. That shortcut creates risk when an app has broad rights to alter or delete data.

How a neo4j service account works

In a graph database, a service account is a standard database user or cloud credential. Teams create this account to represent one specific app, pipeline, or script. Instead of tying permissions to a person, you tie them to a machine identity. The database checks the account credentials when the app starts a session. Once the account logs in, the database engine checks its assigned roles.

Role-based control in the graph engine splits duties into read, write, and admin tasks. You can build a custom role that only reads specific node labels. You can also limit which relationship types or properties the role can touch. When you bind this role to the neo4j service account, the app gets narrow rights. Each app should get its own account so you can track its work. If one script fails or leaks its key, you can pause just that account. Other services keep running because they do not share the same login.

Managing keys and permissions across environments

Setting up the account is only the first step for a data team. You also need a safe place to store the secret key or password. Most teams put these secrets in a central store and pass them to apps at startup. You should rotate these secrets on a steady schedule to lower risk. When you rotate a key, you make a new one before dropping the old one. This two-step change stops your production apps from dropping live database sessions.

You should also split accounts by stage so test apps never touch live graphs. A test account gets rights only on the test database instance. A live account gets rights only on the live database instance. This boundary stops a bad test script from wiping out real customer records.

Service-to-Service Authentication + Service Account Governance: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native roles solve and what they leave open

Native roles do a good job of deciding who can log into the database. They block an app from writing data if the role only allows read queries. They also let admins group permissions by node label or graph name. This setup stops many basic mistakes and keeps simple pipelines in their lane.

Still, static roles only check permissions at the boundary of the schema. Once a role grants read rights on a node, the app can read every matching record. Native roles cannot pause a single risky command while letting safe ones run. Also, sharing one service account across a cluster of app servers blurs your audit logs. Every query in the log shows the same machine name rather than the trigger. If a user node holds emails or phone numbers, a read role returns them all. Native roles do not rewrite matched fields in results on the fly.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should multiple apps share one neo4j service account?

No, you should give each app or pipeline its own separate account. Separate accounts make audit logs clear and let you revoke one key without breaking other apps.

How do you limit what a service account can read in the graph?

You create a custom role that grants traverse and read rights on specific labels and properties. Then you assign only that custom role to the service account.

How often should teams rotate service account passwords or keys?

Teams should rotate keys on a set calendar schedule and right after any security event. Use two active keys during the switch so running apps do not fail.

The query runs. The emails stay hidden.