Bug 865063 - SELinux is preventing /usr/sbin/sshd from 'create' accesses on the unix_dgram_socket .
SELinux is preventing /usr/sbin/sshd from 'create' accesses on the unix_dgram...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
17
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
abrt_hash:9a080dc396af7776476de21039a...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-10 14:09 EDT by James Heather
Modified: 2012-12-20 10:38 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-20 10:38:57 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)
File: type (9 bytes, text/plain)
2012-10-10 14:09 EDT, James Heather
no flags Details
File: hashmarkername (14 bytes, text/plain)
2012-10-10 14:09 EDT, James Heather
no flags Details

  None (edit)
Description James Heather 2012-10-10 14:09:09 EDT
Additional info:
libreport version: 2.0.14
kernel:         3.5.4-2.fc17.x86_64

description:
:SELinux is preventing /usr/sbin/sshd from 'create' accesses on the unix_dgram_socket .
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that sshd should be allowed create access on the  unix_dgram_socket by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
:Do
:allow this access for now by executing:
:# grep sshd /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:sshd_sandbox_t:s0-s0:c0.c1023
:Target Context                system_u:system_r:sshd_sandbox_t:s0-s0:c0.c1023
:Target Objects                 [ unix_dgram_socket ]
:Source                        sshd
:Source Path                   /usr/sbin/sshd
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           openssh-server-5.9p1-26.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-149.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.5.4-2.fc17.x86_64 #1 SMP Wed Sep
:                              26 21:58:50 UTC 2012 x86_64 x86_64
:Alert Count                   14055
:First Seen                    2012-06-22 00:10:54 BST
:Last Seen                     2012-10-10 18:32:08 BST
:Local ID                      29c28bfe-5506-43f8-bdea-5cd3eaf76fb8
:
:Raw Audit Messages
:type=AVC msg=audit(1349890328.611:15397): avc:  denied  { create } for  pid=8703 comm="sshd" scontext=system_u:system_r:sshd_sandbox_t:s0-s0:c0.c1023 tcontext=system_u:system_r:sshd_sandbox_t:s0-s0:c0.c1023 tclass=unix_dgram_socket
:
:
:type=SYSCALL msg=audit(1349890328.611:15397): arch=x86_64 syscall=socket success=no exit=EACCES a0=1 a1=80002 a2=0 a3=7242203a65746972 items=0 ppid=1 pid=8703 auid=4294967295 uid=74 gid=74 euid=74 suid=74 fsuid=74 egid=74 sgid=74 fsgid=74 tty=(none) ses=4294967295 comm=sshd exe=/usr/sbin/sshd subj=system_u:system_r:sshd_sandbox_t:s0-s0:c0.c1023 key=(null)
:
:Hash: sshd,sshd_sandbox_t,sshd_sandbox_t,unix_dgram_socket,create
:
:audit2allow
:
:#============= sshd_sandbox_t ==============
:allow sshd_sandbox_t self:unix_dgram_socket create;
:
:audit2allow -R
:
:#============= sshd_sandbox_t ==============
:allow sshd_sandbox_t self:unix_dgram_socket create;
:
Comment 1 James Heather 2012-10-10 14:09:11 EDT
Created attachment 625072 [details]
File: type
Comment 2 James Heather 2012-10-10 14:09:13 EDT
Created attachment 625073 [details]
File: hashmarkername
Comment 3 Miroslav Grepl 2012-10-11 02:06:19 EDT
James,
could you execute

# semanage permissive -a sshd_sandbox_t

re-test and

# ausearch -m avc -ts recent
# semanage permissive -d sshd_sandbox_t 

Thank you.
Comment 4 James Heather 2012-10-11 04:12:22 EDT
Well, I've executed the first line.

I've had a look in the sshd logs and it looks as though it happened while I was under attack from a script kiddie. I'm sure that'll happen again soon enough, but I don't know whether exactly the same attack will happen, so I can't be sure whether the same SELinux bug will get triggered again.

I can provide the sshd logs if they're useful, though they just look like the usual thing to me. Below is a short random chunk.

James

Oct 10 18:31:33 barry sshd[8567]: Invalid user nagios from 50.19.31.89
Oct 10 18:31:33 barry sshd[8567]: input_userauth_request: invalid user nagios [preauth]
Oct 10 18:31:33 barry sshd[8567]: pam_unix(sshd:auth): check pass; user unknown
Oct 10 18:31:33 barry sshd[8567]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=ec2-50-19-31-89.compute-1.amazonaws.com
Oct 10 18:31:34 barry sshd[8577]: Invalid user www from 50.19.31.89
Oct 10 18:31:34 barry sshd[8577]: input_userauth_request: invalid user www [preauth]
Oct 10 18:31:34 barry sshd[8577]: pam_unix(sshd:auth): check pass; user unknown
Oct 10 18:31:34 barry sshd[8577]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=ec2-50-19-31-89.compute-1.amazonaws.com
Oct 10 18:31:35 barry sshd[8586]: Invalid user test from 50.19.31.89
Oct 10 18:31:35 barry sshd[8586]: input_userauth_request: invalid user test [preauth]
Oct 10 18:31:35 barry sshd[8586]: pam_unix(sshd:auth): check pass; user unknown
Oct 10 18:31:35 barry sshd[8586]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=ec2-50-19-31-89.compute-1.amazonaws.com
Oct 10 18:31:36 barry sshd[8595]: Invalid user testuser from 50.19.31.89
Oct 10 18:31:36 barry sshd[8595]: input_userauth_request: invalid user testuser [preauth]
Oct 10 18:31:36 barry sshd[8595]: pam_unix(sshd:auth): check pass; user unknown
Oct 10 18:31:36 barry sshd[8595]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=ec2-50-19-31-89.compute-1.amazonaws.com
Oct 10 18:31:37 barry unix_chkpwd[8606]: password check failed for user (bin)
Oct 10 18:31:37 barry sshd[8604]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=ec2-50-19-31-89.compute-1.amazonaws.com  user=bin
Oct 10 18:31:37 barry sshd[8604]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "bin"
Oct 10 18:31:40 barry sshd[8604]: Failed password for bin from 50.19.31.89 port 34738 ssh2
Oct 10 18:31:40 barry sshd[8604]: Received disconnect from 50.19.31.89: 11: Bye Bye [preauth]
Comment 5 James Heather 2012-10-11 07:37:32 EDT
It's just happened again, so adding that rule didn't help.

The ausearch returns what's below.

James

-------------

time->Thu Oct 11 12:12:20 2012
type=SYSCALL msg=audit(1349953940.458:15961): arch=c000003e syscall=41 success=yes exit=6 a0=1 a1=80002 a2=0 a3=7242203a65746972 items=0 ppid=1 pid=26346 auid=4294967295 uid=74 gid=74 euid=74 suid=74 fsuid=74 egid=74 sgid=74 fsgid=74 tty=(none) ses=4294967295 comm="sshd" exe="/usr/sbin/sshd" subj=system_u:system_r:sshd_sandbox_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1349953940.458:15961): avc:  denied  { create } for  pid=26346 comm="sshd" scontext=system_u:system_r:sshd_sandbox_t:s0-s0:c0.c1023 tcontext=system_u:system_r:sshd_sandbox_t:s0-s0:c0.c1023 tclass=unix_dgram_socket
----
time->Thu Oct 11 12:12:20 2012
type=SYSCALL msg=audit(1349953940.458:15962): arch=c000003e syscall=42 success=no exit=-2 a0=6 a1=7ffd93d2f840 a2=6e a3=7242203a65746972 items=0 ppid=1 pid=26346 auid=4294967295 uid=74 gid=74 euid=74 suid=74 fsuid=74 egid=74 sgid=74 fsgid=74 tty=(none) ses=4294967295 comm="sshd" exe="/usr/sbin/sshd" subj=system_u:system_r:sshd_sandbox_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1349953940.458:15962): avc:  denied  { connect } for  pid=26346 comm="sshd" scontext=system_u:system_r:sshd_sandbox_t:s0-s0:c0.c1023 tcontext=system_u:system_r:sshd_sandbox_t:s0-s0:c0.c1023 tclass=unix_dgram_socket
Comment 6 Daniel Walsh 2012-10-11 22:39:07 EDT
Sending a syslog message?
Comment 7 Miroslav Grepl 2012-10-12 03:39:13 EDT
I don't think so.

Petr?
Comment 8 Miroslav Grepl 2012-10-17 03:27:15 EDT
Fixed.
Comment 9 Fedora Update System 2012-10-17 08:35:22 EDT
selinux-policy-3.10.0-156.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-156.fc17
Comment 10 Fedora Update System 2012-10-17 20:26:46 EDT
Package selinux-policy-3.10.0-156.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-156.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-16347/selinux-policy-3.10.0-156.fc17
then log in and leave karma (feedback).
Comment 11 Fedora Update System 2012-12-20 10:38:59 EST
selinux-policy-3.10.0-156.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

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