Bug 1160125

Summary: SELinux is preventing docker from using the 'kill' capabilities.
Product: [Fedora] Fedora Reporter: M. Edward (Ed) Borasky <znmeb>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: dominick.grift, dwalsh, lvrabec, mgrepl, mmalik, plautrba, znmeb
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: abrt_hash:35167fa6b7efea9eb978587661fcfc021a5dad41c3535ef8c05b6bbcbcb8a5ad
Fixed In Version: selinux-policy-3.13.1-99.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-03 17:15:26 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 M. Edward (Ed) Borasky 2014-11-04 05:45:50 UTC
Description of problem:
Ran an image in a Docker container. Went back to command line and typed 'docker stop' on the container. SELinux threw an error.
SELinux is preventing docker from using the 'kill' capabilities.

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

If you believe that docker should have the kill 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                   docker
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-92.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.17.1-302.fc21.x86_64 #1 SMP Fri
                              Oct 17 20:05:46 UTC 2014 x86_64 x86_64
Alert Count                   8
First Seen                    2014-11-02 22:15:39 PST
Last Seen                     2014-11-03 21:43:33 PST
Local ID                      a88b000b-7ecc-4132-86a8-ee8ef94a1fd7

Raw Audit Messages
type=AVC msg=audit(1415079813.677:1944): avc:  denied  { kill } for  pid=2623 comm="docker" capability=5  scontext=system_u:system_r:docker_t:s0 tcontext=system_u:system_r:docker_t:s0 tclass=capability permissive=1


Hash: docker,docker_t,docker_t,capability,kill

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

Additional info:
reporter:       libreport-2.3.0
hashmarkername: setroubleshoot
kernel:         3.17.1-302.fc21.x86_64
type:           libreport

Comment 1 Daniel Walsh 2014-11-04 12:50:26 UTC
The docker.te file in Git has this capability, please back port to F20, F21 and RHEL7.

Comment 2 Lukas Vrabec 2014-11-04 19:04:27 UTC
commit 29056277f14698eb44b1753237452f69f65ebe76
Author: Dan Walsh <dwalsh>
Date:   Mon Nov 3 08:12:54 2014 -0500

    Add fixes to allow docker to create more content in tmpfs ,and donaudit reading /proc

Back ported to F20,F21,RHEL7

Comment 3 Fedora Update System 2014-11-21 12:24:05 UTC
selinux-policy-3.13.1-99.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/selinux-policy-3.13.1-99.fc21

Comment 4 M. Edward (Ed) Borasky 2014-11-29 03:53:30 UTC
Description of problem:
Killed a process in a running Docker container

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

Additional info:
reporter:       libreport-2.3.0
hashmarkername: setroubleshoot
kernel:         3.17.4-300.fc21.x86_64
type:           libreport

Comment 5 Fedora Update System 2014-12-03 17:15:26 UTC
selinux-policy-3.13.1-99.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.