pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_hba.conf.sample wording improvement
11+ messages / 7 participants
[nested] [flat]

Commits from this thread:
  2021-04-29 3a948ea0a2  pg_hba.conf.sample: Reword connection type section
* pg_hba.conf.sample wording improvement
@ 2021-04-28 05:51  Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  0 siblings, 4 replies; 11+ messages in thread

From: Peter Eisentraut @ 2021-04-28 05:51 UTC (permalink / raw)
  To: pgsql-hackers

I propose the attached patch to shake up the wording in the connection 
type section of pg_hba.conf.sample a bit.  After the hostgssenc part was 
added on, the whole thing became a bit wordy, and it's also a bit 
inaccurate for example in that the current wording for "host" appears to 
say that it does not apply to GSS-encrypted connections.

Attachments:

0001-pg_hba.conf.sample-Reword-connection-type-section.patch (text/plain, 1.4K) download From dc64f4826c4dbf3bcd1cdadb1e9f351ce45f9074 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut <peter@eisentraut.org> Date: Wed, 28 Apr 2021 07:46:48 +0200 Subject: [PATCH] pg_hba.conf.sample: Reword connection type section --- src/backend/libpq/pg_hba.conf.sample | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/backend/libpq/pg_hba.conf.sample b/src/backend/libpq/pg_hba.conf.sample index b6de12b298..ead092ffab 100644 --- a/src/backend/libpq/pg_hba.conf.sample +++ b/src/backend/libpq/pg_hba.conf.sample @@ -18,12 +18,13 @@ # # (The uppercase items must be replaced by actual values.) # -# The first field is the connection type: "local" is a Unix-domain -# socket, "host" is either a plain or SSL-encrypted TCP/IP socket, -# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a -# non-SSL TCP/IP socket. Similarly, "hostgssenc" uses a -# GSSAPI-encrypted TCP/IP socket, while "hostnogssenc" uses a -# non-GSSAPI socket. +# The first field is the connection type: +# - "local" is a Unix-domain socket +# - "host" is a TCP/IP socket (encrypted or not) +# - "hostssl" is an SSL-encrypted TCP/IP socket +# - "hostnossl" is a non-SSL TCP/IP socket +# - "hostgssenc" is a GSSAPI-encrypted TCP/IP socket +# - "hostnogssenc" is a not GSSAPI-encrypted socket # # DATABASE can be "all", "sameuser", "samerole", "replication", a # database name, or a comma-separated list thereof. The "all" -- 2.31.1
^ permalink raw reply [nested|flat] 11+ messages in thread

* Re: pg_hba.conf.sample wording improvement
@ 2021-04-28 06:54  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  3 siblings, 0 replies; 11+ messages in thread

From: Laurenz Albe @ 2021-04-28 06:54 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-hackers

On Wed, 2021-04-28 at 07:51 +0200, Peter Eisentraut wrote:
> I propose the attached patch to shake up the wording in the connection 
> type section of pg_hba.conf.sample a bit.  After the hostgssenc part was 
> added on, the whole thing became a bit wordy, and it's also a bit 
> inaccurate for example in that the current wording for "host" appears to 
> say that it does not apply to GSS-encrypted connections.

+1

Thanks for taking care of things like that.

Yours,
Laurenz Albe






^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: pg_hba.conf.sample wording improvement
@ 2021-04-28 14:09  Alvaro Herrera <alvherre@alvh.no-ip.org>
  parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  3 siblings, 2 replies; 11+ messages in thread

From: Alvaro Herrera @ 2021-04-28 14:09 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: pgsql-hackers

On 2021-Apr-28, Peter Eisentraut wrote:

> I propose the attached patch to shake up the wording in the connection type
> section of pg_hba.conf.sample a bit.  After the hostgssenc part was added
> on, the whole thing became a bit wordy, and it's also a bit inaccurate for
> example in that the current wording for "host" appears to say that it does
> not apply to GSS-encrypted connections.

