#2421 Incorrect SELinux contexts
Closed: migrated by dmoluguw. Opened by edewata.

Some files in the PKI instance folder were assigned incorrect SELinux contexts (e.g. unconfined_u instead of system_u), possibly because they were created after the SELinux contexts were set up.

For example:

$ ls -lZ /etc/pki/pki-tomcat/Catalina/localhost/
...
-rw-rw----. 1 pkiuser pkiuser unconfined_u:object_r:pki_tomcat_etc_rw_t:s0 1379 Jul 27 13:40 ca.xml
...

A possible solution is to move the execution of the selinux_setup deployment scriptlet after all instance files are created, i.e. after security_databases scriptlet.

An upgrade script needs to be written to fix existing instances.


Fixed in master:

  • ba1e18ba4c9c47930efa0cdfc46fe326f71d3cd4

The upgrade script has been removed temporarily due to a problem reported in ticket #2452.

Per CS/DS meeting of 09/12/2016:

  • Needs more investigation. Difficult to reproduce (requires F23->24 upgrade?).

Does the restorecon command work properly during upgrade? We can run restorecon with the subprocess module:

subprocess.check_call(['/usr/bin/restorecon', '-R', '-F', '-v', instance.base_dir])

After a lengthy conversation on IRC on 09/15/2016, I have decided to move this ticket to 10.4.0 until such time as we can devise some sort of reproducer such that an SELinux bug may be filed.

Also discussed, another solution is to execute the upgrade scriptlets during PKI server restart instead of during RPM upgrade where presumably the SELinux tools will run successfully.

As noted in comment #10, this will be addressed in 10.4 by fixing the upgrade tool to run during server restart.

Metadata Update from @edewata:
- Issue assigned to edewata
- Issue set to the milestone: UNTRIAGED

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/2541

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Metadata Update from @dmoluguw:
- Issue close_status updated to: migrated
- Issue status updated to: Closed (was: Open)

Metadata