Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIC3w-00070M-CH for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2019 13:31:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iIC3u-00078k-EC for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2019 13:31:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIC3u-00078a-3P for pgsql-general@lists.postgresql.org; Wed, 09 Oct 2019 13:31:30 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iIC3q-0001wQ-1h for pgsql-general@lists.postgresql.org; Wed, 09 Oct 2019 13:31:29 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id A96735F79F; Wed, 9 Oct 2019 09:31:22 -0400 (EDT) Date: Wed, 9 Oct 2019 09:31:22 -0400 From: Stephen Frost To: Allan Jensen Cc: pgsql-general@lists.postgresql.org Subject: Re: GSSAPI: logging principal Message-ID: <20191009133122.GV6962@tamriel.snowman.net> References: <20191009104934.5b0d31ec@fujitsu.winge-jensen.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wAXCg+6JAXm8+76/" Content-Disposition: inline In-Reply-To: <20191009104934.5b0d31ec@fujitsu.winge-jensen.dk> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --wAXCg+6JAXm8+76/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Allan Jensen (pglist@winge-jensen.dk) wrote: > I have GSSAPI-login and user mapping to postgres working fine. Great! > Whenever i login to postgres I get a line like the following in the > logfile: >=20 > connection authorized: user=3Dtestrole database=3Dtestdb SSL enabled > (protocol=3DTLSv1.3, cipher=3DTLS_AES_256_GCM_SHA384, bits=3D256, > compression=3Doff) Minor side-note: we have GSSAPI encryption built-in starting with v12, removing the need to also have SSL. > What bothers me, is that i can't see what kerberos prinicpal was used > during authentication. Yeah, I'm afraid that's probably right. In looking, I don't see any particularly easy way. I could have sworn I complained about this ages ago (there might even be a patch somewhere in the depths of -hackers =66rom 5 years ago or more) but clearly it never made it in. One thing that is kind of nice is that with v12 there's a new view where you can view the state of existing connections, including the principal they authenticate with: pg_stat_gssapi. > Is there any way to make postgres log the principal? Would definitely be a good thing for us to have, and the CN for an SSL-based connection. I don't think it'd be hard for someone to hack up a patch to do so. I've added it to my list of "nice to haves" but it seems unlikely I'll get any time in the near future to hack on it, so if someone else wants to work on it, please feel free to do so... Thanks, Stephen --wAXCg+6JAXm8+76/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJdneEqAAoJEO1sijiDR2RVx50QAJn1YVd1y+9m9VCE2icBQuie yvQDtKdspKSvol0AGaJLP1oQX+AvzO4xniaR6divabuzFOeMpbPxShQiulErGlFL Uh+sGAmhkA5P+BWteHkjCF1IxJkCRfeANBgDGuaitQGl/iPCSJkiqXTfw/9hOwZD Pa9BjbTo7/FJckhxLUNAmi9w1SoaIFA9aAjpcQKgKz1qswIubxEZ8Z8AzoJtyBZG 77eZigsFp46QufH+xTWGO47sCDHmddPHZbLJFVPjlyR+JLTIBVSwFywclA5RG/aq MNaP5XA0+DPA/x8KSKss8b8fxh5PwC/+G6Z3mnRLbmm2deCBbVREF7MM2tKbowcp e+G89YILT1s+N1IJN7RqvphhSiqG3fCgdRb1ROB8snVC2MzcaWDqKjY2BOZBth3M sYTCqfIJ5wxiBpQVDU8JntgktbHQNUt0TYzkywQIdOdfAdeG8i2q+m5TEW1jMgm/ PX7PZB4a74mebelUz3RdRNhLvnhlnfym4679QahPvmoEYo/o+oX17twNcNMvwpa2 bWViF/mcVVYFrhvrUhy2W4V2/6Os6se3YIYghSbNUUT1tYD47tNMtLfr269AINdH 0iq36lGXEDiiUBwpaV6md1Q2A5q91vgBhMw+kFfthetRUS5UKVIJI3Wc8VFK0PPU LtMpDlXyKrVXg9T4QTjZ =Y0HX -----END PGP SIGNATURE----- --wAXCg+6JAXm8+76/--