On a CA-ful installation /etc/ipa/ca.crt has mode 0644. On a CA-less installation it is 0444.
This inconsistency raises a false positive for freeipa-healthcheck.
In a CA-less environment the CA certificate is created at https://pagure.io/freeipa/blob/master/f/ipaserver/install/server/install.py#_909 prior to DS installation but then overwritten at the end of init_from_pkcs12 in export_ca_cert https://pagure.io/freeipa/blob/master/f/ipaserver/install/certs.py#_325 The original creation is probably not necessary at all. The cert is created in both cases 0444.
In a CA-ful environment the CA certificate is created by the pkispawn as 0644.
I don't have strong feelings either way which one is correct. The file is owned by root so the write mode is a no-op. I'm inclined to make it 0644 since there are more existing CA-ful installations.
It is TBD whether the initial creation is needed or not. If it isn't needed then those lines should be removed.
I don't see a need for an upgrader to fix existing perms. It is just a warning from healthcheck in any case.
Even root needs DAC_OVERRIDE capability to write to a 0o444 file. The capability may not be available in restricted environments (SELinux, container). Please give the file 0o644.
Metadata Update from @rcritten: - Issue assigned to rcritten
https://github.com/freeipa/freeipa/pull/4989
master:
ipa-4-8:
Metadata Update from @rcritten: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
Metadata Update from @frenaud: - Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1870202
Issue linked to Bugzilla: Bug 1870202