Bug 1494287 - SELinux is preventing portainer from 'connectto' accesses on the unix_stream_socket /run/docker.sock.
Summary: SELinux is preventing portainer from 'connectto' accesses on the unix_stream_...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 26
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:1c5d4da524a6bfae27142ab02a7...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-21 23:41 UTC by thiagoahauck
Modified: 2017-09-22 10:52 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-22 10:52:52 UTC
Type: ---


Attachments (Terms of Use)

Description thiagoahauck 2017-09-21 23:41:59 UTC
Description of problem:
SELinux is preventing portainer from 'connectto' accesses on the unix_stream_socket /run/docker.sock.

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

If você acredita que o portainer deva ser permitido acesso de connectto em docker.sock unix_stream_socket  por default.
Then você deve informar que este é um erro.
Você pode gerar um módulo de política local para permitir este acesso.
Do
allow this access for now by executing:
# ausearch -c 'portainer' --raw | audit2allow -M my-portainer
# semodule -X 300 -i my-portainer.pp

Additional Information:
Source Context                system_u:system_r:container_t:s0:c302,c318
Target Context                system_u:system_r:container_runtime_t:s0
Target Objects                /run/docker.sock [ unix_stream_socket ]
Source                        portainer
Source Path                   portainer
Port                          <Desconhecido>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-260.8.fc26.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.12.12-300.fc26.x86_64 #1 SMP Mon
                              Sep 11 17:18:56 UTC 2017 x86_64 x86_64
Alert Count                   2
First Seen                    2017-09-21 20:17:47 -03
Last Seen                     2017-09-21 20:17:47 -03
Local ID                      8c66c756-dc62-4137-9576-e9624dc62a72

Raw Audit Messages
type=AVC msg=audit(1506035867.714:403): avc:  denied  { connectto } for  pid=2888 comm="portainer" path="/run/docker.sock" scontext=system_u:system_r:container_t:s0:c302,c318 tcontext=system_u:system_r:container_runtime_t:s0 tclass=unix_stream_socket permissive=0


Hash: portainer,container_t,container_runtime_t,unix_stream_socket,connectto

Version-Release number of selected component:
selinux-policy-3.13.1-260.8.fc26.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.1
hashmarkername: setroubleshoot
kernel:         4.12.12-300.fc26.x86_64
type:           libreport

Comment 1 Daniel Walsh 2017-09-22 10:52:52 UTC
You are running a confined container and giving it access to the docker.sock. Which SELinux is correctly blocking. Any process that can talk to the docker.sock, owns your system.  So you might as well run with --privileged mode.  If this is your intention.  If not, then you have a container breakout...


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