Re: [PATCH] Log details for client certificate failures
Jacob Champion <jchampion@timescale.com>
From: Jacob Champion <jchampion@timescale.com>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2022-07-19T22:08:38Z
Lists: pgsql-hackers
Attachments
- v2-0001-pg_clean_ascii-escape-bytes-rather-than-lose-them.patch (text/x-patch) patch v2-0001
- v2-0002-Don-t-reflect-unescaped-cert-data-to-the-logs.patch (text/x-patch) patch v2-0002
On Tue, Jul 19, 2022 at 10:09 AM Andres Freund <andres@anarazel.de> wrote: > On 2022-07-19 12:39:43 -0400, Tom Lane wrote: > > Having said that, I struggle to see why we are panicking about badly > > encoded log data from this source while blithely ignoring the problems > > posed by non-ASCII role names, database names, and tablespace names. > > I think we should fix these as well. I'm not as concerned about post-auth > encoding issues (i.e. tablespace name) as about pre-auth data (role name, > database name) - obviously being allowed to log in already is a pretty good > filter... v2 adds escaping to pg_clean_ascii(). My original attempt used StringInfo allocation, but that didn't play well with guc_malloc(), so I switched to a two-pass API where the caller allocates. Let me know if I'm missing something obvious; this way is more verbose than I'd like... Thanks, --Jacob
Commits
-
Fix tiny memory leaks
- a9d58bfe8a3a 16.0 landed
-
Don't reflect unescaped cert data to the logs
- 257eb57b50f7 16.0 landed
-
pg_clean_ascii(): escape bytes rather than lose them
- 45b1a67a0fcb 16.0 landed
-
Log details for client certificate failures
- 3a0e385048ad 16.0 landed