Bug 1562496

Summary: SELinux is preventing snapd from 'getattr' accesses on the file /usr/bin/ssh-keygen.
Product: [Fedora] Fedora Reporter: Mohammad H. Nazari <mohos.nas>
Component: snapdAssignee: Zygmunt Krynicki <me>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: dwalsh, lvrabec, marek90, me, mgrepl, ngompa13, plautrba, pmoore
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:5206f765871470f93e3feee2c3958edcbd0d48ee9e94166f1af28bf306583fda;VARIANT_ID=workstation;
Fixed In Version: snapd-2.35-1.fc28 snapd-2.35-1.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-30 04:55:49 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 Mohammad H. Nazari 2018-03-31 10:14:48 UTC
Description of problem:
SELinux is preventing snapd from 'getattr' accesses on the file /usr/bin/ssh-keygen.

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

If you believe that snapd should be allowed getattr access on the ssh-keygen file 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 'snapd' --raw | audit2allow -M my-snapd
# semodule -X 300 -i my-snapd.pp

Additional Information:
Source Context                system_u:system_r:snappy_t:s0
Target Context                system_u:object_r:ssh_keygen_exec_t:s0
Target Objects                /usr/bin/ssh-keygen [ file ]
Source                        snapd
Source Path                   snapd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           openssh-7.6p1-5.fc27.x86_64
Policy RPM                    selinux-policy-3.13.1-283.26.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.15.6-300.fc27.x86_64 #1 SMP Mon
                              Feb 26 18:43:03 UTC 2018 x86_64 x86_64
Alert Count                   1
First Seen                    2018-03-31 01:39:04 +0430
Last Seen                     2018-03-31 01:39:04 +0430
Local ID                      5f5e0d5a-712c-4fae-b3bd-43c7ca610fa4

Raw Audit Messages
type=AVC msg=audit(1522444144.651:393): avc:  denied  { getattr } for  pid=16847 comm="snapd" path="/usr/bin/ssh-keygen" dev="sda5" ino=2633492 scontext=system_u:system_r:snappy_t:s0 tcontext=system_u:object_r:ssh_keygen_exec_t:s0 tclass=file permissive=1


Hash: snapd,snappy_t,ssh_keygen_exec_t,file,getattr

Version-Release number of selected component:
selinux-policy-3.13.1-283.26.fc27.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.15.6-300.fc27.x86_64
type:           libreport

Comment 1 Marek MichaƂ Mazur 2018-04-13 04:50:25 UTC
Description of problem:
1. Install snapd via dnf.
2. Install notepadqq via snap.

Version-Release number of selected component:
selinux-policy-3.13.1-283.30.fc27.noarch

Additional info:
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.15.15-300.fc27.x86_64
type:           libreport

Comment 2 Fedora Update System 2018-08-25 21:43:16 UTC
snapd-glib-1.43-1.fc28 snapd-2.35-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-5d4624b7af

Comment 3 Fedora Update System 2018-08-25 21:44:30 UTC
snapd-glib-1.43-1.fc27 snapd-2.35-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-14918a503a

Comment 4 Fedora Update System 2018-08-26 22:51:47 UTC
snapd-2.35-1.fc27, snapd-glib-1.43-1.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-14918a503a

Comment 5 Fedora Update System 2018-08-27 00:26:33 UTC
snapd-2.35-1.fc28, snapd-glib-1.43-1.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-5d4624b7af

Comment 6 Fedora Update System 2018-08-30 04:55:49 UTC
snapd-2.35-1.fc28, snapd-glib-1.43-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2018-09-06 02:31:10 UTC
snapd-2.35-1.fc27, snapd-glib-1.43-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.