Yeah, that's a clear improvement.

Looking at it now, I wonder how well do the "hostno" options work.  If I
say "hostnogssenc", is an SSL-encrypted socket good?  If I say
"hostnossl", is a GSS-encrypted socket good?  If so, how does that make
sense?

-- 
Álvaro Herrera                            39°49'30"S 73°17'W
"Pensar que el espectro que vemos es ilusorio no lo despoja de espanto,
sólo le suma el nuevo terror de la locura" (Perelandra, C.S. Lewis)





^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: pg_hba.conf.sample wording improvement
@ 2021-04-28 14:20  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  3 siblings, 1 reply; 11+ messages in thread

From: Tom Lane @ 2021-04-28 14:20 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: pgsql-hackers

Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> I propose the attached patch to shake up the wording in the connection 
> type section of pg_hba.conf.sample a bit.  After the hostgssenc part was 
> added on, the whole thing became a bit wordy, and it's also a bit 
> inaccurate for example in that the current wording for "host" appears to 
> say that it does not apply to GSS-encrypted connections.

+1 for revising it in this general way.  I notice you omitted "TCP/IP"
from the last line though:

+# - "hostnogssenc" is a not GSSAPI-encrypted socket

which doesn't seem consistent.

Another thought is to switch the phrase order:

+# - "local" is a Unix-domain socket
+# - "host" is a TCP/IP socket (encrypted or not)
+# - "hostssl" is a TCP/IP socket that is SSL-encrypted
+# - "hostnossl" is a TCP/IP socket that is not SSL-encrypted
+# - "hostgssenc" is a TCP/IP socket that is GSSAPI-encrypted
+# - "hostnogssenc" is a TCP/IP socket that is not GSSAPI-encrypted

I'm not wedded to that idea, but it seems to help reduce random
variations between the wordings of these lines.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: pg_hba.conf.sample wording improvement
@ 2021-04-28 14:30  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
  1 sibling, 0 replies; 11+ messages in thread

From: Tom Lane @ 2021-04-28 14:30 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-hackers

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Looking at it now, I wonder how well do the "hostno" options work.  If I
> say "hostnogssenc", is an SSL-encrypted socket good?  If I say
> "hostnossl", is a GSS-encrypted socket good?  If so, how does that make
> sense?

Kind of off-topic for this thread, but I wonder if we should introduce
"hostenc" and "hostnoenc" to mean "encrypted (or not), and I don't care
by which method".  The addition of GSS has made it painful to express
those concepts.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: pg_hba.conf.sample wording improvement
@ 2021-04-29 05:06  Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 11+ messages in thread

From: Peter Eisentraut @ 2021-04-29 05:06 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers

On 28.04.21 16:20, Tom Lane wrote:
> Another thought is to switch the phrase order:
> 
> +# - "local" is a Unix-domain socket
> +# - "host" is a TCP/IP socket (encrypted or not)
> +# - "hostssl" is a TCP/IP socket that is SSL-encrypted
> +# - "hostnossl" is a TCP/IP socket that is not SSL-encrypted
> +# - "hostgssenc" is a TCP/IP socket that is GSSAPI-encrypted
> +# - "hostnogssenc" is a TCP/IP socket that is not GSSAPI-encrypted
> 
> I'm not wedded to that idea, but it seems to help reduce random
> variations between the wordings of these lines.

done that way





^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: pg_hba.conf.sample wording improvement
@ 2021-04-29 05:07  Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
  1 sibling, 1 reply; 11+ messages in thread

From: Peter Eisentraut @ 2021-04-29 05:07 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: pgsql-hackers

On 28.04.21 16:09, Alvaro Herrera wrote:
> Looking at it now, I wonder how well do the "hostno" options work.  If I
> say "hostnogssenc", is an SSL-encrypted socket good?  If I say
> "hostnossl", is a GSS-encrypted socket good?  If so, how does that make
> sense?

