X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 02FE69DD713 for ; Fri, 13 Jan 2006 11:23:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 26183-06 for ; Fri, 13 Jan 2006 11:23:24 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id DDF559DD714 for ; Fri, 13 Jan 2006 11:23:17 -0400 (AST) Received: from mail.digitalfreaks.org (arbitor.digitalfreaks.org [216.151.95.158]) by svr4.postgresql.org (Postfix) with ESMTP id C76355AF029 for ; Fri, 13 Jan 2006 15:23:22 +0000 (GMT) Received: by mail.digitalfreaks.org (Postfix, from userid 1022) id AFAFA18241; Fri, 13 Jan 2006 10:23:23 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.digitalfreaks.org (Postfix) with ESMTP id AEA871823F for ; Fri, 13 Jan 2006 10:23:23 -0500 (EST) Date: Fri, 13 Jan 2006 10:23:23 -0500 (EST) From: "Brian A. Seklecki" X-X-Sender: lavalamp@arbitor.digitalfreaks.org To: pgsql-admin@postgresql.org Subject: PKI/SSL Client/Server Certificate Authentication Message-ID: <20060113095615.S38232@arbitor.digitalfreaks.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.16 required=5 tests=[AWL=0.160] X-Spam-Score: 0.16 X-Spam-Level: X-Archive-Number: 200601/159 X-Sequence-Number: 20247 The current PKI implementation seems to support the encryption aspects of SSL/TLS, but what about using Authorization/Authentication? I.e., when you configure SSL on the server, you're not specifying a trusted CA cert (or directory of trusted CA Certs). The client can specify REQUIRE_SSL environmental variable, but client can't present an X.509 certificate. There are no options on either the client or the server to verify the authenticity of the peers certificates. I ask because I generally discourage the practice of embedding database passwords into source code. That reminds me of Oracle, Solaris, and a lot of other dirty, decrepit, security-hole-prone configurations. However, "Another popular open source RDBMS" (whose name we wont mention here) has a nifty feature that permits the mapping of certain Attribute pairs in the DN= (sometimes called the "Subject) of a client X.509 certificate into the Username credential field. Thereby: - The database and the client submit CSRs to an mutually exclusive CA in the organization - The CA signs and returns X.509 certs to both. - The server and client libraries configure to trust local copies of the CA Cert - The server requires client cert verification against the CA on the server config - The client requires server cert verification against the CA on the client config - The server configures a username/access grant like such: GRANT ALL PRIVILEGES ON dbname.* TO -> 'web-app-meta-user'@'web-server-inside-dmz' -> IDENTIFIED BY 'goodsecret' (Optional) -> REQUIRE SUBJECT '/C=EE/ST=Some-State/L=Tallinn/ O=MySQL demo client certificate/ CN=Tonu Samuel/Email=tonu@example.com' -> AND ISSUER '/C=FI/ST=Some-State/L=Helsinki/ O=MySQL Finland AB/CN=Tonu Samuel/Email=tonu@example.com' -> AND CIPHER 'EDH-RSA-DES-CBC3-SHA'; - Thus enforcing two-stage authentication, a very healthy practice. This adds a level of redundancy to security (In conjuntion with the use of Views, ACLs, Firewall rules, Password Rotation, Auditing, Secure coding practices, etc.) If a "bad person" were to somehow obtain a copy of the source code with a password embedded in the connect string (Steal it from a developer who uses Windows, or maybe convince Apache to not interpret PHP before sending to the client, something stupid like that), they would still be unable to connect without a client certificate. This two-stage authentication model is in use in Apache, OpenSSH sshd(8), OpenLDAP, and FreeRADIUS (with EAP-TLS + PAP/CHAP). It's even used on the Cisco 3000 series VPN Concentrator by default (in all it's glory). It's definately a very useful feature tha we should aspire to offer. Thoughts? TIA, ~BAS