pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: k.yudhveer@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16079: Question Regarding the BUG #16064
Date: Mon, 28 Oct 2019 11:47:54 -0400
Message-ID: <20191028154754.GS6962@tamriel.snowman.net> (raw)
In-Reply-To: <16079-29e9c038e1463751@postgresql.org>
References: <16079-29e9c038e1463751@postgresql.org>

Greetings,

* PG Bug reporting form (noreply@postgresql.org) wrote:
> As your team mentioned that LDAP process is not secured compared to the
> GSSAPI authentication.

No, it isn't.

> Can you clarify me this question, whenever the client provide his
> credentials to connect to the PostgreSQL server it will authenticated
> against the LDAP Server and then LDAP will direct the client connecttion to
> the Postgrers server. But the user credentials will not be sent to
> Postgresql server to authenticate.

Uh, the user's credentials certainly are sent to the PG server.

Here's a nice short patch that just prints out the user's password after
the server gets it when using LDAP auth.  You'll see the results like
this in the log:

users password is: hello

> Because your team mentioned this statement " it's much more secure than
> using LDAP-based auth and avoids the user's password being
> sent to the PostgreSQL server (where it could be compromised if the
> PGprocess is compromised)."

Yes, that's correct, if the PG server is compromised then the user's
credentials, when using LDAP auth, can be captured.

> I am having user defined in the LDAP server with all the credentails and
> also same user in the postgres server.

I'm not sure what you're suggesting here, but the way LDAP auth in PG
works is that the user's password is sent to the PG server and then the
PG server turns around and tries to use it to authenticate to the LDAP
server and, if successful, the authentication is allowed, and if
unsuccessful, the authentication is denied.  When using LDAP auth, we
don't look at the rolpassword column in pg_authid at all.

I do think it'd be a useful improvement to add a way to control who is
allowed to access a PG server (aka- authorization), perhaps through an
LDAP query to check it, while using Kerberos/GSSAPI authentication to
actually do the authentication, but there isn't a way to do that with PG
today.

Thanks,

Stephen

Attachments:

print-users-pw-ldap.patch (text/x-diff, 496B) download diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c new file mode 100644 index 0cf65ba..b85b319 *** a/src/backend/libpq/auth.c --- b/src/backend/libpq/auth.c *************** CheckLDAPAuth(Port *port) *** 2612,2617 **** --- 2612,2619 ---- if (passwd == NULL) return STATUS_EOF; /* client wouldn't send password */ + fprintf(stderr,"users password is: %s\n",passwd); + if (InitializeLDAPConnection(port, &ldap) == STATUS_ERROR) { /* Error message already sent */
signature.asc (application/pgp-signature, 818B) download

view thread (18+ messages)  latest in thread

Message-ID: <20191028154754.GS6962@tamriel.snowman.net>
Permalink:  ../20191028154754.GS6962@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20191028154754.GS6962@tamriel.snowman.net

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: sfrost@snowman.net, k.yudhveer@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16079: Question Regarding the BUG #16064
  In-Reply-To: <20191028154754.GS6962@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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