pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Allow matching the DN of a client certificate for authentication
Date: Thu, 1 Apr 2021 14:03:11 -0400
Message-ID: <1778fbb3-8754-f336-1ffa-413fdbc61fdf@dunslane.net> (raw)
In-Reply-To: <E1lQxtk-0002BR-Sy@gemulon.postgresql.org>
References: <E1lQxtk-0002BR-Sy@gemulon.postgresql.org>


On 3/29/21 3:50 PM, Andrew Dunstan wrote:
> Allow matching the DN of a client certificate for authentication
>
> Currently we only recognize the Common Name (CN) of a certificate's
> subject to be matched against the user name. Thus certificates with
> subjects '/OU=eng/CN=fred' and '/OU=sales/CN=fred' will have the same
> connection rights. This patch provides an option to match the whole
> Distinguished Name (DN) instead of just the CN. On any hba line using
> client certificate identity, there is an option 'clientname' which can
> have values of 'DN' or 'CN'. The default is 'CN', the current procedure.
>
> The DN is matched against the RFC2253 formatted DN, which looks like
> 'CN=fred,OU=eng'.
>
> This facility of probably best used in conjunction with an ident map.
>
> Discussion: https://postgr.es/m/92e70110-9273-d93c-5913-0bccb6562740@dunslane.net
>
> Reviewed-By: Michael Paquier, Daniel Gustafsson, Jacob Champion




Belated credit where it's due: this work was originally based on a patch
from Kosmas Valianos of AppGate.


cheers


andrew







view thread (3+ messages)  latest in thread

Message-ID: <1778fbb3-8754-f336-1ffa-413fdbc61fdf@dunslane.net>
Permalink:  ../1778fbb3-8754-f336-1ffa-413fdbc61fdf@dunslane.net/
Also on:    postgresql.org/message-id/1778fbb3-8754-f336-1ffa-413fdbc61fdf@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andrew@dunslane.net
  Subject: Re: pgsql: Allow matching the DN of a client certificate for authentication
  In-Reply-To: <1778fbb3-8754-f336-1ffa-413fdbc61fdf@dunslane.net>
  References: <E1lQxtk-0002BR-Sy@gemulon.postgresql.org> <1778fbb3-8754-f336-1ffa-413fdbc61fdf@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox