Bug 1127128

Summary: SELinux is preventing /usr/bin/docker from using the 'setfcap' capabilities.
Product: [Fedora] Fedora Reporter: Stephen Gallagher <sgallagh>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: dominick.grift, dwalsh, lvrabec, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:ab05a45c42fc679d9fb9cd1152c53710202d80406dc7f9a6c64f2ff128a44bcf
Fixed In Version: selinux-policy-3.13.1-78.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-10 02:45:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stephen Gallagher 2014-08-06 08:34:10 UTC
Description of problem:
Tried to set up the fedora/memcached:latest docker image through Cockpit.
SELinux is preventing /usr/bin/docker from using the 'setfcap' capabilities.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that docker should have the setfcap capability 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 docker /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:docker_t:s0
Target Context                system_u:system_r:docker_t:s0
Target Objects                Unknown [ capability ]
Source                        docker
Source Path                   /usr/bin/docker
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           docker-io-1.1.2-2.fc21.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-67.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.16.0-0.rc6.git3.1.fc21.x86_64 #1
                              SMP Sat Jul 26 13:57:52 UTC 2014 x86_64 x86_64
Alert Count                   2
First Seen                    2014-08-06 10:33:24 CEST
Last Seen                     2014-08-06 10:33:41 CEST
Local ID                      17d2fb67-32bf-42f6-a4d7-1d61f3cbbff1

Raw Audit Messages
type=AVC msg=audit(1407314021.608:1083): avc:  denied  { setfcap } for  pid=5072 comm="docker" capability=31  scontext=system_u:system_r:docker_t:s0 tcontext=system_u:system_r:docker_t:s0 tclass=capability permissive=1


type=SYSCALL msg=audit(1407314021.608:1083): arch=x86_64 syscall=lsetxattr success=yes exit=0 a0=c2085a4300 a1=c208460180 a2=c208460160 a3=14 items=0 ppid=1 pid=5072 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=docker exe=/usr/bin/docker subj=system_u:system_r:docker_t:s0 key=(null)

Hash: docker,docker_t,docker_t,capability,setfcap

Version-Release number of selected component:
selinux-policy-3.13.1-67.fc21.noarch

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.16.0-0.rc6.git3.1.fc21.x86_64
type:           libreport

Comment 1 Daniel Walsh 2014-08-06 13:31:56 UTC
Miroslav we should continue to run docker as a permissive domain, or even unconfined_domain for now.  Too many unkowns.

Comment 2 Daniel Walsh 2014-08-06 13:32:59 UTC
25b7c9d4566df5b2ac5ec731dc5a4047822446f9 fixes this in git.

Comment 3 Lukas Vrabec 2014-08-12 09:29:26 UTC
commit 25b7c9d4566df5b2ac5ec731dc5a4047822446f9
Author: Dan Walsh <dwalsh>
Date:   Wed Aug 6 09:32:12 2014 -0400

    docker needs setfcap

https://github.com/selinux-policy/selinux-policy/commit/25b7c9d4566df5b2ac5ec731dc5a4047822446f9

Comment 4 Fedora Update System 2014-08-28 14:10:49 UTC
selinux-policy-3.13.1-77.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/selinux-policy-3.13.1-77.fc21

Comment 5 Fedora Update System 2014-08-28 16:42:32 UTC
Package selinux-policy-3.13.1-77.fc21:
* should fix your issue,
* was pushed to the Fedora 21 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.13.1-77.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-9873/selinux-policy-3.13.1-77.fc21
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2014-09-02 19:29:33 UTC
selinux-policy-3.13.1-78.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/selinux-policy-3.13.1-78.fc21

Comment 7 Fedora Update System 2014-09-10 02:45:48 UTC
selinux-policy-3.13.1-78.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.