Bug 2023163 - SELinux denies rpmdb access to /root/.rpmmacros
Summary: SELinux denies rpmdb access to /root/.rpmmacros
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 35
Hardware: x86_64
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-15 04:32 UTC by Mikel Pérez
Modified: 2022-04-11 12:47 UTC (History)
9 users (show)

Fixed In Version: selinux-policy-35.6-1.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-04 01:23:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Mikel Pérez 2021-11-15 04:32:36 UTC
Description of problem:
SELinux denies access of /root/.rpmmacros to rpmdb

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

How reproducible:
always

Steps to Reproduce:
1. sudo rpm --rebuilddb

Actual results:
probably it does redo the database but throws off a selinux alert

Expected results:
just redo the database

Additional info:
I did restorecon -Rv /root and no file was mislabeled

this is on the journal:

SELinux is preventing rpmdb from open access on the file /root/.rpmmacros.
                                             
                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                             
                                             If you believe that rpmdb should be allowed open access on the .rpmmacros 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 'rpmdb' --raw | audit2allow -M my-rpmdb
                                             # semodule -X 300 -i my-rpmdb.pp

Comment 1 Zdenek Pytela 2021-11-15 12:24:33 UTC
Mikel,

This denial does not pop up on my system with rpm-4.17.0-1.fc35.x86_64. Are there any additional conditions needed?

I'd like to see audit logs:

ausearch -i -m avc,user_avc -ts today

and if the following module is sufficient:

  # cat local_rpmdb_rpmmacros.cil
(allow rpmdb_t non_security_file_type (file (open)))

  # semodule -i local_rpmdb_rpmmacros.cil

Comment 2 Fedora Update System 2021-11-29 16:03:30 UTC
FEDORA-2021-ea3fa543f0 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-ea3fa543f0

Comment 3 Fedora Update System 2021-11-30 02:19:06 UTC
FEDORA-2021-ea3fa543f0 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-ea3fa543f0`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-ea3fa543f0

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2021-12-04 01:23:40 UTC
FEDORA-2021-ea3fa543f0 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 5 Mikel Pérez 2022-04-11 12:47:48 UTC
it is working now. (clearing myself of needinfo)


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