Blog

Insights on database security, access control, and safe production querying.

Why Read-Only Database Permissions Aren't Enough

Most teams protect production databases by granting users read-only permissions at the database level. While this is a good starting point, it has significant gaps that can lead to data incidents.

The Problem with Database-Level Permissions

Database permissions control what a user can do, but they have blind spots:

Application-Layer Enforcement

ReadSentinel takes a different approach: every query is parsed using ANTLR-based SQL grammars before it reaches the database. This means:

This creates a defense-in-depth approach: even if database permissions are misconfigured, the application layer prevents damage.

The Credential Problem

With traditional SQL clients (DBeaver, DataGrip, pgAdmin), every user needs the connection string including the password. When someone leaves the team, you need to rotate credentials on every database they had access to.

With ReadSentinel, connection strings are encrypted with AES-256-GCM and never exposed to end users. Team members select a connection from a list and query — without ever seeing the host, port, or password. Offboarding is instant: deactivate the user account.

How to Prevent Accidental DELETE in Production

Accidental DELETE FROM table without a WHERE clause is one of the most common production incidents. Here's how teams typically handle it — and why most approaches are insufficient.

Common Approaches

The ReadSentinel Approach

Block writes at the application layer, period. The query DELETE FROM customers never reaches the database because ReadSentinel's ANTLR parser identifies it as a DELETE statement and rejects it before execution. The user gets a clear error: "Only SELECT queries are allowed."

This works for:

None of these users need write access. With ReadSentinel, they physically cannot write — regardless of the underlying database permissions.

Database Access Audit Trail: What SOX and GDPR Require

If your organization handles financial data (SOX) or personal data (GDPR), you need to answer: who accessed what data, when, and why?

What Auditors Look For

How ReadSentinel Helps

ReadSentinel's audit log captures every query execution with:

The audit log is stored in a separate append-only database and accessible via the admin panel with filters. Export for auditor review on demand.

Combined with role-based access control, you have a complete picture: "User X, with role Y, ran query Z against database W at time T and got N rows back."