From 6f9192df61e183826211ad2eaf325c6de5cf3656 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sat, 19 Mar 2011 18:44:35 +0100 Subject: Rename ident authentication over local connections to peer This removes an overloading of two authentication options where one is very secure (peer) and one is often insecure (ident). Peer is also the name used in libpq from 9.1 to specify the same type of authentication. Also make initdb select peer for local connections when ident is chosen, and ident for TCP connections when peer is chosen. ident keyword in pg_hba.conf is still accepted and maps to peer authentication. --- doc/src/sgml/client-auth.sgml | 96 ++++++++++++++++++++++++++++--------------- doc/src/sgml/runtime.sgml | 2 +- 2 files changed, 63 insertions(+), 35 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/client-auth.sgml b/doc/src/sgml/client-auth.sgml index 4ca723fe1a6..afbd9feb37c 100644 --- a/doc/src/sgml/client-auth.sgml +++ b/doc/src/sgml/client-auth.sgml @@ -457,16 +457,29 @@ hostnossl database user ident - Obtain the operating system user name of the client (for - TCP/IP connections by contacting the ident server on the - client, for local connections by getting it from the - operating system) and check if it matches the requested - database user name. + Obtain the operating system user name of the client + by contacting the ident server on the client + and check if it matches the requested database user name. + Ident authentication can only be used on TCP/IP + connections. When specified for local connections, peer + authentication will be used instead. See for details. + + peer + + + Obtain the operating system user name from the operating system + and check if it matches the requested database user name. + This is only available for local connections. + See for details. + + + + ldap @@ -1200,7 +1213,7 @@ omicron bryanh guest1 - Ident-based Authentication + Ident Authentication ident @@ -1208,13 +1221,19 @@ omicron bryanh guest1 The ident authentication method works by obtaining the client's - operating system user name and using it as the allowed database user - name (with an optional user name mapping). - The determination of the client's - user name is the security-critical point, and it works differently - depending on the connection type, as described below. + operating system user name from an ident server and using it as + the allowed database user name (with an optional user name mapping). + This is only supported on TCP/IP connections. + + + When ident is specified for a local (non-TCP/IP) connection, + peer authentication (see ) will be + used instead. + + + The following configuration options are supported for ident: @@ -1230,9 +1249,6 @@ omicron bryanh guest1 - - Ident Authentication Over TCP/IP - The Identification Protocol is described in RFC 1413. Virtually every Unix-like @@ -1275,36 +1291,48 @@ omicron bryanh guest1 since PostgreSQL does not have any way to decrypt the returned string to determine the actual user name. - + - - Ident Authentication Over Local Sockets + + Peer Authentication + + + peer + - On systems supporting SO_PEERCRED requests for + The peer authentication method works by obtaining the client's + operating system user name from the kernel and using it as the + allowed database user name (with optional user name mapping). This + is only supported on local connections. + + + + The following configuration options are supported for peer: + + + map + + + Allows for mapping between system and database user names. See + for details. + + + + + + + + Peer authentication is only available on systems supporting + SO_PEERCRED requests for Unix-domain sockets (currently Linux, FreeBSD, NetBSD, OpenBSD, - BSD/OS, and Solaris), ident authentication can also - be applied to local connections. + BSD/OS, and Solaris). PostgreSQL uses SO_PEERCRED to find out the operating system name of the connected client process. - In this case, no security risk is added by - using ident authentication; indeed it is a preferable choice for - local connections on such systems. - - On systems without SO_PEERCRED requests, ident - authentication is only available for TCP/IP connections. As a - work-around, it is possible to specify the localhost address 127.0.0.1 and make connections to this - address. This method is trustworthy to the extent that you trust - the local ident server. - - - diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index f77673791b9..b5ad1011cbe 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -148,7 +148,7 @@ postgres$ initdb -D /usr/local/pgsql/data mode is not used; or modify the generated pg_hba.conf file after running initdb, but before you start the server for the first time. (Other - reasonable approaches include using ident authentication + reasonable approaches include using peer authentication or file system permissions to restrict connections. See for more information.) -- cgit v1.2.3