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

Update pkispawn to verify admin cert #4951

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Conversation

edewata
Copy link
Contributor

@edewata edewata commented Feb 5, 2025

The pki nss-cert-verify has been added to verify that a cert is issued by a trusted CA. The cert can be provided in an NSS database, in a file, or via standard input.

The PKITrustManager class has been moved into pki-common.jar such that it can be used by the CLI. This class is not yet officially supported so it's not necessary to provide an upgrade script.

The NSSDatabase.verify_cert() has been added to verify a cert using pki nss-cert-verify.

The PKIDeployer.import_system_certs() and setup_admin_cert() have been modified to verify the admin cert provided during installation.

The test for installing CA with existing certs has been updated to install the CA with a self-signed admin cert (which should fail), then install it again with a CA-signed cert (which should work).

https://github.com/edewata/pki/blob/install/docs/changes/v11.6.0/API-Changes.adoc
https://github.com/edewata/pki/blob/install/docs/changes/v11.6.0/Packaging-Changes.adoc

@edewata edewata requested a review from fmarco76 February 5, 2025 04:25
Copy link
Member

@fmarco76 fmarco76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall changes look good but there are several failing CI related to this. Installation of subsystems with external certificates cannot validate them although they are released from the CA.

@edewata
Copy link
Contributor Author

edewata commented Feb 5, 2025

Hmm.. let me take a look.

@edewata edewata marked this pull request as draft February 5, 2025 15:12
The pki nss-cert-verify has been added to verify that a cert
is issued by a trusted CA. The cert can be provided in an NSS
database, in a file, or via standard input.

The PKITrustManager class has been moved into pki-common.jar
such that it can be used by the CLI. This class is not yet
officially supported so it's not necessary to provide an
upgrade script.

The NSSDatabase.verify_cert() has been added to verify a cert
using pki nss-cert-verify.

The PKIDeployer.import_system_certs() and setup_admin_cert()
have been modified to verify the admin cert provided during
installation.

The test for installing CA with existing certs has been updated
to install the CA with a self-signed admin cert (which should
fail), then install it again with a CA-signed cert (which should
work).
@edewata
Copy link
Contributor Author

edewata commented Feb 5, 2025

@fmarco76 I've updated the code to verify the admin cert after importing the cert chain so it should work now. Please see the updated PR. Thanks!

@edewata edewata marked this pull request as ready for review February 5, 2025 18:11
# Import admin cert after importing the cert chain so that
# it can be verified.

if subsystem.name in ['kra', 'ocsp']:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not sure why in the original code the admin cert import was only done for KRA & OCSP and not for TKS & TPS. It's possible that this code is actually redundant since the same tests for TKS & TPS seem to be working just fine without it. We can clean it up separately later.

Copy link
Member

@fmarco76 fmarco76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@edewata
Copy link
Contributor Author

edewata commented Feb 5, 2025

@fmarco76 Thanks!

@edewata edewata merged commit cd0daf6 into dogtagpki:master Feb 5, 2025
168 of 174 checks passed
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 this pull request may close these issues.

2 participants