I think for example if you want to enforce SSL connections, then writing 
"hostnossl ... reject" would be sensible.  That would also reject 
GSS-encrypted connections, but that would be what you want in that scenario.






^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: pg_hba.conf.sample wording improvement
@ 2021-04-29 09:47  Magnus Hagander <magnus@hagander.net>
  parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Magnus Hagander @ 2021-04-29 09:47 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-hackers

On Thu, Apr 29, 2021 at 7:08 AM Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
>
> On 28.04.21 16:09, Alvaro Herrera wrote:
> > Looking at it now, I wonder how well do the "hostno" options work.  If I
> > say "hostnogssenc", is an SSL-encrypted socket good?  If I say
> > "hostnossl", is a GSS-encrypted socket good?  If so, how does that make
> > sense?
>
> I think for example if you want to enforce SSL connections, then writing
> "hostnossl ... reject" would be sensible.  That would also reject
> GSS-encrypted connections, but that would be what you want in that scenario.

I'd say the interface has become a lot less well-matching now that we
have two separate settings for it. For example right now it's more
complex to say "reject anything not encrypted", which I bet is what a
lot of people would want. They don't particularly care if it's gss
encrypted or ssl encrypted.

Perhaps what we want to do (obviously not for 14) is to allow you to
specify more than one entry in the first column, so you could say
"hostssl,hostgssenc" on the same row? That would give some strange
results with the "no" mappings, but it might work if used right?

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/





^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: pg_hba.conf.sample wording improvement
@ 2021-04-29 15:06  Stephen Frost <sfrost@snowman.net>
  parent: Magnus Hagander <magnus@hagander.net>
  0 siblings, 1 reply; 11+ messages in thread

From: Stephen Frost @ 2021-04-29 15:06 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-hackers

Greetings,

* Magnus Hagander (magnus@hagander.net) wrote:
> On Thu, Apr 29, 2021 at 7:08 AM Peter Eisentraut
> <peter.eisentraut@enterprisedb.com> wrote:
> > On 28.04.21 16:09, Alvaro Herrera wrote:
> > > Looking at it now, I wonder how well do the "hostno" options work.  If I
> > > say "hostnogssenc", is an SSL-encrypted socket good?  If I say
> > > "hostnossl", is a GSS-encrypted socket good?  If so, how does that make
> > > sense?
> >
> > I think for example if you want to enforce SSL connections, then writing
> > "hostnossl ... reject" would be sensible.  That would also reject
> > GSS-encrypted connections, but that would be what you want in that scenario.
> 
> I'd say the interface has become a lot less well-matching now that we
> have two separate settings for it. For example right now it's more
> complex to say "reject anything not encrypted", which I bet is what a
> lot of people would want. They don't particularly care if it's gss
> encrypted or ssl encrypted.

I'm not really sure that I agree it's such an issue, particularly since
you have to come up with a way to specify the auth method to use somehow
too as we haven't got any fallback mechanism or anything like that.
While you might use cert-based auth or SCRAM for TLS connections, it
isn't the case that you can use SCRAM with a GSS encrypted connection.

> Perhaps what we want to do (obviously not for 14) is to allow you to
> specify more than one entry in the first column, so you could say
> "hostssl,hostgssenc" on the same row? That would give some strange
> results with the "no" mappings, but it might work if used right?

In general, I'm not against the idea of giving more options but I'm just
not sure that it's a real use-case when you consider that the auth
method also has to be specified.  I also don't recall anyone showing up
asking about how they could specify "encrypted but I don't care how".

Thanks,

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: pg_hba.conf.sample wording improvement
@ 2021-04-30 14:29  Bruce Momjian <bruce@momjian.us>
  parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  3 siblings, 0 replies; 11+ messages in thread

From: Bruce Momjian @ 2021-04-30 14:29 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: pgsql-hackers

