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 1hXbGg-0007FW-9F for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jun 2019 00:56:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hXbGd-0007h8-Vw for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jun 2019 00:56:03 +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 1hXbGd-0007dP-EE for pgsql-hackers@lists.postgresql.org; Mon, 03 Jun 2019 00:56:03 +0000 Received: from mail-it1-x143.google.com ([2607:f8b0:4864:20::143]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hXbGY-0000U3-Nv for pgsql-hackers@postgresql.org; Mon, 03 Jun 2019 00:56:02 +0000 Received: by mail-it1-x143.google.com with SMTP id h9so9893155itk.3 for ; Sun, 02 Jun 2019 17:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=IIpJCfbN3zwaOUIFtXz7uosCuHd2LLbeoN7w94FmnA0=; b=X7LI+XpUXl8QS5C0AAuhpmI5UFJ/QALxkXyIFZnWdtZWphlu1O3gR9Pi5kzxN7EZKW Fvs6duAW3c21vlVaR355LPHo/lT/ls314tGa2L8FoqOQZ/Dn+TDrENaZrWfMcIY5cCWa 4wCz7bNYX4Xv/+ML/FvWx7jvGjVrGHklgCWy4= 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:content-transfer-encoding :in-reply-to:user-agent; bh=IIpJCfbN3zwaOUIFtXz7uosCuHd2LLbeoN7w94FmnA0=; b=sIRnETo9nxKsDoknFNo0fwgBWR0w5g6UZ+n2/vbKrVOQKxuca+ZE2DWp2OeE7KuKnj Ln4zzs+QX88zTRW5F4ixvd/v505jxsuxeMqQDqHL+u/G9smguXRqGT8RFbzLUEuDU0uG Z8Kp04DkaccSYjK/7sqUultYpMPnjv0c4SSoO/hQyipNRcTBWbWeRQcjFbyJd7KaUJJA HK3z5RAd/EMz/Ir5t2ziXR8SH8tG/Lmb3A3WZMAbDzJIdkRbnKlaKjFzpUuARzoHrPe/ UpMU+72B/EtWKzIz+Qr4RylNiPnUFmHeIXxCRBB9YhNhBOc/tegtCur0uYvJ3tAF41db Im1g== X-Gm-Message-State: APjAAAVHgyP6A/F54Zl8FP1mlqX9h6Igf345lDfQ44sbBgCQ1MCl2WJ6 Swdh+zfSDF83W6IpdU80iRZhpQ== X-Google-Smtp-Source: APXvYqxlFwqQCVwtYhd0auGXWTwur7uzdT+haPBflHfpZM7cw+UGrkAF7U+FQDiQS3FRzetBOwKgZg== X-Received: by 2002:a24:ac58:: with SMTP id m24mr16643611iti.65.1559523356702; Sun, 02 Jun 2019 17:55:56 -0700 (PDT) Received: from gust.leadboat.com ([75.104.68.94]) by smtp.gmail.com with ESMTPSA id v139sm5904693itb.25.2019.06.02.17.55.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Jun 2019 17:55:55 -0700 (PDT) Date: Sun, 2 Jun 2019 20:55:39 -0400 From: Noah Misch To: Magnus Hagander Cc: Peter Eisentraut , PostgreSQL-development , "Jonathan S. Katz" Subject: Re: initdb recommendations Message-ID: <20190603005539.GA116225@gust.leadboat.com> References: <20190406180839.GA1921989@rfd.leadboat.com> <96389374-9454-d26d-6f79-7c7b15ec14bd@2ndquadrant.com> <20190524152357.GC1624191@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, May 28, 2019 at 12:15:35PM -0400, Magnus Hagander wrote: > On Fri, May 24, 2019 at 11:24 AM Noah Misch wrote: > > On Thu, May 23, 2019 at 06:56:49PM +0200, Magnus Hagander wrote: > > > On Thu, May 23, 2019, 18:54 Peter Eisentraut wrote: > > > > To recap, the idea here was to change the default authentication methods > > > > that initdb sets up, in place of "trust". > > > > > > > > I think the ideal scenario would be to use "peer" for local and some > > > > appropriate password method (being discussed elsewhere) for host. > > > > > > > > Looking through the buildfarm, I gather that the only platforms that > > > > don't support peer are Windows, AIX, and HP-UX.  I think we can probably > > > > figure out some fallback or alternative default for the latter two > > > > platforms without anyone noticing.  But what should the defaults be on > > > > Windows?  It doesn't have local sockets, so the lack of peer wouldn't > > > > matter.  But is it OK to default to a password method, or would that > > > > upset people particularly? > > > > > > I'm sure password would be fine there. It's what "everybody else" does > > > (well sqlserver also cord integrated security, but people are used to it). > > > > Our sspi auth is a more-general version of peer auth, and it works over TCP. > > It would be a simple matter of programming to support "peer" on Windows, > > consisting of sspi auth with an implicit pg_ident map.  Nonetheless, I agree > > password would be fine. > > I hope oyu don't mean "make peer use sspi on windows". I think that's a > really bad idea from a confusion perspective. I don't mean "make peer an alias for SSPI", but I do mean "implement peer on Windows as a special case of sspi, using the same Windows APIs". To the client, "peer" would look like "sspi". If that's confusion-prone, what's confusing about it? > However, what we could do there is have the defaut pg_hba.conf file contain > a "reasonable setup using sspi" that's a different story. That's another way to do it. Currently, to behave like "peer" behaves, one hard-codes the machine's SSPI realm into pg_ident.conf. If we introduced pg_ident.conf syntax to remove that need (e.g. %MACHINE_REALM%), that approach would work. > But I wonder if that isn't better implemented at the installer level. I > think we're better off doing something like scram as the config when you > build from source ,and then encourage installers to do other things based on > the fact that they know more information about the setup (such as usernames > actually used). If initdb has the information needed to configure the recommended authentication, that's the best place to do it, since there's one initdb and many installers. So far, I haven't seen a default auth configuration proposal involving knowledge of OS usernames or other information initdb lacks.