Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when the IPA is intialised with an extern CA #285

Closed
m3xiz opened this issue Mar 8, 2023 · 3 comments · Fixed by #286
Closed

error when the IPA is intialised with an extern CA #285

m3xiz opened this issue Mar 8, 2023 · 3 comments · Fixed by #286
Assignees

Comments

@m3xiz
Copy link

m3xiz commented Mar 8, 2023

At installation time, IPA provided a certificate request and this one is signed by an external CA.
The heakthcheck is producing this output:
ra.get_certificate(): Request failed with status 404: Non-2xx response from CA REST API: 404. Certificate ID 0x6596a821b68c5857 not found (404)
[
{
"source": "ipahealthcheck.dogtag.ca",
"check": "DogtagCertsConnectivityCheck",
"result": "ERROR",
"uuid": "68600eea-1f78-4628-95f2-b3a5a8a4f8db",
"when": "20230308105921Z",
"duration": "0.165748",
"kw": {
"key": "cert_show_1",
"error": "Certificate operation cannot be completed: Request failed with status 404: Non-2xx response from CA REST API: 404. Certificate ID 0x6596a821b68c5857 not found (404)",
"serial": "7320223107087358039",
"msg": "Serial number not found: {error}"
}
}
]

The missing certificate is the sub CA signed by the external CA. I believe this is not an error and this message should not be raised. The error is reproducable.

@flo-renaud
Copy link
Contributor

Hi @m3xiz
I was also able to reproduce the issue with the following packages:
dogtag-pki-base-11.2.0-2.fc37.noarch
freeipa-server-4.10.1-1.fc37.x86_64
freeipa-healthcheck-0.12-1.fc37.noarch

The code is internally calling a command equivalent to ipa cert-show <serial for IPA CA>, which ends up calling PKI rest API (GET /ca/rest/certs/<serial>) and PKI returns an error Certificate ID <serial> not found. We would need to check with PKI team if IPA CA should be visible through this call even when it's an externally-signed CA.

@rcritten
Copy link
Collaborator

It pulls the serial number of the root CA and tries to do a cert-show which will likely fail, or worse be a false positive, as the certificate doesn't exist in the local CA because it was issued externally.

I think we should just skip this check when the CA issuer doesn't match the subject, as suggested.

rcritten added a commit to rcritten/freeipa-healthcheck that referenced this issue Mar 27, 2023
The serial number of externally-signed CA's were being checked
using ipa-cert-find which invariably would return a not found
error.

Instead return SUCCESS to effectively skip the check.

Fixes: freeipa#285

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
@rcritten rcritten self-assigned this Mar 27, 2023
@rcritten
Copy link
Collaborator

#286

rcritten added a commit to rcritten/freeipa-healthcheck that referenced this issue Apr 7, 2023
The purpose of the check is to validate that communication
with the CA works. In the past we looked up serial number 1
for this check. The problem is that if the server was
installed with RSNv3 so had no predictable CA serial number.

It also was broken with externally-issued CA certificate which
cannot be looked up in IPA.

Instead use the IPA RA agent certificate which should definitely
have a serial number in the IPA CA if one is configured.

Fixes: freeipa#285

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
rcritten added a commit to rcritten/freeipa-healthcheck that referenced this issue Jul 18, 2023
The purpose of the check is to validate that communication
with the CA works. In the past we looked up serial number 1
for this check. The problem is that if the server was
installed with RSNv3 so had no predictable CA serial number.

It also was broken with externally-issued CA certificate which
cannot be looked up in IPA.

Instead use the IPA RA agent certificate which should definitely
have a serial number in the IPA CA if one is configured.

Fixes: freeipa#285

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
rcritten added a commit that referenced this issue Jul 19, 2023
The purpose of the check is to validate that communication
with the CA works. In the past we looked up serial number 1
for this check. The problem is that if the server was
installed with RSNv3 so had no predictable CA serial number.

It also was broken with externally-issued CA certificate which
cannot be looked up in IPA.

Instead use the IPA RA agent certificate which should definitely
have a serial number in the IPA CA if one is configured.

Fixes: #285

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants