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 1joP3H-0007LD-Od for pgsql-general@arkaria.postgresql.org; Thu, 25 Jun 2020 10:24:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1joP3G-0003TX-Lw for pgsql-general@arkaria.postgresql.org; Thu, 25 Jun 2020 10:24:14 +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 1joP3G-0003Ri-Dq for pgsql-general@lists.postgresql.org; Thu, 25 Jun 2020 10:24:14 +0000 Received: from smtp.burggraben.net ([2a01:4f8:140:510a::3]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joP3D-0001tF-7q for pgsql-general@lists.postgresql.org; Thu, 25 Jun 2020 10:24:13 +0000 Received: from elch.exwg.net (elch.exwg.net [IPv6:2001:470:7120:1:127b:44ff:fe4f:148d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "elch.exwg.net", Issuer "Christoph Moench-Tegeder" (not verified)) by smtp.burggraben.net (Postfix) with ESMTPS id 24130C00309 for ; Thu, 25 Jun 2020 12:24:08 +0200 (CEST) Received: by elch.exwg.net (Postfix, from userid 1000) id C9C68139897; Thu, 25 Jun 2020 12:24:07 +0200 (CEST) Date: Thu, 25 Jun 2020 12:24:07 +0200 From: Christoph Moench-Tegeder To: pgsql-general@lists.postgresql.org Subject: Re: Log the incoming old SSL certs by pid or any way Message-ID: <20200625102407.GA20342@elch.exwg.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.3 (2020-06-14) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ## Durumdara (durumdara@gmail.com): > Do we have chance to log somewhere the connected client's certificate, or > some info about it? There's pg_stat_ssl, and if you had an recent version of PostgreSQL (9.6 is too old for that), you'd even have the serial number of the certificate in there: https://www.postgresql.org/docs/12/monitoring-stats.html#PG-STAT-SSL-VIEW On the other hand, you could check the certificates directly, e.g. https://github.com/matteocorti/check_ssl_cert or even just some scripting around openssl. (That assumes that you know where those client certificates are). Regards, Christoph -- Spare Space