summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorStephen Frost <sfrost@snowman.net>2023-04-07 21:58:04 -0400
committerStephen Frost <sfrost@snowman.net>2023-04-07 21:58:04 -0400
commit3d4fa227bce4294ce1cc214b4a9d3b7caa3f0454 (patch)
treef113304aa44d7738041273a8f1ead0a53af0d320 /doc
parentedc627ae27632ae2be0e435aca02ed38005cb55f (diff)
downloadpostgresql-3d4fa227bce4294ce1cc214b4a9d3b7caa3f0454.tar.gz
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
Diffstat (limited to 'doc')
-rw-r--r--doc/src/sgml/config.sgml17
-rw-r--r--doc/src/sgml/dblink.sgml5
-rw-r--r--doc/src/sgml/libpq.sgml41
-rw-r--r--doc/src/sgml/monitoring.sgml9
-rw-r--r--doc/src/sgml/postgres-fdw.sgml7
5 files changed, 74 insertions, 5 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 2762290465..1966ecc162 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -1190,6 +1190,23 @@ include_dir 'conf.d'
</listitem>
</varlistentry>
+ <varlistentry id="guc-gss-accept-deleg" xreflabel="gss_accept_deleg">
+ <term><varname>gss_accept_deleg</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>gss_accept_deleg</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Sets whether GSSAPI delegation should be accepted from the client.
+ The default is <literal>off</literal> meaning credentials from the client will
+ NOT be accepted. Changing this to <literal>on</literal> will make the server
+ accept credentials delegated to it from the client. This parameter can only be
+ set in the <filename>postgresql.conf</filename> file or on the server command line.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="guc-db-user-namespace" xreflabel="db_user_namespace">
<term><varname>db_user_namespace</varname> (<type>boolean</type>)
<indexterm>
diff --git a/doc/src/sgml/dblink.sgml b/doc/src/sgml/dblink.sgml
index 17f9d99b1c..7d25f24f49 100644
--- a/doc/src/sgml/dblink.sgml
+++ b/doc/src/sgml/dblink.sgml
@@ -117,8 +117,9 @@ dblink_connect(text connname, text connstr) returns text
<para>
Only superusers may use <function>dblink_connect</function> to create
- non-password-authenticated connections. If non-superusers need this
- capability, use <function>dblink_connect_u</function> instead.
+ non-password-authenticated and non-GSSAPI-authenticated connections.
+ If non-superusers need this capability, use
+ <function>dblink_connect_u</function> instead.
</para>
<para>
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index faa8aa3187..b8702284d0 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -2054,6 +2054,18 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
</listitem>
</varlistentry>
+ <varlistentry id="libpq-connect-gssdeleg" xreflabel="gssdeleg">
+ <term><literal>gssdeleg</literal></term>
+ <listitem>
+ <para>
+ Forward (delegate) GSS credentials to the server. The default is
+ <literal>disable</literal> which means credentials will not be forwarded
+ to the server. Set this to <literal>enable</literal> to have
+ credentials forwarded when possible.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="libpq-connect-service" xreflabel="service">
<term><literal>service</literal></term>
<listitem>
@@ -2715,6 +2727,25 @@ int PQconnectionUsedPassword(const PGconn *conn);
</para>
</listitem>
</varlistentry>
+
+ <varlistentry id="libpq-PQconnectionUsedGSSAPI">
+ <term><function>PQconnectionUsedGSSAPI</function><indexterm><primary>PQconnectionUsedGSSAPI</primary></indexterm></term>
+ <listitem>
+ <para>
+ Returns true (1) if the connection authentication method
+ used GSSAPI. Returns false (0) if not.
+
+<synopsis>
+int PQconnectionUsedGSSAPI(const PGconn *conn);
+</synopsis>
+ </para>
+
+ <para>
+ This function can be applied to detect whether the connection was
+ authenticated with GSSAPI.
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</para>
@@ -8240,6 +8271,16 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
<listitem>
<para>
<indexterm>
+ <primary><envar>PGGSSDELEG</envar></primary>
+ </indexterm>
+ <envar>PGGSSDELEG</envar> behaves the same as the <xref
+ linkend="libpq-connect-gssdeleg"/> connection parameter.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <indexterm>
<primary><envar>PGCONNECT_TIMEOUT</envar></primary>
</indexterm>
<envar>PGCONNECT_TIMEOUT</envar> behaves the same as the <xref
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 7da135d2f2..0eaff70dcb 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -3573,6 +3573,15 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
True if GSSAPI encryption is in use on this connection
</para></entry>
</row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>credentials_delegated</structfield> <type>boolean</type>
+ </para>
+ <para>
+ True if GSSAPI credentials were delegated on this connection.
+ </para></entry>
+ </row>
</tbody>
</tgroup>
</table>
diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml
index 9e66987cf7..281966f16f 100644
--- a/doc/src/sgml/postgres-fdw.sgml
+++ b/doc/src/sgml/postgres-fdw.sgml
@@ -169,9 +169,10 @@
<literal>sslcert</literal> or <literal>sslkey</literal> settings.
</para>
<para>
- Only superusers may connect to foreign servers without password
- authentication, so always specify the <literal>password</literal> option
- for user mappings belonging to non-superusers.
+ Non-superusers may connect to foreign servers using password
+ authentication or with GSSAPI delegated credentials, so specify the
+ <literal>password</literal> option for user mappings belonging to
+ non-superusers where password authentication is required.
</para>
<para>
A superuser may override this check on a per-user-mapping basis by setting