How to Integrate DataGrip and Azure Postgres Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use datagrip and azure postgres together to run SQL queries on cloud databases. This setup lets developers read tables, test changes, and check data from their local machines. When you link a desktop SQL client to a cloud database, safety matters. Without good rules, local laptops hold strong keys and broad rights. You must lock down how users log in, what they can read, and how traffic flows. How login and rights work between datagrip and azure postgres The desktop client talks to the

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 use datagrip and azure postgres together to run SQL queries on cloud databases. This setup lets developers read tables, test changes, and check data from their local machines.

When you link a desktop SQL client to a cloud database, safety matters. Without good rules, local laptops hold strong keys and broad rights. You must lock down how users log in, what they can read, and how traffic flows.

How login and rights work between datagrip and azure postgres

The desktop client talks to the cloud database over a secure network link. A user enters host details, a database name, and login keys into the client. The client then opens a connection to the cloud server and sends SQL queries.

You can log in with standard database users or cloud directory accounts. Cloud directory tokens are safer than static passwords stored on a laptop. Tokens expire after a short time, which lowers the risk of stolen keys.

Once logged in, PostgreSQL roles control what the user can do. You should set up group roles to manage rights when you have many users. You then grant each person membership in the right group role.

For read-only needs, the SELECT privilege lets a role read from a table or view. You can also grant SELECT on specific columns of a table. Note that the SELECT privilege also lets a user run COPY TO.

By default, a special role named PUBLIC gives rights to every role on the system. PUBLIC gets CONNECT and TEMPORARY on databases, plus EXECUTE on functions and procedures. The object owner can revoke these default rights to tighten security.

In PostgreSQL 15 and later, regular users cannot create objects in the public schema by default. On older or upgraded databases, an admin must revoke CREATE on the public schema from PUBLIC.

Azure RBAC + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Common failure modes and how to scope roles

A common mistake is sharing one admin account across the whole engineering team. When everyone uses the same login, you cannot tell who ran a bad query. If someone leaves the team, you must rotate the password for every developer.

Broad permissions are another big risk for production data. If a developer logs in with write rights, one wrong query can drop a table. Local SQL clients also cache results, which puts raw emails and card numbers on laptops.

To fix this, give each person their own login and assign a narrow group role. Only grant SELECT on the exact tables and columns needed for daily work. If a table holds phone numbers or national IDs, leave those columns out of the grant.

Network paths between the client and the cloud server also need strict limits. Never open your database port to the whole internet. Use private network links or strict firewall rules so only known IP addresses can reach the server.

Auditing queries and protecting sensitive fields

Even with scoped roles, you need a clear log of every query run through desktop tools. Native database logs can grow fast and miss who the real person behind a shared role is. Teams should tie every database session back to a single human identity.

You also need a plan for sensitive fields like emails, phone numbers, and card numbers. Column grants help, but sometimes a support engineer must query a table that holds private data. In those cases, data masking rewrites matched fields in results before they reach the screen.

Run guardrails and masking on the Postgres connection

Role grants and firewall rules are needed setup. Setup alone cannot check single SQL statements or mask sensitive rows in a response. By design, hoop.dev is an open-source proxy that sits beside Postgres, RDS, or Aurora as a sidecar for your Postgres. Clients and agent tools keep their credentials and point their connection string at the listener.

On each query, hoop.dev guardrails refuse disallowed drops, deletes, or table reads before they run. Next, hoop.dev data masking rewrites sensitive fields in returned rows that match your rules. Furthermore, hoop.dev holds SOC 2 Type II and logs every statement and verdict per resource. Check out the project on GitHub.

Frequently asked questions

How do I give a developer read-only rights in Azure Postgres?

Create a group role and grant it the SELECT privilege on the needed tables or columns. Then add the developer's user account to that group role and revoke unneeded defaults from PUBLIC.

Why can users still create objects in my public schema?

Databases created before PostgreSQL 15 let the PUBLIC role create objects in the public schema. An admin must revoke the CREATE right on the public schema from the PUBLIC role.

Should teams store database passwords inside DataGrip?

Storing static passwords on laptops is risky if a device is lost or stolen. Use short-lived cloud identity tokens and require fresh logins for each workday instead.

The query runs. The emails stay hidden.