Bug 1900383 - SELinux is preventing rpmdb from 'connectto' accesses on the unix_stream_socket /var/lib/sss/pipes/nss.
Summary: SELinux is preventing rpmdb from 'connectto' accesses on the unix_stream_sock...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 33
Hardware: x86_64
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:a0a988144008e6823e5293f1b49...
: 1900386 1900388 1900389 1900390 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-22 17:26 UTC by Pasquale Iannuzzi
Modified: 2021-11-30 18:10 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-11-30 18:10:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Pasquale Iannuzzi 2020-11-22 17:26:51 UTC
Description of problem:
SELinux is preventing rpmdb from 'connectto' accesses on the unix_stream_socket /var/lib/sss/pipes/nss.

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

Se ci credi rpmdb dovrebbe essere consentito connectto accesso al nss unix_stream_socket per impostazione predefinita.
Then si dovrebbe riportare il problema come bug.
E' possibile generare un modulo di politica locale per consentire questo accesso.
Do
consentire questo accesso per ora eseguendo: # ausearch -c 'rpmdb'--raw | audit2allow -M my-$MODULE_NOME # semodule -X 300 -i miei-rpmdb.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:rpmdb_t:s0-s0:c0.c1023
Target Context                system_u:system_r:sssd_t:s0
Target Objects                /var/lib/sss/pipes/nss [ unix_stream_socket ]
Source                        rpmdb
Source Path                   rpmdb
Port                          <Sconosciuto>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-3.14.6-30.fc33.noarch
Local Policy RPM              selinux-policy-targeted-3.14.6-30.fc33.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 5.9.8-200.fc33.x86_64 #1 SMP Tue
                              Nov 10 21:58:19 UTC 2020 x86_64 x86_64
Alert Count                   1
First Seen                    2020-11-22 18:11:39 CET
Last Seen                     2020-11-22 18:11:39 CET
Local ID                      d991a19b-e508-4483-b1a7-e3b45ec471b2

Raw Audit Messages
type=AVC msg=audit(1606065099.545:905): avc:  denied  { connectto } for  pid=17254 comm="rpmdb" path="/var/lib/sss/pipes/nss" scontext=unconfined_u:unconfined_r:rpmdb_t:s0-s0:c0.c1023 tcontext=system_u:system_r:sssd_t:s0 tclass=unix_stream_socket permissive=1


Hash: rpmdb,rpmdb_t,sssd_t,unix_stream_socket,connectto

Version-Release number of selected component:
selinux-policy-targeted-3.14.6-30.fc33.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.14.0
hashmarkername: setroubleshoot
kernel:         5.9.8-200.fc33.x86_64
type:           libreport

Comment 1 Milos Malik 2020-11-23 13:06:39 UTC
This SELinux denial is already mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=1899548#c2

Comment 2 Zdenek Pytela 2020-11-23 19:25:19 UTC
*** Bug 1900386 has been marked as a duplicate of this bug. ***

Comment 3 Zdenek Pytela 2020-11-23 19:25:34 UTC
*** Bug 1900388 has been marked as a duplicate of this bug. ***

Comment 4 Zdenek Pytela 2020-11-23 19:25:44 UTC
*** Bug 1900389 has been marked as a duplicate of this bug. ***

Comment 5 Zdenek Pytela 2020-11-23 19:25:54 UTC
*** Bug 1900390 has been marked as a duplicate of this bug. ***

Comment 6 Zdenek Pytela 2020-11-23 19:30:23 UTC
This is the list of requested permisisons from duplicates:

allow rpmdb_t sssd_public_t:file map;
allow rpmdb_t sssd_public_t:file { getattr open };
allow rpmdb_t sssd_t:unix_stream_socket connectto;
allow rpmdb_t sssd_var_lib_t:sock_file write;

All of them were gathered in SELinux permissive mode. Have you noticed either an AVC denial or any problem in enforcing mode?

Personal note: we would need to use
sssd_dontaudit_stream_connect()
sssd_dontaudit_read_public_files()
and create
sssd_dontaudit_map_public_files()

Comment 7 Ondrej Mosnacek 2020-11-23 19:58:35 UTC
(In reply to Zdenek Pytela from comment #6)
> Personal note: we would need to use
> sssd_dontaudit_stream_connect()
> sssd_dontaudit_read_public_files()
> and create
> sssd_dontaudit_map_public_files()

Why do you want to dontaudit them? The sssd_dontaudit_read_public_files() is currently not used at all, while there are many domains that are granted the read perms to sssd_public_t. It doesn't seem right to break the norm.

Comment 8 Zdenek Pytela 2020-11-23 20:03:05 UTC
> (In reply to Zdenek Pytela from comment #6)
> > Personal note: we would need to use
> > sssd_dontaudit_stream_connect()
> > sssd_dontaudit_read_public_files()
> > and create
> > sssd_dontaudit_map_public_files()
> 
> Why do you want to dontaudit them? The sssd_dontaudit_read_public_files() is
> currently not used at all, while there are many domains that are granted the
> read perms to sssd_public_t. It doesn't seem right to break the norm.
Panu elaborated on that in https://bugzilla.redhat.com/show_bug.cgi?id=1461313#c73

But I agree in general we should try to avoid dontaudit rules.

Comment 9 Ondrej Mosnacek 2020-11-23 20:09:12 UTC
(In reply to Zdenek Pytela from comment #8)
> Panu elaborated on that in
> https://bugzilla.redhat.com/show_bug.cgi?id=1461313#c73

I see... That's indeed a good reason why it should/could be just dontaudit in this case. Thanks for the clarification!

Comment 10 Pasquale Iannuzzi 2020-12-30 11:13:27 UTC
(In reply to Zdenek Pytela from comment #6)

> All of them were gathered in SELinux permissive mode. Have you noticed
> either an AVC denial or any problem in enforcing mode?

I never use SELinux in enforced mode but, beyond that, I honestly wouldn't even know how to replicate the bug.

Comment 11 Ben Cotton 2021-11-04 14:59:37 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
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 '33'.

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 33 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 12 Ben Cotton 2021-11-04 15:58:13 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
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 '33'.

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 33 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 13 Ben Cotton 2021-11-30 18:10:01 UTC
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 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.