Bug 1323223 - SELinux is preventing /bin/busybox from 'write' accesses on the directory web-logs-example.
Summary: SELinux is preventing /bin/busybox from 'write' accesses on the directory web...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 23
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:eaace30951da4daa0f1e561470e...
: 1323225 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-01 15:14 UTC by OoZooL
Modified: 2016-04-03 09:39 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-03 09:39:03 UTC
Type: ---


Attachments (Terms of Use)

Description OoZooL 2016-04-01 15:14:58 UTC
Description of problem:
docker web server trying to write to an SELinux protected area under the root home directory, I believe....
SELinux is preventing /bin/busybox from 'write' accesses on the directory web-logs-example.

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

If you believe that busybox should be allowed write access on the web-logs-example directory 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 sh /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:svirt_lxc_net_t:s0:c422,c579
Target Context                unconfined_u:object_r:admin_home_t:s0
Target Objects                web-logs-example [ dir ]
Source                        sh
Source Path                   /bin/busybox
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-158.11.fc23.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.4.6-300.fc23.x86_64 #1 SMP Wed
                              Mar 16 22:10:37 UTC 2016 x86_64 x86_64
Alert Count                   84
First Seen                    2016-04-01 18:12:01 IDT
Last Seen                     2016-04-01 18:13:24 IDT
Local ID                      d4ecd442-c993-4d43-bed6-fcd889782473

Raw Audit Messages
type=AVC msg=audit(1459523604.156:681): avc:  denied  { write } for  pid=20098 comm="sh" name="web-logs-example" dev="dm-1" ino=673406 scontext=system_u:system_r:svirt_lxc_net_t:s0:c422,c579 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=dir permissive=0


type=SYSCALL msg=audit(1459523604.156:681): arch=x86_64 syscall=open success=no exit=EACCES a0=1efa010 a1=441 a2=1b6 a3=0 items=0 ppid=1928 pid=20098 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=sh exe=/bin/busybox subj=system_u:system_r:svirt_lxc_net_t:s0:c422,c579 key=(null)

Hash: sh,svirt_lxc_net_t,admin_home_t,dir,write

Version-Release number of selected component:
selinux-policy-3.13.1-158.11.fc23.noarch

Additional info:
reporter:       libreport-2.6.4
hashmarkername: setroubleshoot
kernel:         4.4.6-300.fc23.x86_64
type:           libreport

Comment 1 Daniel Walsh 2016-04-03 09:39:03 UTC
This looks like you have volume mounted something from the /root directory into a container.

You need to use the :Z or :z option on your volume mount to label the content correctly.

Note Miroslav, we should add an setroubleshoot for this.

http://www.projectatomic.io/blog/2016/03/dwalsh_selinux_containers/

Comment 2 Daniel Walsh 2016-04-03 09:39:37 UTC
*** Bug 1323225 has been marked as a duplicate of this bug. ***


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