How to Integrate Metabase and Aurora Postgres Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair metabase and aurora postgres to turn production data into live charts and dashboards. The business app sends read queries to the database cluster and shows clean tables. Setting up this link the wrong way puts private customer data at risk. A shared admin account lets any chart builder change tables or read private fields. Good database rules stop bad queries before they hurt your main cluster. How metabase and aurora postgres share data and roles The chart tool logs into the data

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 metabase and aurora postgres to turn production data into live charts and dashboards. The business app sends read queries to the database cluster and shows clean tables.

Setting up this link the wrong way puts private customer data at risk. A shared admin account lets any chart builder change tables or read private fields. Good database rules stop bad queries before they hurt your main cluster.

How metabase and aurora postgres share data and roles

The chart tool logs into the database with a single database user role. When a team member opens a dashboard, the app builds a read query. It sends that query over the network to the database reader endpoint.

You should point the reporting app to a read replica instead of the writer node. This setup keeps heavy dashboard loads away from your main app traffic. Your core customer app stays fast even when someone runs a huge report.

Next, you must lock down what that database role can do. PostgreSQL lets you set up group roles to manage permissions for many users. You can create a read-only group role and assign the reporting user to it.

That role only needs permission to read specific tables and views. In PostgreSQL, the SELECT privilege lets a role read from whole tables or specific columns. You can grant read rights on safe columns and leave out emails or card numbers.

Common failure modes with shared database accounts

Many teams use their main app account to hook up their reporting tool. That choice creates a big risk for your production system. Anyone who can write raw queries in the chart tool gets full write rights.

Default database grants can also leak more rights than you expect. In PostgreSQL, the special role name PUBLIC gives rights to every role on the system. By default, PUBLIC gets rights to connect to databases and create temporary tables.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

It also gets rights to run functions and procedures unless the owner revokes those defaults. Older database setups also had loose rules on the default schema. In PostgreSQL 15 and later, regular users cannot create objects in the public schema by default.

If you upgraded from an older version, an admin must revoke that create right from PUBLIC. Without this step, a reporting account might still build new tables in your production schema.

Shared accounts also make audit logs hard to read during an incident. Every dashboard run shows up in the database log under the exact same user name. You cannot tell which person on your team ran a slow query or pulled phone numbers.

Scoping network paths and column access in production

Start by placing both tools inside a private network with strict firewall rules. Only allow traffic from the reporting server IP address to the database port. Never expose the database cluster to the public internet just to run reports.

Next, review every table that contains private customer data like national IDs or phone numbers. Do not grant full table read rights on those records to the reporting role. Instead, grant SELECT on only the safe columns, or build clean views for your analysts.

You should also set a query timeout on the database role used for reporting. If a user writes a bad join, the database will cancel the slow query. This simple limit keeps one broken chart from locking up your reader node.

Check every Postgres query on the wire

Database roles and network rules decide who can open a session. They do not read what each SQL statement does after login. With hoop.dev, you run an open-source proxy, a sidecar for your Postgres. It runs beside your database and reads the Postgres wire protocol. Your apps and agents keep their login details and change only the host and port in the connection string their tool uses.

Before a query runs, hoop.dev guardrails check the statement by its effect, table, or pattern. They refuse bad deletes or drops with a real Postgres error. On the way back, hoop.dev data masking rewrites sensitive values in returned rows based on your rules. Every query and verdict goes to the audit trail. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and generates evidence for HIPAA, GDPR, and PCI DSS. See the code on GitHub.

Frequently asked questions

Should I connect my reporting tool to the writer or reader endpoint?

Always use the reader endpoint for reporting and chart tools. This keeps heavy analytical queries from slowing down writes on your primary database node.

How do I stop analysts from reading sensitive columns in PostgreSQL?

Grant the SELECT privilege on only the safe columns of a table. Leave columns with emails, phone numbers, or card numbers off the grant list.

Why can my read-only database user still create objects in the public schema?

Databases created before PostgreSQL 15 let the PUBLIC role create objects in the public schema. An admin must revoke that right from PUBLIC on older or upgraded clusters.

The query runs. The emails stay hidden.