RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1306197 - SELinux is preventing systemd from 'getattr' accesses on the file /etc/ssh/ssh_host_rsa_key.
Summary: SELinux is preventing systemd from 'getattr' accesses on the file /etc/ssh/ss...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.3
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard: abrt_hash:5310c716937875b9e9aeb45b15b...
Depends On: 1299106
Blocks: 1266043
TreeView+ depends on / blocked
 
Reported: 2016-02-10 09:58 UTC by Lukas Vrabec
Modified: 2016-11-04 02:42 UTC (History)
12 users (show)

Fixed In Version: selinux-policy-3.13.1-66.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1299106
Environment:
Last Closed: 2016-11-04 02:42:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2283 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2016-11-03 13:36:25 UTC

Description Lukas Vrabec 2016-02-10 09:58:01 UTC
+++ This bug was initially created as a clone of Bug #1299106 +++

Description of problem:
SELinux is preventing systemd from 'getattr' accesses on the file /etc/ssh/ssh_host_rsa_key.

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

If you believe that systemd should be allowed getattr access on the ssh_host_rsa_key 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:
# grep systemd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:init_t:s0
Target Context                system_u:object_r:sshd_key_t:s0
Target Objects                /etc/ssh/ssh_host_rsa_key [ file ]
Source                        systemd
Source Path                   systemd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-166.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.4.0-1.fc24.x86_64 #1 SMP Mon Jan
                              11 16:48:24 UTC 2016 x86_64 x86_64
Alert Count                   9
First Seen                    2016-01-16 00:16:32 CET
Last Seen                     2016-01-16 01:02:02 CET
Local ID                      309aa1c1-7df2-484c-bc12-f0d5b2f09067

Raw Audit Messages
type=AVC msg=audit(1452902522.632:89): avc:  denied  { getattr } for  pid=1 comm="systemd" path="/etc/ssh/ssh_host_rsa_key" dev="dm-1" ino=1837544 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:sshd_key_t:s0 tclass=file permissive=0


Hash: systemd,init_t,sshd_key_t,file,getattr

Version-Release number of selected component:
selinux-policy-3.13.1-166.fc24.noarch

Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.4.0-1.fc24.x86_64
type:           libreport

--- Additional comment from Lukas Vrabec on 2016-02-09 12:00:15 EST ---

I had a discussion with ssh maintainer Jakub Jelen, and we ended up with that getattr si enough. Here is patch which caused the issue.

http://pkgs.fedoraproject.org/cgit/rpms/openssh.git/commit/?id=af94f46861844cbd6ba4162115039bebcc8f78ba

I'm going to allow this.

--- Additional comment from Lukas Vrabec on 2016-02-10 04:57:01 EST ---

commit 1b1d96b26018468f9f930ddd5a7707eab05ebcfc
Author: Lukas Vrabec <lvrabec>
Date:   Wed Feb 10 10:27:41 2016 +0100

    Allow run sshd-keygen on second boot if first boot fails after some reason and content is not syncedon the disk. These changes are reflecting this commit in sshd.
    http://pkgs.fedoraproject.org/cgit/rpms/openssh.git/commit/?id=af94f46861844cbd6ba4162115039bebcc8f78ba
    rhbz#1299106

commit 9ce8c9e84a78ca7dc5a02019a3d58113c10aad62
Author: Lukas Vrabec <lvrabec>
Date:   Wed Feb 10 10:17:40 2016 +0100

    Add interface ssh_getattr_server_keys() interface. rhbz#1299106

Comment 1 Mike McCune 2016-03-28 22:59:28 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 5 errata-xmlrpc 2016-11-04 02:42:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2283.html


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