Bug 484350 - SELinux prevents httpd from accessing Unix Sockets
SELinux prevents httpd from accessing Unix Sockets
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-06 06:59 EST by Anthony Messina
Modified: 2009-11-18 06:24 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-11-18 06:24:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Anthony Messina 2009-02-06 06:59:23 EST
Running selinux-policy-targeted-3.5.13-44.fc10.noarch with httpd_can_network_connect_db --> on, I get the following error when I have configured httpd to connect to a unix socket, rather than "localhost" -- in this case, it's openldap's socket.

I'm not sure whether there should be a separate boolean for this or if it should become part of the httpd_can_network_connect_db boolean.

Source Context:    unconfined_u:system_r:httpd_t:s0
  Target Context:    system_u:object_r:slapd_var_run_t:s0
  Target Objects:    ldapi [ sock_file ]
  Source:    httpd
  Source Path:    /usr/sbin/httpd
  Port:    <Unknown>
  Host:    xxxx
  Source RPM Packages:    httpd-2.2.10-2
  Target RPM Packages:  
  Policy RPM:    selinux-policy-3.5.13-44.fc10
  Selinux Enabled:    True
  Policy Type:    targeted
  MLS Enabled:    True
  Enforcing Mode:    Permissive
  Plugin Name:    httpd_bad_labels
  Host Name:    xxxx
  Platform:    Linux xxxx 2.6.27.12-170.2.5.fc10.x86_64 #1 SMP Wed Jan 21 01:33:24 EST 2009 x86_64 x86_64
  Alert Count:    1
  First Seen:    Thu Feb 5 16:08:08 2009
  Last Seen:    Thu Feb 5 16:08:08 2009
  Local ID:    1f1e36f6-11fa-4178-a5f8-f685fb32e488
  Line Numbers:  
  Raw Audit Messages :

node=xxxx type=AVC msg=audit(1233871688.170:53709): avc: denied { write } for pid=14204 comm="httpd" name="ldapi" dev=sdd3 ino=3529524 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:slapd_var_run_t:s0 tclass=sock_file 
node=xxxx type=AVC msg=audit(1233871688.170:53709): avc: denied { connectto } for pid=14204 comm="httpd" path="/var/run/ldapi" scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:system_r:slapd_t:s0 tclass=unix_stream_socket 
node=chicago.messinet.com type=SYSCALL msg=audit(1233871688.170:53709): arch=c000003e syscall=42 success=yes exit=0 a0=18 a1=7ffff4ff20c0 a2=6e a3=7ffff4ff20c2 items=0 ppid=32093 pid=14204 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
Comment 1 Miroslav Grepl 2009-02-10 07:11:01 EST
Dan, 
it looks like that we should add:

optional_policy(`
        ldap_stream_connect(httpd_t)
')
Comment 2 Daniel Walsh 2009-02-10 08:56:02 EST
That should be added to auth_use_nsswitch inside of authlogin.if.

auth_use_nsswitch currently allows connecting to ldap via the network, so connectiong via a local stream should be equivalent.
Comment 3 Miroslav Grepl 2009-02-12 10:08:12 EST
Fixed in selinux-policy-3.5.13-45.fc10
Comment 4 Bug Zapper 2009-11-18 06:00:07 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

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