How to Configure Neo4j Audit Log

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a neo4j audit log by turning on security and query logging in your database settings. This setup writes user login events and graph queries to local files on your server. Most teams turn on these files to pass audits and track who changed graph data. Still, broad database roles still let users run risky queries before any team reviews the log files. How the native neo4j audit log works A graph database splits tracking into two main log files. The security log tracks user logins, fa

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 audit log by turning on security and query logging in your database settings. This setup writes user login events and graph queries to local files on your server. Most teams turn on these files to pass audits and track who changed graph data. Still, broad database roles still let users run risky queries before any team reviews the log files.

How the native neo4j audit log works

A graph database splits tracking into two main log files. The security log tracks user logins, failed password checks, and role changes. The query log records every Cypher statement that runs against the graph. You turn on both logs inside the main database settings file on each server node. After you change the settings, you often restart or reload the database service.

Once active, the database writes events to local disk files as users run queries. Admins can set rules to rotate these files when they grow too large. You can also choose between plain text and structured formats for easier parsing. In a cluster setup, each node writes its own local log files. Your team must run a log shipper on every node to send files to one central store.

What native logging solves and where gaps remain

Native logs give you a historical record of database events. They help security teams check who logged in and when a role changed. You can also see which user account ran a slow or broken query yesterday. This record is a good first step for basic compliance reviews.

Still, native logging only records events after the query finishes or fails. It decides what gets written to disk, not what a query can do in flight. If an engineer logs in with a shared role, the log only shows the shared name. You cannot tell which real person on the team ran a destructive graph update. Also, raw query logs often capture sensitive data passed inside query text. Emails, phone numbers, card numbers, and national IDs can end up in plain text log files.

Audit Log Integrity + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Managing logs across many graph nodes also adds daily work for your team. If a local disk fills up, the database can slow down or drop log events. And because the logs sit on the server, an admin with host access could alter them.

How to improve graph query tracking and control

To fix identity gaps, link every database session to a single human user. Avoid shared admin accounts for daily work or production fixes. Give engineers the smallest role they need to read or write specific graph labels. Next, filter sensitive fields before they reach engineer screens or external log stores. Masking rewrites matched fields like card numbers or emails in query results. Finally, add an approval step for write queries so bad changes stop before they run.

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

Does the Neo4j Community Edition include audit logs?

No, native security and query audit logs are only in the Enterprise Edition. Teams on Community Edition must track queries outside the database before they reach the server.

What is the difference between the security log and the query log?

The security log tracks login events, user creation, and role changes. The query log records the actual Cypher statements that users run against the graph data.

Can native audit logs block a bad Cypher query?

No, native logs only write down what happened after a query starts or finishes. To block risky commands or mask data in results, you need controls before the database runs the query.

The query runs. The emails stay hidden.