惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
Malwarebytes
Malwarebytes
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
F
Future of Privacy Forum
C
Cisco Blogs
T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
S
Securelist
K
Kaspersky official blog
S
Schneier on Security
T
ThreatConnect
T
Tenable Blog
Spread Privacy
Spread Privacy
T
True Tiger Recordings
AWS News Blog
AWS News Blog
F
Fox-IT International blog
量子位
T
Threatpost
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
Cisco Talos Blog
Cisco Talos Blog
GbyAI
GbyAI
宝玉的分享
宝玉的分享
腾讯CDC
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
Cyberwarzone
Cyberwarzone
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
U
Unit 42
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
The Register - Security
The Register - Security
MyScale Blog
MyScale Blog
小众软件
小众软件
A
About on SuperTechFans
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
美团技术团队
Google Online Security Blog
Google Online Security Blog
P
Proofpoint News Feed
MongoDB | Blog
MongoDB | Blog

DEV Community

AI-Discovered Vulnerabilities Need A Triage Queue, Not A Panic Channel AI Agent Workboards Need Audit Controls Before They Need More Agents Demystifying DevRel: What It Actually Is (And Why Should You Become One?) Your AI, Your Device, Your Data - Introducing Aide Gemma 4 GenAI Coach - GenAI Concepts Made Easy with an Interactive Playground QuietPulse - Mood Tracker Principal Components in TypeScript (Part 3) Gemma 4 CAD Orchestrator I built a local Postgres triage co-pilot because HIPAA says I can't paste plans into ChatGPT or Claude Live Holographic Editor In Fractal Time Everbench: A document management system with Local Intelligence Instanton in Fractal Time The Hidden Features of Claude How I Built an AI News Brief with Next.js, Supabase, Vercel, and GPT-4o-mini How We Built a Multi-Agent AI Documentation System (And What We Learned) I got tired of writing post-mortems — so I built RCAi for SREs MIA: A Futuristic AI Desktop Assistant Built with Voice, Gestures, and Controlled Chaos Best Programming Language for Backend Web Development: PHP vs Python PayPal Alternatives for Indian Businesses: Best Payment Gateways for International Card Payments (2026) Gemma 4 Made Me Rethink Local AI: Not Just Text, But Images Too Clean Architecture in .NET Explained (The Dependency Rule) I Compiled Rust to WebAssembly and Made My JavaScript 6 Faster Outlook.com Is the Final Boss of 'Just Send an Email' Conditional Statements and Control Flow in Python Insults & Cutlasses, Local LLM Sword Fighting on Melee Island Production Lab: ECS Fargate + Prometheus + Grafana + Loki + Alloy + Node Exporter How 12 AI agent frameworks handle human approval (most badly) The Four-Index Reality: Why AI Search Isn't One Thing I Scanned 1 Million AI Services. Here's What Worries Me More Than the Vulnerabilities Managing multiple docker hub accounts using docker-use System Design Interview: Decentralized Web Crawler Metric Cardinality: High or Low? 4 Steps to Making the Right Choice 로컬 LLM 셋업 가이드 (v23) GEO vs SEO in 2026 — What Google's May Guidance Changed Cursor Review 2026 — Honest 'Not For Me' Take From a VSCode User Hello from rikuq — a practitioner blog for solo AI SaaS founders Why DevOps Engineers Need Practical Tutorials, Not Just Theory AI Agents in CI/CD: Give Them Context, Not Production Authority Now I See Why Translators Are Panicking Over AI—Should Coders Panic Too? Why I Track HRV Every Morning (And How It Actually Changes My Day) Diffusion Language Models: How NVIDIA's Nemotron-Labs DLM Is Killing Token-by-Token Generation Chatbots GPT pour le support client : ce que les équipes françaises ont réellement besoin de savoir I Hit the 1,232-Byte Wall So You Don't Have To Google Just Rebuilt the Search Box (Again) — But This Time It's Different Aether: A local Android assistant built with Gemma 4 BoxAgnts Introduction (1) — Out of the Box mkdev: trusted HTTPS for localhost, mapped by name Just one question, one answer. Why Java Still Rules the Programming World in 2026 Four Architectures for Letting Claude Edit Elementor (and Why We Shipped Clone-and-Mutate) yard-yaml 0.1.1: safer UTF-8 handling for YAML documentation I Built a Mac App That Keeps Your Clipboard in Sync Across All Your Android Devices Stop Using UUIDs: Why B2B SaaS Needs ULIDs in Laravel 🐘 I'm a non-technical founder who built a Slack approval tool. Here's what actually broke first. Open-Sourcing Our Game AI Stack — SDKs, Templates, and CLI Tools for NPC Dialogue I Built an AI System That Makes 1,000 Decisions a Day. Here's Where I Drew the Line. Lets Encrypt DNS Challenge with Traefik and AWS Route 53 Building an agent-ready website: how to make your site readable for ChatGPT, Perplexity and autonomous agents A productivity tool with GitHub as your cloud database How We Built Dynamic NPC Dialogue with LLMs — Lessons from Early Access cmux: The Native macOS Terminal Built for Running AI Coding Agents in Parallel Deep Atlantic Storage: Rewriting in Rust How I Built a Bulk Image Optimizer with $0 Server Costs Using Vanilla JS and Canvas API Humans and Machines read differently, I think I have a fix? Claude Code Deleted 92 Images Without Asking. This Happens More Than You Think. Method Calling Stack in Java I Built Schedule Sensei & Pushed It to GitHub – Here's What's Inside (And I Need Your Help 👀) OIC: From a Working Toast Watcher to a General "Watch It for Me" Agent Memory is two-thirds of what an AI chip costs to build The XState persistence problem is five years old. Here is what we built to finally solve it. i added MCP support to my SaaS in an afternoon. here's the whole thing. Framework: Link Building ☁️ Importing existing S3 buckets into Terraform state made easy with terraform import existing s3 bucket I Built a Token System on Solana (Without Any Backend Code) 터미널 AI 에이전트 구축 (v21) I Built an AI 3D Model Generator — Here's How I Handle Meshes in the Browser 🛡️ PromptGuard: I Built a Local AI Privacy Firewall That Sanitizes Your Prompts Before They Leave Your Machine PostgreSQL WAL Bloat: Why Automatic Management Is Often Insufficient? Seven PRs Before Lunch: Parallel Claude Code Tabs Plus Audit-Before-Bump Deployment using all three Kubernetes probes Qwen 3.6 Has Four Tiers. Here's How to Route Without Burning Cash. RAG 시스템 실전 구축 (v21) How I handle my errors in PHP The Blind Spot in Treasure Hunt Engine Configuration: Long-Term Server Health Run NVIDIA NIM on Your Own GPU — Same API, Different Endpoint Webflow SEO Implementation 로컬 LLM 셋업 가이드 (v21) How Logs Travel From Your EKS Pod to Datadog 𝗦𝘁𝗼𝗽 𝗖𝗿𝗮𝗺𝗺𝗶𝗻𝗴 𝗙𝗼𝗿 𝗘𝘅𝗮𝗺𝘀, 𝗦𝘁𝗮𝗿𝘁 𝗕𝘂𝗶𝗹𝗱𝗶𝗻𝗴 𝗥𝗲𝗮𝗹 𝗦𝗸𝗶𝗹𝗹𝘀 How to Use EXPLAIN ANALYZE in PostgreSQL: A Visual Guide gRPC Performance: tonic (Rust) vs grpc-go Benchmarked at Scale Hack The Box (HTB): Cap Machine (Full Walkthrough) Visual Search Optimization studygemma: AI study buddy for CS students Architectural Tradeoffs in Webhook Idempotency and SaaS API Versioning One Open Source Project a Day (No. 75): Understand Anything - The AI Engine That Turns Any Codebase Into an Explorable Knowledge Graph From mock-only-works to real-world-works: 48 hours of reCAPTCHA debugging I built a free music tool AI Talking Avatar Pipelines Broke Our Ad CTR by 3.7% 800G to 400G Breakout: How to Scale 400G Networks with 800G Ports
The pgAudit Attribution Gap: Why Role-Level Logging Fails GDPR and How to Close It
Alex Serban · 2026-05-25 · via DEV Community

