How to Integrate Looker and MongoDB Atlas Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair looker and mongodb atlas to build live charts from document data. This setup lets staff explore fresh app records and build reports in one place. Data teams need fast answers from their production databases. Yet giving a reporting tool broad database rights creates huge security risks. A safe setup limits what the reporting tool can read and change. It also tracks who runs each query and protects sensitive fields. How looker and mongodb atlas share data and roles Looker needs a cl

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.

Teams pair looker and mongodb atlas to build live charts from document data. This setup lets staff explore fresh app records and build reports in one place.

Data teams need fast answers from their production databases. Yet giving a reporting tool broad database rights creates huge security risks. A safe setup limits what the reporting tool can read and change. It also tracks who runs each query and protects sensitive fields.

How looker and mongodb atlas share data and roles

Looker needs a clear network path and a valid user to query data. Since Looker speaks SQL, it requires a relational view of your document store. Once linked, the reporting tool sends queries using a dedicated database user account. MongoDB uses role-based authorization to control what that user can do.

A role grants specific privileges to perform actions on defined database resources. Each role applies to the database where admins define it. Roles can grant permissions down to a single collection level of detail. MongoDB Atlas database users have different built-in roles than self-hosted deployment users. Still, both systems build their roles from the same set of privilege actions.

For reporting tools, teams should always assign the built-in read role. The read role gives read permissions on all non-system collections in its database. It also allows reading the system.js collection when needed. This role works through actions like find, listCollections, listIndexes, dbStats, collStats, and changeStream. It never includes insert, update, remove, or dropCollection actions.

Common failure modes in reporting setups

Many teams make mistakes when they rush to set up new dashboards. The most common error is using the readWrite role for reporting accounts. The readWrite role includes everything in the read role plus data change rights. Its actions include insert, update, remove, createCollection, createIndex, dropIndex, and dropCollection. A reporting tool never needs to drop collections or change production records.

Another big risk comes from using one shared service account for all users. When every chart uses one login, database logs only show that single account. Security teams cannot tell which analyst ran a slow or broad query. Shared passwords also stay in settings for months without rotation.

MongoDB Authentication & Authorization + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Broad collection roles also expose private customer records to too many staff members. Analytics tables often hold emails, phone numbers, card numbers, or national IDs. If the database role allows access to the whole collection, every analyst gets those fields. Data masking solves this by rewriting matched fields in query results.

Steps to scope roles and network paths

Start by creating a dedicated database user just for your reporting tool. Grant this user the read role only on the specific databases needed. If analysts only need a few collections, scope the role to those collections. Never give the reporting user write permissions or admin rights.

Next, lock down the network path between the analytics app and the database. Do not open your database cluster to the public internet. Use private network links or strict IP allowlists for all query traffic. Require encrypted transport for every query that crosses the network.

Finally, review your audit logs and field exposure on a regular schedule. Check which collections the reporting account queries most often. Add data masking to rewrite emails, card numbers, and phone numbers in results. Remove collection permissions that the reporting team no longer uses.

Inspect MongoDB wire traffic in flight

Built-in MongoDB roles govern collection access at setup time. They cannot score command risk per call or mask sensitive document values on the fly. By design, hoop.dev is an open-source proxy that sits next to MongoDB as a sidecar for your MongoDB. It reads every command from mongosh, drivers, or agent tools.

First, hoop.dev guardrails block bad deletes, drops, and write pipelines. Next, hoop.dev data masking rewrites sensitive values in returned documents based on your rules and logs each decision. Explore the repo on GitHub.

Frequently asked questions

Which database role should we give to our reporting user?

Assign the built-in read role or a custom role scoped to specific collections. The read role allows find and list actions without allowing data changes. Never assign the readWrite role to a dashboard or analytics tool.

How can we stop dashboards from exposing sensitive customer fields?

Scope your database roles down to the exact collections needed for charts. For collections with private data, apply masking rules to rewrite matched fields in results. This protects emails, phone numbers, card numbers, and national IDs during analysis.

Why are shared database users risky for analytics teams?

A shared user hides the true person behind each database query. If a query slows down the cluster, logs only show the shared account name. Individual identity tracking and scoped roles make audits clear and fast.

The query runs. The emails stay hidden.