From: Tom Lane <tgl@sss.pgh.pa.us>
To: Albrecht Dreß <albrecht.dress@arcor.de>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Q: cert authentication and user remapping fails
Date: Fri, 06 Dec 2019 12:52:44 -0500
Message-ID: <17778.1575654764@sss.pgh.pa.us> (raw)
In-Reply-To: <NV7V2E3B.DNJBSI3A.SXG5UOID@C6UM6KSS.I47KT6BN.VTVKOWVO>
References: <NV7V2E3B.DNJBSI3A.SXG5UOID@C6UM6KSS.I47KT6BN.VTVKOWVO>
Albrecht =?iso-8859-1?b?RHJl3w==?= <albrecht.dress@arcor.de> writes:
> In my installation, the user certificate CN's contain human-readable names (utf8, with spaces, etc.). I want *all* users connecting with cert authentication to be mapped to a certain database role.
I don't think that the user name mapping feature works in the way
you are hoping it does. According to
https://www.postgresql.org/docs/current/auth-username-maps.html
what the map does is to specify allowed combinations of the validated
external user name ("Albrecht Dreß" in your example) and the database
role the user asked to connect as. So given
> certaccess /^.*$ testuser
it should be possible to do
psql -h dbserver -U testuser testdb
with a certificate that has CN="Albrecht Dreß" (or anything else).
But the map won't result in silently connecting you as some other
role than the one you asked for.
(I haven't actually tried this, but that's how I read the docs.)
regards, tom lane
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-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, albrecht.dress@arcor.de
Subject: Re: Q: cert authentication and user remapping fails
In-Reply-To: <17778.1575654764@sss.pgh.pa.us>
References: <NV7V2E3B.DNJBSI3A.SXG5UOID@C6UM6KSS.I47KT6BN.VTVKOWVO> <17778.1575654764@sss.pgh.pa.us>
* 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