Bug 2166441 - Set default context on pki kra subdirectory to match the ca subdirectory
Summary: Set default context on pki kra subdirectory to match the ca subdirectory
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 37
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-01 20:13 UTC by Rob Crittenden
Modified: 2024-01-13 16:49 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-01-12 22:38:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Rob Crittenden 2023-02-01 20:13:02 UTC
Description of problem:

Policy was added in 6065f79e001b171feff408d5a39f141c94d9284a to set the default policy of /etc/pki/pki-tomcat/ca to pki_tomcat_cert_t.

No policy was added at the time for the pki subsystem kra in /etc/pki/pki-tomcat/kra/* (probably because this is less used). It is defaulting to pki_tomcat_etc_rw_t.

certmonger, when renewing certificates, updates a pki configuration file, CS.cfg, with the updated cert values. It does not have permissions to operate on pki_tomcat_etc_rw_t so it can't write CS.cfg with the new value.

I get AVCs like:

time->Tue Jan 31 16:32:00 2023
type=AVC msg=audit(1675200720.954:6376): avc:  denied  { getattr } for  pid=326582 comm="renew_ca_cert" path="/etc/pki/pki-tomcat/kra/CS.cfg" dev="dm-0" ino=34013220 scontext=system_u:system_r:certmonger_t:s0 tcontext=unconfined_u:object_r:pki_tomcat_etc_rw_t:s0 tclass=file permissive=0

It would make sense to me if the two subsystem directories had the same policy applied. This should allow certmonger to manage the files.

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

selinux-policy-37.18-1.fc37.noarch

Steps to Reproduce:

I can help you install an IPA server + KRA if you want, but the fix looks pretty straightforward.

Comment 1 Aoife Moloney 2023-11-23 01:10:15 UTC
This message is a reminder that Fedora Linux 37 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 37 on 2023-12-05.
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
'version' of '37'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 37 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 Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 2 Aoife Moloney 2024-01-12 22:38:53 UTC
Fedora Linux 37 entered end-of-life (EOL) status on 2023-12-05.

Fedora Linux 37 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 Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

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

Comment 3 Sam Morris 2024-01-13 15:07:36 UTC
$ rpm -q selinux-policy
selinux-policy-39.3-1.fc39.noarch

$ matchpathcon /etc/pki/pki-tomcat/kra
/etc/pki/pki-tomcat/kra	system_u:object_r:pki_tomcat_etc_rw_t:s0

Comment 4 Rob Crittenden 2024-01-13 16:49:03 UTC
It will be a moot point when dogtag has their next release (11.5.0) because they will no longer write certificate blobs to CS.cfg. This was the reason that certmonger needed write capabilities: to update the blob during renewals.


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