How to Integrate Metabase and RDS Postgres Safely
Teams link metabase and rds postgres to run charts and reports on live data. Metabase sends read queries to your database and shows the results in dashboards. This setup lets staff explore company metrics with ease. Yet a bad setup can expose private data or slow down your main database. You need clear rules for roles, network paths, and query limits. How metabase and rds postgres share data and roles Metabase connects to your database over a secure network link using a database role. When a
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 link metabase and rds postgres to run charts and reports on live data. Metabase sends read queries to your database and shows the results in dashboards.
This setup lets staff explore company metrics with ease. Yet a bad setup can expose private data or slow down your main database. You need clear rules for roles, network paths, and query limits.
How metabase and rds postgres share data and roles
Metabase connects to your database over a secure network link using a database role. When a user opens a chart, the app sends a query to the database. The database checks the role permissions and returns the matching rows to the app.
You should never use the main admin account for your reporting app. Instead, create a dedicated read role just for reporting tasks. Group roles can be set up to manage privileges when there are many users. Users are then granted membership in the group role to keep management simple.
In PostgreSQL, the SELECT privilege allows reading from any column of a table or view. You can also grant this privilege on specific columns of a table or materialized view. Note that the SELECT privilege also allows the COPY TO command on those objects. Granting access only to safe columns helps protect private fields like emails or phone numbers.
Common failure modes in reporting setups
A common mistake is using one shared login with broad rights across all schemas. If someone gets that password, they can read or change every table you own. Another big risk comes from built-in defaults inside the database itself.
The special role name PUBLIC grants a privilege to every role on the system. By default, PUBLIC receives CONNECT and TEMPORARY rights on databases. It also gets EXECUTE rights on functions and procedures. An object owner can revoke these default rights to lock down the system.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
In PostgreSQL 15 and later, regular users cannot create objects in the public schema. Older databases, or ones upgraded from old versions, still allow this by default. An admin must fix this by revoking CREATE on the public schema from PUBLIC. Without this step, a reporting account could write unwanted tables into your database.
Shared accounts also ruin your audit logs during a security review. Every chart run shows up under the same generic app user in the database log. You cannot tell which person ran an expensive query or pulled sensitive card numbers.
Scoping network paths and database permissions
Start by locking down the network path between the two tools. Place your database in a private subnet with no public web address. Allow traffic to the database port only from the specific IP of your reporting server. Require encrypted connections so network snoopers cannot read passwords or query results in transit.
Next, trim the database role down to the bare minimum needed for charts. Revoke default rights from PUBLIC before you add your reporting user. Grant SELECT only on the exact tables, views, and columns that analysts need to read. Leave out columns that hold national IDs, emails, phone numbers, or card numbers. If teams need summary stats on sensitive tables, build a clean view for them. Grant the reporting role access to the view instead of the raw base table.
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 Metabase connect to the primary RDS Postgres instance?
No, heavy reporting queries can slow down your main app traffic. Point your reporting tool at a read replica so big scans stay isolated.
How do I hide sensitive columns from Metabase users?
PostgreSQL lets you grant SELECT on specific columns of a table or view. Grant rights only on safe columns, or mask fields like emails and card numbers.
Why can my read-only Postgres user still create tables?
Databases made before PostgreSQL 15 let the PUBLIC role create objects in the public schema. Revoke CREATE on the public schema from PUBLIC to stop this.
Related guides
In this post