Bug 1589555

Summary: SELinux is preventing nmap from 'map' accesses on the packet_socket packet_socket.
Product: [Fedora] Fedora Reporter: alex
Component: container-selinuxAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: amurdaca, dwalsh, fkluknav, jchaloup, lsm5, lvrabec, mgrepl, plautrba, pmoore
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:3a252861421b8e29e1fe557ac176afcd64f50a6cc7f1219130aa2709e759c1ff;VARIANT_ID=workstation;
Fixed In Version: container-selinux-2.65-1.gitbf5b26b.fc27 container-selinux-2.65-1.gitbf5b26b.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-28 13:33:40 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 alex 2018-06-10 18:10:50 UTC
Description of problem:
Trying to run nmap in docker
SELinux is preventing nmap from 'map' accesses on the packet_socket packet_socket.

This is running nmap in a CentOS 7 Docker container.

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

If you believe that nmap should be allowed map access on the packet_socket packet_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:
# ausearch -c 'nmap' --raw | audit2allow -M my-nmap
# semodule -X 300 -i my-nmap.pp

Additional Information:
Source Context                system_u:system_r:container_t:s0:c475,c564
Target Context                system_u:system_r:container_t:s0:c475,c564
Target Objects                packet_socket [ packet_socket ]
Source                        nmap
Source Path                   nmap
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.1-30.fc28.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.16.14-300.fc28.x86_64 #1 SMP Tue
                              Jun 5 16:23:44 UTC 2018 x86_64 x86_64
Alert Count                   1
First Seen                    2018-06-10 13:42:26 CEST
Last Seen                     2018-06-10 13:42:26 CEST
Local ID                      f4028edb-d929-4dbd-a1d1-2a7d3c3b095e

Raw Audit Messages
type=AVC msg=audit(1528630946.90:776): avc:  denied  { map } for  pid=14186 comm="nmap" path="socket:[174572]" dev="sockfs" ino=174572 scontext=system_u:system_r:container_t:s0:c475,c564 tcontext=system_u:system_r:container_t:s0:c475,c564 tclass=packet_socket permissive=0


Hash: nmap,container_t,container_t,packet_socket,map

Version-Release number of selected component:
selinux-policy-3.14.1-30.fc28.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.5
hashmarkername: setroubleshoot
kernel:         4.16.14-300.fc28.x86_64
type:           libreport

Comment 1 Daniel Walsh 2018-06-11 12:58:02 UTC
Fixed in container-selinux-2.65-1.gitbf5b26b

Comment 2 Fedora Update System 2018-06-18 14:17:50 UTC
container-selinux-2.65-1.gitbf5b26b.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-33f2eda222

Comment 3 Fedora Update System 2018-06-18 14:18:05 UTC
container-selinux-2.65-1.gitbf5b26b.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-352f18aa25

Comment 4 Fedora Update System 2018-06-19 16:35:47 UTC
container-selinux-2.65-1.gitbf5b26b.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-352f18aa25

Comment 5 Fedora Update System 2018-06-19 16:56:30 UTC
container-selinux-2.65-1.gitbf5b26b.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-33f2eda222

Comment 6 Fedora Update System 2018-06-28 13:33:40 UTC
container-selinux-2.65-1.gitbf5b26b.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2018-06-28 14:07:05 UTC
container-selinux-2.65-1.gitbf5b26b.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.