PostgreSQL Security, Monitoring and Compliance
Harden your PostgreSQL deployments. Monitor every query. Prove compliance continuously.
PostgreSQL has become the default open-source database for modern enterprise applications. Its flexibility, extensibility, and performance make it ubiquitous, but its default configuration and the speed with which development teams deploy it create consistent security and compliance gaps. DBsafe provides comprehensive security monitoring, PII discovery, and compliance reporting for PostgreSQL environments across all deployment models.
PostgreSQL's default configuration requires deliberate hardening for production security
PostgreSQL is developer-friendly, which means it is frequently deployed with configuration choices optimised for development convenience rather than production security. pg_hba.conf entries that allow md5 or trust authentication from broad IP ranges, superuser accounts shared between application and administrative access, and JSONB columns accumulating personal data without classification are patterns that appear in the vast majority of production PostgreSQL deployments DBsafe scans.
These are not exotic vulnerabilities — they are predictable outcomes of deployment patterns that prioritise speed over security, and they appear at scale.
The cost of inaction
Trust authentication in pg_hba.conf: any user on the network can connect without credentials
Shared superuser credentials: a compromised application account means database administration access
Unclassified JSONB PII: GDPR Article 30 records cannot include data that has not been discovered
PostgreSQL without audit logging: PCI DSS Requirement 10 non-compliance
How DBsafe secures PostgreSQL deployments
Assess pg_hba.conf and authentication configuration
DBsafe's PostgreSQL configuration assessment checks authentication settings, network exposure, superuser account status, and extension permissions against CIS PostgreSQL Benchmark recommendations.
Discover PII including in JSONB and text columns
DBsafe scans all PostgreSQL tables including JSONB, hstore, and text column types where PII frequently accumulates undetected. Classification results feed directly into access control and masking configuration.
Monitor queries and enforce row-level security
PostgreSQL's logical replication protocol enables non-intrusive query capture. DBsafe monitors all database activity and can assist with row-level security policy design and verification.
PostgreSQL configuration hardening
PostgreSQL hardening begins with pg_hba.conf. Every entry should specify the minimum necessary access: scram-sha-256 authentication (not md5 or trust), specific IP ranges (not 0.0.0.0/0), and specific database and role targets. DBsafe's assessment reviews every pg_hba.conf entry and flags overly permissive configurations.
Beyond authentication, PostgreSQL hardening addresses: superuser account management (creating role-separated accounts rather than sharing the postgres superuser), extension permissions (pg_crypto, plpgsql, dblink all have security implications), logical replication slot management, and foreign data wrapper security.
PostgreSQL role and privilege management
PostgreSQL's role-based access system is powerful but complex. Roles can inherit permissions from other roles, creating privilege escalation paths that are non-obvious from examining individual accounts. DBsafe's privilege analysis maps the full role hierarchy and identifies: accounts with SUPERUSER or CREATEDB privileges that do not require them, roles that inherit excessive permissions through role membership, and service accounts with access beyond what their application role requires.
Row-level security policies in PostgreSQL can enforce data separation at the row level, enabling multi-tenant applications to share a single schema with access isolation. DBsafe assists with RLS policy verification and monitors for queries that bypass RLS through elevated privileges.
Discovering PII in PostgreSQL JSONB columns
PostgreSQL's JSONB type has become ubiquitous in modern applications: user preferences, event logs, API response caches, and configuration data are all commonly stored as JSONB. These columns frequently contain personal data that was never classified as PII because the column type obscures its content from schema-level analysis.
DBsafe samples and parses JSONB content, extracting individual key-value pairs and applying PII classification to each. Email addresses, phone numbers, and names embedded in JSON structures are detected with the same accuracy as structured column data.
PostgreSQL audit logging with pgAudit
PostgreSQL's default logging captures connection events and errors but not individual query execution. The pgAudit extension provides statement-level and object-level audit logging that approaches the coverage required by PCI DSS Requirement 10 and other compliance frameworks.
DBsafe complements pgAudit with independent tamper-evident logging that cannot be modified by PostgreSQL superusers. Where pgAudit is not installed, DBsafe's monitoring proxy provides equivalent coverage without requiring the extension.
PostgreSQL on managed cloud services
PostgreSQL is available as a managed service from every major cloud provider: Amazon RDS for PostgreSQL, Amazon Aurora PostgreSQL, Google Cloud SQL for PostgreSQL, Azure Database for PostgreSQL, Supabase, and Neon. Managed PostgreSQL introduces cloud-specific security considerations: IAM database authentication, VPC configuration, parameter groups, and cloud-provider audit log integration.
DBsafe extends its PostgreSQL security capabilities to all managed PostgreSQL services, providing consistent monitoring, masking, and compliance reporting alongside cloud-native security configuration assessment.
PostgreSQL logical replication for CDC and security monitoring
PostgreSQL's logical replication protocol provides a low-overhead, non-intrusive mechanism for monitoring database changes. DBsafe uses logical replication to capture change events from PostgreSQL, enabling both change data capture for ETL purposes and real-time security monitoring without the overhead of full query logging.
Logical replication creates replication slots that must be managed to prevent WAL accumulation. DBsafe monitors replication slot health and alerts on slot lag that could cause disk pressure on the primary server.
Platform Capabilities
Everything you need to address PostgreSQL security — in one integrated platform.
CIS Benchmark Assessment
pg_hba.conf review and configuration hardening against CIS PostgreSQL Benchmark.
JSONB PII Discovery
Parse and classify PII embedded in PostgreSQL JSONB, hstore, and text columns.
Logical Replication Monitoring
Non-intrusive query capture via PostgreSQL logical replication for security and CDC.
Role Hierarchy Analysis
Map role inheritance chains and identify privilege escalation paths.
Cloud Postgres Support
Full coverage for RDS, Aurora, Cloud SQL, Azure PostgreSQL, Supabase, and Neon.
pgAudit Integration
Complement pgAudit with tamper-evident independent logging for full compliance coverage.
Frequently Asked Questions
Answers to the most common questions about PostgreSQL security.
What are the most common PostgreSQL security issues?
The most common PostgreSQL security issues are: overly permissive pg_hba.conf allowing trust or md5 authentication from broad IP ranges, shared superuser accounts used by applications, JSONB columns containing unclassified PII, insufficient audit logging for compliance frameworks, unpatched PostgreSQL versions, and excessive extension permissions (particularly dblink and foreign data wrappers).
Does DBsafe support PostgreSQL row-level security?
DBsafe can verify that row-level security policies are correctly configured on tables requiring row-level isolation. It also monitors for queries that bypass RLS through the use of superuser connections or BYPASSRLS role attributes, ensuring that RLS policies are not inadvertently circumvented.
Can DBsafe monitor PostgreSQL without installing pgAudit?
Yes. DBsafe provides independent query monitoring via a proxy layer that does not require pgAudit to be installed. Where pgAudit is already deployed, DBsafe can complement it with tamper-evident log storage and compliance reporting. For managed PostgreSQL services where extension installation is restricted, DBsafe's proxy-based monitoring provides the required coverage.
How does DBsafe handle PostgreSQL's JSONB columns?
DBsafe samples JSONB column content, deserialises the JSON structure, and applies PII detection to each key-value pair within the JSON document. Email addresses, phone numbers, names, and other PII types embedded in JSONB are detected with the same accuracy as structured column data. JSONB findings are flagged with the specific JSON key paths where PII was found.
Does DBsafe work with Amazon Aurora PostgreSQL?
Yes. DBsafe connects to Aurora PostgreSQL clusters using native PostgreSQL drivers. Aurora-specific features including Aurora Global Database replication and Aurora Serverless v2 are supported. Cloud-specific security configuration assessment covers Aurora parameter groups, IAM database authentication, and VPC security group settings.
Related Solutions
Enterprise Database Security Platform
Stop breaches before they happen. Monitor every query, control every access, protect every record.
Learn moreComprehensive Database Audit Logging
Know who accessed what, when, from where, and why. Always.
Learn moreGDPR Compliance for Your Database Estate
Meet every GDPR technical requirement. Prove it continuously. Respond to regulators in hours, not weeks.
Learn more