Reported on the mailing list:
$ getcert request -f ${CERT_FILE} -k ${KEY_FILE} -D $(hostname --fqdn) -C \
"sed -n w/etc/cockpit/ws-certs.d/50-from-certmonger.cert ${CERT_FILE} \
${KEY_FILE}"
reportedly failed with
type=AVC msg=audit(1633548839.586:8895): avc: denied { create } for
pid=836449 comm="sed" name="50-from-certmonger.cert"
scontext=system_u:
system_r:certmonger_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=file permissive=0
/etc/cockpit/ws-certs.d should be certs_t instead of etc_t to make this work.
Let's fix the documentation at least, but possibly also the default permissions of the certs dir. We don't test this in CI, let's add a test to make sure this keeps working.
After that, the file permissions need updating so that cockpit-ws can read that. This is a separate issue though, we should generally stop relying on file perms and just copy the cert to /run in a pre-start command.
Reported on the mailing list:
reportedly failed with
/etc/cockpit/ws-certs.d should be
certs_tinstead ofetc_tto make this work.Let's fix the documentation at least, but possibly also the default permissions of the certs dir. We don't test this in CI, let's add a test to make sure this keeps working.
After that, the file permissions need updating so that cockpit-ws can read that. This is a separate issue though, we should generally stop relying on file perms and just copy the cert to /run in a pre-start command.