What pgAudit Actually Logs

pgAudit is a PostgreSQL extension that captures query-level events at the database session layer. A typical entry looks like this:

2026-03-14 11:22:08 UTC [8841]: [4-1]
  user=app_user,db=production,app=psql
  AUDIT: SESSION,1,1,READ,SELECT,TABLE,users,
  SELECT id, email, subscription_tier FROM users WHERE region = 'EU';

Enter fullscreen mode Exit fullscreen mode

This tells you: the role app_user ran a SELECT against the users table at 11:22 UTC. Accurate. Tamper-resistant. Exactly what pgAudit is designed to produce.

It does not tell you which human being was behind that session.

In every production PostgreSQL application using a connection pooler PgBouncer, PgCat, Odyssey all queries arrive at the database authenticated as a shared service account. Your Django backend, your Node API, your internal admin panel, and your data team's analytics queries all hit Postgres as app_user. pgAudit logs all of them identically.


The Gap, In Two Log Entries

This is the difference between a compliant and a non-compliant audit trail:

What pgAudit produces (shared credential):

2026-03-14 11:22:08 UTC
  user=app_user
  SELECT id, email, subscription_tier FROM users WHERE region = 'EU'
  rows_returned: 47291

Enter fullscreen mode Exit fullscreen mode

What a compliant audit log contains:

2026-03-14 11:22:08 UTC
  session_user_id: employee_id_2291
  session_email: j.muller@company.com
  db_role: app_user
  query: SELECT id, email, subscription_tier FROM users WHERE region = 'EU'
  affected_table: users
  columns_accessed: id, email, subscription_tier
  rows_returned: 47291
  masked_fields: email → j***@***.com
  log_id: immutable-7a3c91f2

Enter fullscreen mode Exit fullscreen mode

Same query. Same shared credential. Same database. The difference is where the user's identity was captured.

Run this on your database now: SELECT usename FROM pg_stat_activity;

If every row shows app_user instead of individual emails, you have the gap.


