pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add support for Kerberos credential delegation
Date: Sat, 08 Apr 2023 01:58:47 +0000
Message-ID: <E1pkxqo-001xrH-2q@gemulon.postgresql.org> (raw)

Add support for Kerberos credential delegation

Support GSSAPI/Kerberos credentials being delegated to the server by a
client.  With this, a user authenticating to PostgreSQL using Kerberos
(GSSAPI) credentials can choose to delegate their credentials to the
PostgreSQL server (which can choose to accept them, or not), allowing
the server to then use those delegated credentials to connect to
another service, such as with postgres_fdw or dblink or theoretically
any other service which is able to be authenticated using Kerberos.

Both postgres_fdw and dblink are changed to allow non-superuser
password-less connections but only when GSSAPI credentials have been
delegated to the server by the client and GSSAPI is used to
authenticate to the remote system.

Authors: Stephen Frost, Peifeng Qiu
Reviewed-By: David Christensen
Discussion: https://postgr.es/m/CO1PR05MB8023CC2CB575E0FAAD7DF4F8A8E29@CO1PR05MB8023.namprd05.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3d4fa227bce4294ce1cc214b4a9d3b7caa3f0454

Modified Files
--------------
contrib/dblink/dblink.c                        | 127 ++++++----
contrib/dblink/expected/dblink.out             |   4 +-
contrib/postgres_fdw/connection.c              |  72 ++++--
contrib/postgres_fdw/expected/postgres_fdw.out |  19 +-
contrib/postgres_fdw/option.c                  |   6 +
contrib/postgres_fdw/sql/postgres_fdw.sql      |   3 +-
doc/src/sgml/config.sgml                       |  17 ++
doc/src/sgml/dblink.sgml                       |   5 +-
doc/src/sgml/libpq.sgml                        |  41 +++
doc/src/sgml/monitoring.sgml                   |   9 +
doc/src/sgml/postgres-fdw.sgml                 |   7 +-
src/backend/catalog/system_views.sql           |   3 +-
src/backend/foreign/foreign.c                  |   1 +
src/backend/libpq/auth.c                       |  13 +-
src/backend/libpq/be-gssapi-common.c           |  53 ++++
src/backend/libpq/be-secure-gssapi.c           |  26 +-
src/backend/utils/activity/backend_status.c    |   1 +
src/backend/utils/adt/pgstatfuncs.c            |  21 +-
src/backend/utils/init/postinit.c              |   8 +-
src/backend/utils/misc/guc_tables.c            |  10 +
src/backend/utils/misc/postgresql.conf.sample  |   1 +
src/include/catalog/pg_proc.dat                |   6 +-
src/include/libpq/auth.h                       |   1 +
src/include/libpq/be-gssapi-common.h           |   3 +
src/include/libpq/libpq-be.h                   |   2 +
src/include/utils/backend_status.h             |   1 +
src/interfaces/libpq/exports.txt               |   1 +
src/interfaces/libpq/fe-auth.c                 |  15 +-
src/interfaces/libpq/fe-connect.c              |  17 ++
src/interfaces/libpq/fe-secure-gssapi.c        |  23 +-
src/interfaces/libpq/libpq-fe.h                |   1 +
src/interfaces/libpq/libpq-int.h               |   2 +
src/test/kerberos/Makefile                     |   3 +
src/test/kerberos/t/001_auth.pl                | 331 ++++++++++++++++++++++---
src/test/perl/PostgreSQL/Test/Utils.pm         |  27 ++
src/test/regress/expected/rules.out            |  11 +-
36 files changed, 755 insertions(+), 136 deletions(-)



Message-ID: <E1pkxqo-001xrH-2q@gemulon.postgresql.org>
Permalink:  ../E1pkxqo-001xrH-2q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pkxqo-001xrH-2q@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: sfrost@snowman.net, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add support for Kerberos credential delegation
  In-Reply-To: <E1pkxqo-001xrH-2q@gemulon.postgresql.org>

* 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