Re: Continuous re-validation of session credentials

From: Ajit Awekar <ajitpostgres(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Subject: Re: Continuous re-validation of session credentials
Date: 2026-11-30 06:57:53
Message-ID: CAER375MeRfUd0bExpQ28z+hwSGLHy1LW+ODfQ-tvkG0dQZYTyQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Please find attached v5, a rebase of v4 on top of the current master
(03dd453a67c).

Thanks & Best Regards,
Ajit

On Tue, 24 Nov 2026 at 17:22, Ajit Awekar <ajitpostgres(at)gmail(dot)com> wrote:
>
> Hi Jakub, Daniel,
>
> Thanks for the reviews. Attached is v4, a two-patch series on the
> current master. It addresses your latest comments.
> The changes by patch are below
>
> 0001
>
> 1. Fixes the build failure Jakub reported: auth-validate-methods.c used
> SetCredentialValidationFailureDetail() and MyProcPort->user_name without
> including libpq/auth-validate.h and libpq/libpq-be.h.
> 2. Docs: the description of credential_validation_enabled said validation
> happens "at command boundaries". It is also performed while a session is
> idle, so I corrected that.
> 3. Tests: 008_continuous_validation.pl now shares a single validation window
> between all the scenarios On my machine it went from about 29 s
> to about 7 s.
>
> 0002
>
> 005_cert_continuous_validation.pl is reworked along the lines of Jakub's
> and Daniel's review comments
>
> 1. Revocation no longer uses a runtime CA or CRL. It uses a new committed
> client certificate, client-mid session, and a CRL that revokes it, with
> their config in conf/ and rules in sslfiles.mk, so they are regenerated in
> the same pass as everything else.
> 2. Keys come from the shared sslkey() helper.
> 3. The tests wait for the expected log lines instead of sleeping fixed
> times. On my machine 005 went from about 30 s to about 11 s.
>
>
> Not addressed in this version: PAM (Jakub's point 10 from the earlier review),
> which I'd still like to handle as a follow-up patch.
>
> Thanks & Best Regards,
> Ajit
>
>
>
> On Thu, 22 Oct 2026 at 15:22, Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
> >
> > > On 14 Oct 2026, at 13:28, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com> wrote:
> >
> > > I think the whole 005_cert_continuous_validation.pl test should be somehow
> > > refactored: the other ssl tests simply rely on already generated/existing CA
> > > and mostly nothing is generated in the tests runtime (see ../sslfiles.mk and
> > > somehow use sslconfig.conf (that's ncluded from postgresql.conf).
> >
> >
> > +1, any CA/cert/key/CRL used in testing should be defined in src/test/ssl/conf
> > and be added to sslfiles.mk such that they can be regenerated in a single pass.
> >
> > --
> > Daniel Gustafsson
> >

Attachment Content-Type Size
v5-0003-Add-OAuth-token-expiry-to-credential-validation.patch application/octet-stream 11.0 KB
v5-0004-Add-GSS-credential-expiry-to-credential-validatio.patch application/octet-stream 36.1 KB
v5-0002-Add-TLS-client-certificate-expiry-and-revocation-.patch application/octet-stream 37.5 KB
v5-0005-Add-LDAP-account-existence-check-to-credential-va.patch application/octet-stream 25.9 KB
v5-0001-Add-continuous-credential-validation-framework.patch application/octet-stream 58.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message xnervwang 2026-11-30 07:14:35 Re: GetNewOidWithIndex() can reuse a TOAST value ID while its chunks are still in the heap
Previous Message Xuneng Zhou 2026-11-30 06:52:22 Re: Set 1s WaitLatch timeout if standby limit has expired in ResolveRecoveryConflictWithBufferPin