Why the Obvious Workaround Doesn't Hold

The standard response to this problem is session-level injection: set a PostgreSQL session variable that identifies the current user before each query.

SET app.current_user = 'alice@company.com';
SELECT id, email FROM users WHERE id = $1;

Enter fullscreen mode Exit fullscreen mode

pgAudit then captures alice@company.com. The attribution problem appears solved.

It is not solved in most production systems.

The reason is PgBouncer in transaction mode the default configuration for production deployments because it provides the best connection multiplexing efficiency. In transaction mode, a client connection is bound to a server connection only for the duration of a single transaction. Between transactions, the server connection is returned to the pool and reassigned to a different client.

When that reassignment happens, session state resets. The SET app.current_user variable you injected at the start of your request is gone before the next query runs. You get no error, no warning, and no log entry indicating the attribution failed. The audit log quietly fills with app_user entries while your system appears to be working correctly.

This is not a configuration mistake you can fix. It is how transaction-mode pooling works.


What GDPR Actually Requires

In January 2026, CNIL fined France Travail €5 million. The decision cited two specific Article 32 failures: access authorizations defined too broadly, and logging insufficient to detect abnormal behaviour. The investigators could not reconstruct the full scope of the breach because the logs did not capture enough granularity.

In March 2026, Italy's Garante fined Intesa Sanpaolo €31.8 million. One employee ran 6,637 unauthorized queries across 3,573 customer records over 460 working days. pgAudit ran throughout. Not one query triggered an alert, because pgAudit attributed every query to app_user making the employee's pattern invisible.

Neither company lacked logging. Both lacked attribution.

Article 5(2) of GDPR requires you to demonstrate that personal data is processed lawfully. Article 32 requires appropriate technical measures. The operational implication, made explicit by both decisions: your logging must be sufficient to identify which person accessed which records, not just which role executed which query.

Two scenarios where this becomes an immediate liability:

Data subject access requests. Under Article 15, a data subject can ask for a complete record of who accessed their personal data and when. If your audit log only shows app_user, you cannot produce a complete response. An incomplete DSAR response is itself a violation.

Insider access investigations. Both France Travail and Intesa Sanpaolo involved authorized users accessing records outside their legitimate scope. In both cases, the regulator found the company could not reconstruct what happened which is treated as evidence of inadequate controls, regardless of intent.


The Fix: A Query Proxy Covers Every Access Path

There is only one approach that covers all paths into your database: a query proxy layer that intercepts every query before it reaches Postgres, while the application-layer identity is still available.

Per-user database roles solve the attribution problem cleanly each person connects with their own credential, and pgAudit attributes correctly. In practice, this is incompatible with connection pooling at any meaningful scale, requires role management across every migration, and breaks most ORM configurations.

Application-level audit middleware covers queries that go through your application. It misses direct database access by engineers running ad-hoc queries, analytics tools, migration scripts, and DBA sessions exactly the access paths that created liability in France Travail and Intesa Sanpaolo. If your application logs are your only audit trail, those paths are invisible.

A query proxy sits between your application and your database, intercepting before the connection pool strips identity. It covers every access path application queries, direct connections, analytics tools, and DBA sessions all pass through the same point. It requires no changes to your application code, your ORM, or your database role structure.


How Scalple Closes the Gap

Scalple is a query-level PostgreSQL proxy. It runs between your application and your database and intercepts every query before it reaches Postgres.

Here is how identity capture works: your application passes the authenticated user's identity as a connection parameter a single line in your database connection string, not an application code change. Scalple reads this parameter at the connection layer, before PgBouncer enters the picture. Because Scalple sits in front of PgBouncer, the transaction-mode session reset that breaks SET app.current_user does not apply identity is captured at the proxy layer, not the session layer.

For each query, Scalple writes an immutable, append-only log entry: the user ID, session metadata, the full query text, the tables and columns touched, masked values for fields you designate as PII, and a tamper-evident log ID. Then it forwards the query to Postgres as normal.

Your application continues connecting as app_user. Your PgBouncer configuration does not change. Your ORM does not change. Deployment is a connection string change your app points to Scalple instead of directly to Postgres, and Scalple forwards to Postgres. Setup takes under 30 minutes.

If CNIL asked you today for every access to a specific user's data over the last six months, Scalple gives you that query in under a minute. Without it, you have app_user.


Before the Next Fine

France Travail was fined €5 million. They had logging. The logging was insufficient because it could not reconstruct who accessed what.

Intesa Sanpaolo was fined €31.8 million. They had pgAudit running for 460 working days. One employee's unauthorized access pattern was invisible the entire time.

The engineering team that enabled pgAudit and stopped is not non-compliant because they chose the wrong tool. pgAudit is the right tool for query-level database logging. It is not the right tool for GDPR access attribution, because in a pooled environment it cannot attach a human identity to a database query.

The demo at scalple.com runs against a live PgBouncer connection pool. You can see exactly what your current pgAudit log is missing and what a compliant per-user audit log looks like in its place.


Scalple is a database audit platform for B2B SaaS teams with GDPR obligations. Per-user query attribution at the proxy layer, no application code changes required.