On Wed, Apr 28, 2021 at 07:51:43AM +0200, Peter Eisentraut wrote:
> I propose the attached patch to shake up the wording in the connection type
> section of pg_hba.conf.sample a bit.  After the hostgssenc part was added
> on, the whole thing became a bit wordy, and it's also a bit inaccurate for
> example in that the current wording for "host" appears to say that it does
> not apply to GSS-encrypted connections.

Yes, much better.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.






^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: pg_hba.conf.sample wording improvement
@ 2021-05-17 20:10  Magnus Hagander <magnus@hagander.net>
  parent: Stephen Frost <sfrost@snowman.net>
  0 siblings, 0 replies; 11+ messages in thread

From: Magnus Hagander @ 2021-05-17 20:10 UTC (permalink / raw)
  To: Stephen Frost <sfrost@snowman.net>; +Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; Alvaro Herrera <alvherre@alvh.no-ip.org>; pgsql-hackers

On Thu, Apr 29, 2021 at 5:06 PM Stephen Frost <sfrost@snowman.net> wrote:
>
> Greetings,
>
> * Magnus Hagander (magnus@hagander.net) wrote:
> > On Thu, Apr 29, 2021 at 7:08 AM Peter Eisentraut
> > <peter.eisentraut@enterprisedb.com> wrote:
> > > On 28.04.21 16:09, Alvaro Herrera wrote:
> > > > Looking at it now, I wonder how well do the "hostno" options work.  If I
> > > > say "hostnogssenc", is an SSL-encrypted socket good?  If I say
> > > > "hostnossl", is a GSS-encrypted socket good?  If so, how does that make
> > > > sense?
> > >
> > > I think for example if you want to enforce SSL connections, then writing
> > > "hostnossl ... reject" would be sensible.  That would also reject
> > > GSS-encrypted connections, but that would be what you want in that scenario.
> >
> > I'd say the interface has become a lot less well-matching now that we
> > have two separate settings for it. For example right now it's more
> > complex to say "reject anything not encrypted", which I bet is what a
> > lot of people would want. They don't particularly care if it's gss
> > encrypted or ssl encrypted.
>
> I'm not really sure that I agree it's such an issue, particularly since
> you have to come up with a way to specify the auth method to use somehow
> too as we haven't got any fallback mechanism or anything like that.
> While you might use cert-based auth or SCRAM for TLS connections, it
> isn't the case that you can use SCRAM with a GSS encrypted connection.
>
> > Perhaps what we want to do (obviously not for 14) is to allow you to
> > specify more than one entry in the first column, so you could say
> > "hostssl,hostgssenc" on the same row? That would give some strange
> > results with the "no" mappings, but it might work if used right?
>
> In general, I'm not against the idea of giving more options but I'm just
> not sure that it's a real use-case when you consider that the auth
> method also has to be specified.  I also don't recall anyone showing up
> asking about how they could specify "encrypted but I don't care how".

TBH, I bet that is a lot because people don't use gss encryption, or
even know it exists. Which is sad, because it's darn convenient once
you have Kerberos set up...

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/





^ permalink  raw  reply  [nested|flat] 11+ messages in thread


end of thread, other threads:[~2021-05-17 20:10 UTC | newest]

Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 05:51 pg_hba.conf.sample wording improvement Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2021-04-28 06:54 ` Laurenz Albe <laurenz.albe@cybertec.at>
2021-04-28 14:09 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2021-04-28 14:30   ` Tom Lane <tgl@sss.pgh.pa.us>
2021-04-29 05:07   ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2021-04-29 09:47     ` Magnus Hagander <magnus@hagander.net>
2021-04-29 15:06       ` Stephen Frost <sfrost@snowman.net>
2021-05-17 20:10         ` Magnus Hagander <magnus@hagander.net>
2021-04-28 14:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-04-29 05:06   ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2021-04-30 14:29 ` Bruce Momjian <bruce@momjian.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox