URL: https://github.com/freeipa/freeipa/pull/4977 Author: rcritten Title: #4977: [Backport][ipa-4-6] CAless installation: set the perms on KDC cert file Action: opened
PR body: """ This PR was opened automatically because PR #4974 was pushed to master and backport to ipa-4-6 is required. """ To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/4977/head:pr4977 git checkout pr4977
From f1699182df1776dc64d2c05260337dcb782fddde Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud <f...@redhat.com> Date: Mon, 3 Aug 2020 18:52:07 +0200 Subject: [PATCH 1/2] CAless installation: set the perms on KDC cert file In CA less installation, the KDC certificate file does not have the expected 644 permissions. As a consequence, WebUI login fails. The fix makes sure that the KDC cert file is saved with 644 perms. Fixes: https://pagure.io/freeipa/issue/8440 --- ipaserver/install/krbinstance.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ipaserver/install/krbinstance.py b/ipaserver/install/krbinstance.py index a666c0918a..3aede9016e 100644 --- a/ipaserver/install/krbinstance.py +++ b/ipaserver/install/krbinstance.py @@ -527,6 +527,8 @@ def install_external_pkinit_certs(self): certs.install_pem_from_p12(self.pkcs12_info[0], self.pkcs12_info[1], paths.KDC_CERT) + # The KDC cert needs to be readable by everyone + os.chmod(paths.KDC_CERT, 0o644) certs.install_key_from_p12(self.pkcs12_info[0], self.pkcs12_info[1], paths.KDC_KEY) From 081e16710c136c00e77669b9100fccc4944bba20 Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud <f...@redhat.com> Date: Mon, 3 Aug 2020 18:53:47 +0200 Subject: [PATCH 2/2] ipatests: check KDC cert permissions in CA less install The KDC certificate file must be stored with 644 permissions. Add a test checking the file permissions on server + replica. Related: https://pagure.io/freeipa/issue/8440 --- ipatests/test_integration/test_caless.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ipatests/test_integration/test_caless.py b/ipatests/test_integration/test_caless.py index 529611b183..fc38b807d3 100644 --- a/ipatests/test_integration/test_caless.py +++ b/ipatests/test_integration/test_caless.py @@ -1564,6 +1564,13 @@ def test_anon_pkinit_with_external_CA(self): assert result.returncode == 0 +def verify_kdc_cert_perms(host): + """Verify that the KDC cert pem file has 0644 perms""" + cmd = host.run_command(['stat', '-c', + '"%a %G:%U"', paths.KDC_CERT]) + assert "644 root:root" in cmd.stdout_text + + class TestPKINIT(CALessBase): """Install master and replica with PKINIT""" num_replicas = 1 @@ -1577,6 +1584,7 @@ def install(cls, mh): result = cls.install_server(pkinit_pkcs12_exists=True, pkinit_pin=_DEFAULT) assert result.returncode == 0 + verify_kdc_cert_perms(cls.master) @replica_install_teardown def test_server_replica_install_pkinit(self): @@ -1586,6 +1594,7 @@ def test_server_replica_install_pkinit(self): pkinit_pin=_DEFAULT) assert result.returncode == 0 self.verify_installation() + verify_kdc_cert_perms(self.replicas[0]) class TestServerReplicaCALessToCAFull(CALessBase):
_______________________________________________ FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org