Bug 1609929 - Selinux blocks sshd access to active.motd
Summary: Selinux blocks sshd access to active.motd
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-30 20:52 UTC by tlhackque
Modified: 2019-05-29 00:05 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-05-29 00:05:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description tlhackque 2018-07-30 20:52:35 UTC
Description of problem:
Vanilla new install of Fedora 28 server: Selinux complains about sshd access to "active.motd".

Version-Release number of selected component (if applicable):


How reproducible:

Install Fedora 28 in a new VM.  Edit sshd_config.  Start sshd.


Actual results:

type=AVC msg=audit(1532946662.491:239): avc: denied { read } for pid=1231 comm="sshd" name="active.motd" dev="tmpfs" ino=22805 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0


Expected results:

No complaints

Additional info:

I didn't setup an active.motd.  It's not mentioned in sshd_config.

 ausearch -c 'sshd' --raw | audit2allow


#============= sshd_t ==============
allow sshd_t var_run_t:file read;

find /run -inum 22805
/run/cockpit/active.motd
ls -liZ  /run/cockpit/active.motd
22805 -rw-r--r--. 1 root root system_u:object_r:var_run_t:s0 82 Jul 30 06:29 /run/cockpit/active.motd
[root@choochoo ~]# cat /run/cockpit/active.motd
Web console: https://choochoo.example.net:9090/ or https://192.168.148.82:9090/

Comment 1 Chris Murphy 2018-08-03 22:46:19 UTC
Yeah I get one of these AVC's everytime I log into Fedora 28 server with ssh (using a key).

[chris@f28s ~]$ sealert -l c0ce33ae-bde0-4bd5-a2c6-0f0c2ec70ae4
SELinux is preventing sshd from read access on the file active.motd.

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

If you believe that sshd should be allowed read access on the active.motd 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 'sshd' --raw | audit2allow -M my-sshd
# semodule -X 300 -i my-sshd.pp


Additional Information:
Source Context                system_u:system_r:sshd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:var_run_t:s0
Target Objects                active.motd [ file ]
Source                        sshd
Source Path                   sshd
Port                          <Unknown>
Host                          f28s.local
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.1-36.fc28.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     f28s.local
Platform                      Linux f28s.local 4.17.11-200.fc28.x86_64 #1 SMP
                              Mon Jul 30 15:21:09 UTC 2018 x86_64 x86_64
Alert Count                   63
First Seen                    2018-07-03 17:03:28 MDT
Last Seen                     2018-08-03 16:34:21 MDT
Local ID                      c0ce33ae-bde0-4bd5-a2c6-0f0c2ec70ae4

Raw Audit Messages
type=AVC msg=audit(1533335661.344:2294): avc:  denied  { read } for  pid=27854 comm="sshd" name="active.motd" dev="tmpfs" ino=23299 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0


Hash: sshd,sshd_t,var_run_t,file,read

[chris@f28s ~]$

Comment 2 Chris Murphy 2018-08-03 23:11:58 UTC
cockpit-173-1.fc28.x86_64 is installed, and the problem still happens after upgrading to selinux-policy-3.14.1-37.fc28.noarch and running restorecon.

Comment 3 Ben Cotton 2019-05-02 19:28:42 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2019-05-29 00:05:19 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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