Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgqRC-00012B-EV for pgsql-hackers@arkaria.postgresql.org; Wed, 12 May 2021 15:06:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lgqRA-0006tg-Rd for pgsql-hackers@arkaria.postgresql.org; Wed, 12 May 2021 15:06:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgqRA-0006tY-FK for pgsql-hackers@lists.postgresql.org; Wed, 12 May 2021 15:06:12 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lgqR6-0006KU-Dn for pgsql-hackers@postgresql.org; Wed, 12 May 2021 15:06:11 +0000 Received: by mail-ot1-x32b.google.com with SMTP id t4-20020a05683014c4b02902ed26dd7a60so10685970otq.7 for ; Wed, 12 May 2021 08:06:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=a51I1DS9Txc7suq8ZOZ0crECfS5Sm8HTlw4KYc7Wutk=; b=DGS3FMLmYsrb+KL2nRFwAJSC5oOQR+V6/YYsRzLBL2bfAt98GM+SHyUZX84mPLiilJ wIsMw0S1hb1nnvrxJ4T3x+N6gg5cb8dtcV7b4TDhOzwWrmdqfyOEZiLrmoFBu3ETvLer 6fbh9VGk6lB8RI6YnxJZyjenO8QhSJFlobLm3frwxZtNgrPrpnGF74Q0m3CeqGSAzV4f 7EQDwuY0qyLG58H66tJpF7tGBRMusuybUbqg2+g/r4YSQFMsDtMtmOzykionHdcgKx9Y DKtihrZn+k+pKfoe74HN5TzGKJxztgno6n56tN0CKD7IB7Nf/ncLzOEnLLWLZTac3ZuX W9cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=a51I1DS9Txc7suq8ZOZ0crECfS5Sm8HTlw4KYc7Wutk=; b=BwKSyIbAMd+pzzukDQgfixm3Rbi5YTxE0EQId7IKvjz3nY7tnALJlVO9c851SyToyc NvsQXPcw+joYYb98q0c/T6I1f99QBIthvGp+6clQ10eWjoR1ersIqYNfZ5qGz9BlzMQt /diXrKlVlWfxwGc2MapQVmbzwlrxrYB1vYH1SoCtLUjUz0c8nJhYbGOIWtsRgHmlOaQx qYDjWWph5TGySqOdUYgMJ7Pv8XSbVjXx3q+Uc/RilFO6JJjRWGhey9x1lDAaBY4DRFhh pv9+bbY29EUJZdHNedZTOuAtjTTktMLNPm4AV0NabZ56bxgQb7nPyg8zbIpDy/GpDRF0 TSow== X-Gm-Message-State: AOAM5331LtB8rv1lXwLG47fkr6zlIuzfAFB3VCzANTsWu1HDHwSAfoKt Yb80n/uEawCfq7gHqOnBZ0MtjA== X-Google-Smtp-Source: ABdhPJxkUuDY+3PeecZhot4MUBOixYRx9vrklf/5isSV4lowNgBI3ZpVgvrXUWyBWlscMzKKH7lzmg== X-Received: by 2002:a9d:7312:: with SMTP id e18mr13156694otk.334.1620831967606; Wed, 12 May 2021 08:06:07 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id 186sm53028oof.14.2021.05.12.08.06.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 May 2021 08:06:07 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 8C6CE800AE6; Wed, 12 May 2021 10:06:05 -0500 (CDT) Date: Wed, 12 May 2021 10:06:05 -0500 From: Justin Pryzby To: Bruce Momjian Cc: pgsql-hackers@postgresql.org, Andrew Dunstan Subject: Re: PG 14 release notes, first draft Message-ID: <20210512150605.GR27406@telsasoft.com> References: <20210510060308.GC6088@momjian.us> <20210510140005.GB27406@telsasoft.com> <20210511143523.GQ6088@momjian.us> <20210511221321.GL27406@telsasoft.com> <20210512024504.GH6088@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210512024504.GH6088@momjian.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, May 11, 2021 at 10:45:04PM -0400, Bruce Momjian wrote: > On Tue, May 11, 2021 at 05:13:21PM -0500, Justin Pryzby wrote: > > On Tue, May 11, 2021 at 10:35:23AM -0400, Bruce Momjian wrote: > > > > | Allow more than the common name (CN) to be matched for client certificate authentication (Andrew Dunstan) > > > > Your description makes it sound like arbitrary attributes can be compared. But > > > > the option just allows comparing CN or DN. > > > > > > OK, new text is: > > > > > > > > > Allow the certificate's distinguished name (DN) to be matched for client > > > certificate authentication (Andrew Dunstan) > > > > > > > > > > > > The new pg_hba.conf keyword "clientname=DN" allows comparison with > > > non-CN certificate attributes and can be combined with ident maps. > > > > > > > > > > I think this part is still misleading. The option just allows DN/CN, so it's > > strange to say "non-CN attributes". > > OK, so this is where I am confused. I searched for distinguished name > (DN) and came up with DN being a concatentation of all the fields > provided to the certificate signing request (CSR). Is that right? > Wouldn't people test _parts_ of the DN, rather than all of it. +Andrew The full DN is probably not the postgres username, so the docs suggest that: | This option is probably best used in conjunction with a username map. You're right that clientname=DN allows testing *parts*, of the DN, but I don't know if there's any reason to believe that's the typical use case. The primary utility of clientname=DN seems to be that the CN alone is (or can be) ambiguous - matching on the full DN is intended to resolve that. I think the release notes should focus on this. Matching parts of the DN (other than the CN) seems like a 2ndary use. Maybe a variation on your original words is better. | Allow the distinguished name (DN) to be matched for client certificate authentication (Andrew Dunstan) | Previously, matching was done only the common name (DN). | With a username map, the DN can be matched in full or in part. > The test in the patch seems to do that: > > + "# MAPNAME SYSTEM-USERNAME PG-USERNAME\n", > + "dn \"CN=ssltestuser-dn,OU=Testing,OU=Engineering,O=PGDG\" ssltestuser\n", > + "dnre \"/^.*OU=Testing,.*\$\" ssltestuser\n", > + "cn ssltestuser-dn ssltestuser\n"; > > I think someone need to explain to me exactly what the DN is and how it > is used. Sorry. -- Justin