Skip to content

Commit

Permalink
Connect encryption support for GSSAPI
Browse files Browse the repository at this point in the history
Existing GSSAPI authentication code is extended to support connection
encryption.  Connection begins as soon as possible - that is,
immediately after the client and server complete authentication.
  • Loading branch information
frozencemetery committed Feb 15, 2016
1 parent 57c9324 commit dc10e35
Show file tree
Hide file tree
Showing 18 changed files with 1,191 additions and 518 deletions.
2 changes: 2 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ with_systemd
with_selinux
with_openssl
krb_srvtab
with_gssapi
with_python
with_perl
with_tcl
Expand Down Expand Up @@ -5491,6 +5492,7 @@ $as_echo "$with_gssapi" >&6; }




#
# Kerberos configuration parameters
#
Expand Down
1 change: 1 addition & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ PGAC_ARG_BOOL(with, gssapi, no, [build with GSSAPI support],
krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
])
AC_MSG_RESULT([$with_gssapi])
AC_SUBST(with_gssapi)


AC_SUBST(krb_srvtab)
Expand Down
2 changes: 1 addition & 1 deletion doc/src/sgml/client-auth.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ omicron bryanh guest1
provides automatic authentication (single sign-on) for systems
that support it. The authentication itself is secure, but the
data sent over the database connection will be sent unencrypted unless
<acronym>SSL</acronym> is used.
<acronym>SSL</acronym> or <acronym>GSSAPI</acronym> are used.
</para>

<para>
Expand Down
20 changes: 14 additions & 6 deletions doc/src/sgml/runtime.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -1915,12 +1915,13 @@ pg_dumpall -p 5432 | psql -d postgres -p 5433
</para>

<para>
To prevent spoofing on TCP connections, the best solution is to use
SSL certificates and make sure that clients check the server's certificate.
To do that, the server
must be configured to accept only <literal>hostssl</> connections (<xref
linkend="auth-pg-hba-conf">) and have SSL key and certificate files
(<xref linkend="ssl-tcp">). The TCP client must connect using
To prevent spoofing on TCP connections, the best solutions are either to
use GSSAPI for authentication and encryption or to use SSL certificates and
make sure that clients check the server's certificate. To secure using
SSL, the server must be configured to accept only <literal>hostssl</>
connections (<xref linkend="auth-pg-hba-conf">) and have SSL key and
certificate files (<xref linkend="ssl-tcp">). The TCP client must connect
using
<literal>sslmode=verify-ca</> or
<literal>verify-full</> and have the appropriate root certificate
file installed (<xref linkend="libq-ssl-certificates">).
Expand Down Expand Up @@ -2040,6 +2041,13 @@ pg_dumpall -p 5432 | psql -d postgres -p 5433
connect to servers only via SSL. <application>Stunnel</> or
<application>SSH</> can also be used to encrypt transmissions.
</para>

<para>
Similarly, GSSAPI also encrypts all data sent across the network,
including passwords, queries, and data, as in
SSL. <filename>pg_hba.conf</> allows specification of GSSAPI
connections, which are always encrypted.
</para>
</listitem>
</varlistentry>

Expand Down
1 change: 1 addition & 0 deletions src/Makefile.global.in
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ with_perl = @with_perl@
with_python = @with_python@
with_tcl = @with_tcl@
with_openssl = @with_openssl@
with_gssapi = @with_gssapi@
with_selinux = @with_selinux@
with_systemd = @with_systemd@
with_libxml = @with_libxml@
Expand Down
4 changes: 4 additions & 0 deletions src/backend/libpq/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ ifeq ($(with_openssl),yes)
OBJS += be-secure-openssl.o
endif

ifeq ($(with_gssapi),yes)
OBJS += be-gssapi.o
endif

include $(top_srcdir)/src/backend/common.mk
Loading

0 comments on commit dc10e35

Please sign in to comment.