Bug 517065 - selinux prevents rsyslog/syslog-ng to talk to tcp/601 or listen on tcp/601 port
Summary: selinux prevents rsyslog/syslog-ng to talk to tcp/601 or listen on tcp/601 port
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: selinux-policy
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-12 14:11 UTC by Peter Bieringer
Modified: 2009-10-22 15:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-10-22 15:06:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Peter Bieringer 2009-08-12 14:11:02 UTC
Description of problem:
configuring rsyslog to use a reliable tcp connection to port 601 (choosen from /etc/services), selinux prohibits this connection.

Version-Release number of selected component (if applicable):
rsyslog-2.0.6-1.el5
selinux-policy-2.4.6-203.el5
selinux-policy-targeted-2.4.6-203.el5

How reproducible:
Always

Steps to Reproduce:
1. configure /etc/rsyslog.conf for remote tcp output channel on port 601
*.notice;authpriv.*                                    @@syslog:601
2. reload rsyslog
  
Actual results:
type=AVC msg=audit(1250085933.332:384438): avc:  denied  { name_connect } for  pid=27087 comm="rsyslogd" dest=601 scontext=user_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:hi_reserved_port_t:s0 tclass=tcp_socket

no packets were leaving the system if selinux is enforced.

Expected results:
Working well, packets are sent to remote syslog via tcp - as seen if selinux is switched to permissive mode.

Additional info:
514/tcp can't be used, because it's reserved for remote shell

Comment 1 Peter Bieringer 2009-08-13 15:02:55 UTC
Looks like following selinux extension is required for sending to remote syslog:

allow syslogd_t hi_reserved_port_t:tcp_socket name_connect;


Note also, that for acting as tcp listening syslog server, also a policy extension is required:

allow syslogd_t hi_reserved_port_t:tcp_socket name_bind;


And if using syslog-ng from EPEL, an additional missing one was detected:

allow syslogd_t self:process getsched;

Comment 2 Eduard Benes 2009-10-22 14:30:32 UTC
I believe selinux-policy is the correct component for this bug, not rsyslog (if it is a bug at all).

Comment 3 Daniel Walsh 2009-10-22 15:06:00 UTC
# semanage port -a -t syslogd_port_t -p tcp 601

http://danwalsh.livejournal.com/9275.html


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