Bug 161383 - SELinux blocks PostgreSQL ident authentication
SELinux blocks PostgreSQL ident authentication
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Depends On:
  Show dependency treegraph
Reported: 2005-06-22 15:23 EDT by Ian Pilcher
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version: 1.23.18-16
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-06-25 16:03:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ian Pilcher 2005-06-22 15:23:38 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4

Description of problem:
See below

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Create a Linux user account.  (My user ID is 'pilcher').        

2.  Connect to PostgreSQL as the superuser (postgres) and create a PostgreSQL
    database and user:

        CREATE DATABASE pilcher OWNER pilcher;

3.  Add the following line at the top of /var/lib/pgsql/data/pg_hba.conf:

        host    pilcher pilcher    ident   sameuser
3.  Restart PostgreSQL to make the changes effective:

        service postgresql restart

4.  Ensure that authd and xinetd are both installed and turned on.

5.  Turn off authd encryption (PostgreSQL doesn't support it).  Edit
    /etc/xinetd.d/auth and remove and '-E' option from the in.authd command

6.  Restart xinetd ('service xinetd restart').

7.  Logged on as Linux user 'pilcher', try to connect to the new database over
    the loopback adapter:

        psql -h localhost pilcher

Actual Results:  psql: FATAL:  Ident authentication failed for user "pilcher"

The following entries appear in /var/log/audit/audit.log:

type=SOCKETCALL msg=audit(1119466873.728:967800): nargs=3 a0=3 a1=9f51998 a2=10

type=SOCKADDR msg=audit(1119466873.728:967800): saddr=020000717F0000010000000000000000

type=SYSCALL msg=audit(1119466873.728:967800): arch=40000003 syscall=102 success=no exit=-13 a0=3 a1=bfd7de00 a2=bfd7ec44 a3=bfd7ec64 items=0 pid=2735 auid=4294967295 uid=26 gid=26 euid=26 suid=26 fsuid=26 egid=26 sgid=26 fsgid=26 comm="postmaster" exe="/usr/bin/postgres"

type=AVC msg=audit(1119466873.728:967800): avc:  denied  { name_connect } for  pid=2735 comm="postmaster" dest=113 scontext=system_u:system_r:postgresql_t tcontext=system_u:object_r:inetd_child_port_t tclass=tcp_socket

Expected Results:  Connection should have succeeded.  (SELinux should at least have allowed
PostgreSQL to connect to

Additional info:
Comment 1 Tom Lane 2005-06-23 14:15:36 EDT
It seems possible that bug #160975 is the same issue, although there is very
little info in that report.
Comment 2 Ian Pilcher 2005-06-23 15:35:15 EDT
See my comments in bug #160975.  I don't believe that it's the same issue.
Comment 3 Ian Pilcher 2005-06-25 16:03:33 EDT
Appears to be fixed in selinux-policy-targeted-1.23.18-16.
Comment 4 Andy Burns 2005-08-15 17:04:58 EDT
Problem still exists for me with elinux-policy-targeted 1.25.3-12

SELINUX is enabled, but no messages in audit.log

pgsql postgresq works OK with "ident sameuser" in pg_hba.conf
pgsql -h fails 

Anything else I can report?

Comment 5 Andy Burns 2005-08-15 17:22:54 EDT
oops, my fault ...

I had a "-E" for AES-128-CBC encryption in the /etc/xinetd/auth file ...

Note You need to log in before you can comment on or make changes to this bug.