Skip to content

Conversation

@sanchezl
Copy link
Contributor

@sanchezl sanchezl commented Oct 28, 2025

Summary

This enhancement introduces the ability to configure cryptographic parameters (key algorithm, key size, and elliptic curves) for certificates and keys generated internally by OpenShift components.

Motivation

Enterprise customers increasingly face stringent security compliance requirements that mandate specific cryptographic parameters for PKI infrastructure. Currently, OpenShift uses hardcoded defaults (primarily RSA 2048-bit keys) with no mechanism for administrators to adjust these parameters to meet organizational security requirements or compliance mandates.

Key Features

  • New cluster-level PKI configuration resource in config.openshift.io/v1alpha1
  • Support for RSA (2048, 3072, 4096) and ECDSA (P-256, P-384, P-521) algorithms
  • Configuration at multiple granularity levels: global defaults, certificate categories (signer, serving, client), and specific named certificates
  • Day-1 (installer) support for signer certificate configuration
  • Day-2 (operator-driven) support for all certificate types
  • Metrics and observability for certificate generation and compliance
  • Backward compatible: clusters continue using existing defaults if not configured

Proposal Details

The enhancement includes:

  • New PKI CRD in config.openshift.io/v1alpha1 API group
  • ConfigurablePKI feature gate for controlled rollout
  • Limited Day-1 configuration support via installer for long-lived signer certificates
  • Individual operator integration for Day-2 certificate rotation
  • Comprehensive validation, metrics, and support procedures

Tracking

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 28, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 28, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 28, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign shawn-hurley for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sanchezl sanchezl force-pushed the custom-pki branch 3 times, most recently from d51e417 to 1df538d Compare October 29, 2025 13:55
@sanchezl sanchezl changed the title Enhancement: Configurable PKI for OpenShift Internal Certificates CNTRLPLANE-1750: Configurable PKI for OpenShift Internal Certificates Oct 29, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 29, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 29, 2025

@sanchezl: This pull request references CNTRLPLANE-1750 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.21.0" version, but no target version was set.

Details

In response to this:

Summary

This enhancement introduces the ability to configure cryptographic parameters (key algorithm, key size, and elliptic curves) for certificates and keys generated internally by OpenShift components.

Motivation

Enterprise customers increasingly face stringent security compliance requirements that mandate specific cryptographic parameters for PKI infrastructure. Currently, OpenShift uses hardcoded defaults (primarily RSA 2048-bit keys) with no mechanism for administrators to adjust these parameters to meet organizational security requirements or compliance mandates.

Key Features

  • New cluster-level PKI configuration resource in config.openshift.io/v1alpha1
  • Support for RSA (2048, 3072, 4096) and ECDSA (P-256, P-384, P-521) algorithms
  • Configuration at multiple granularity levels: global defaults, certificate categories (signer, serving, client), and specific named certificates
  • Day-1 (installer) support for signer certificate configuration
  • Day-2 (operator-driven) support for all certificate types
  • Metrics and observability for certificate generation and compliance
  • Backward compatible: clusters continue using existing defaults if not configured

Proposal Details

The enhancement includes:

  • New PKI CRD in config.openshift.io/v1alpha1 API group
  • ConfigurablePKI feature gate for controlled rollout
  • Limited Day-1 configuration support via installer for long-lived signer certificates
  • Individual operator integration for Day-2 certificate rotation
  • Comprehensive validation, metrics, and support procedures

Tracking

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@sanchezl
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 29, 2025

@sanchezl: This pull request references CNTRLPLANE-1750 which is a valid jira issue.

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@sanchezl sanchezl marked this pull request as ready for review October 29, 2025 14:47
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 29, 2025
@openshift-ci openshift-ci bot requested review from ingvagabund and stleerh October 29, 2025 14:47
@sanchezl sanchezl changed the title CNTRLPLANE-1750: Configurable PKI for OpenShift Internal Certificates Configurable PKI for OpenShift Internal Certificates Oct 29, 2025
@openshift-ci-robot openshift-ci-robot removed the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 29, 2025
@openshift-ci-robot
Copy link

@sanchezl: No Jira issue is referenced in the title of this pull request.
To reference a jira issue, add 'XYZ-NNN:' to the title of this pull request and request another refresh with /jira refresh.

Details

In response to this:

Summary

This enhancement introduces the ability to configure cryptographic parameters (key algorithm, key size, and elliptic curves) for certificates and keys generated internally by OpenShift components.

Motivation

Enterprise customers increasingly face stringent security compliance requirements that mandate specific cryptographic parameters for PKI infrastructure. Currently, OpenShift uses hardcoded defaults (primarily RSA 2048-bit keys) with no mechanism for administrators to adjust these parameters to meet organizational security requirements or compliance mandates.

Key Features

  • New cluster-level PKI configuration resource in config.openshift.io/v1alpha1
  • Support for RSA (2048, 3072, 4096) and ECDSA (P-256, P-384, P-521) algorithms
  • Configuration at multiple granularity levels: global defaults, certificate categories (signer, serving, client), and specific named certificates
  • Day-1 (installer) support for signer certificate configuration
  • Day-2 (operator-driven) support for all certificate types
  • Metrics and observability for certificate generation and compliance
  • Backward compatible: clusters continue using existing defaults if not configured

Proposal Details

The enhancement includes:

  • New PKI CRD in config.openshift.io/v1alpha1 API group
  • ConfigurablePKI feature gate for controlled rollout
  • Limited Day-1 configuration support via installer for long-lived signer certificates
  • Individual operator integration for Day-2 certificate rotation
  • Comprehensive validation, metrics, and support procedures

Tracking

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@sanchezl sanchezl changed the title Configurable PKI for OpenShift Internal Certificates CNTRLPLANE-1751: Configurable PKI for OpenShift Internal Certificates Oct 29, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 29, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 29, 2025

@sanchezl: This pull request references CNTRLPLANE-1751 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.21.0" version, but no target version was set.

Details

In response to this:

Summary

This enhancement introduces the ability to configure cryptographic parameters (key algorithm, key size, and elliptic curves) for certificates and keys generated internally by OpenShift components.

Motivation

Enterprise customers increasingly face stringent security compliance requirements that mandate specific cryptographic parameters for PKI infrastructure. Currently, OpenShift uses hardcoded defaults (primarily RSA 2048-bit keys) with no mechanism for administrators to adjust these parameters to meet organizational security requirements or compliance mandates.

Key Features

  • New cluster-level PKI configuration resource in config.openshift.io/v1alpha1
  • Support for RSA (2048, 3072, 4096) and ECDSA (P-256, P-384, P-521) algorithms
  • Configuration at multiple granularity levels: global defaults, certificate categories (signer, serving, client), and specific named certificates
  • Day-1 (installer) support for signer certificate configuration
  • Day-2 (operator-driven) support for all certificate types
  • Metrics and observability for certificate generation and compliance
  • Backward compatible: clusters continue using existing defaults if not configured

Proposal Details

The enhancement includes:

  • New PKI CRD in config.openshift.io/v1alpha1 API group
  • ConfigurablePKI feature gate for controlled rollout
  • Limited Day-1 configuration support via installer for long-lived signer certificates
  • Individual operator integration for Day-2 certificate rotation
  • Comprehensive validation, metrics, and support procedures

Tracking

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

…rs and certificate overrides. Replace webhooks with in-process validation for improved performance and simplicity.
…d enforce validation rules with unions and CEL.
…atures. Add details about configuring cryptographic parameters while maintaining defaults.
…GA, and refine graduation criteria for OpenShift 4.21 release
…rified upgrade scenarios, and refined operational guidance.
@dinhxuanvu
Copy link
Member

/cc @dinhxuanvu

…rtificate names as a list for improved diffs.
…or's special behavior, future extensibility with dynamic certificate registration, and proposed validation framework.
```
- Compliance checking could be addressed in a future enhancement with a dedicated compliance-checker component if needed

## Open Questions
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure the best place to ask this, so asking here - how does this impact/interact with existing CA configuration options like https://github.com/openshift/api/blob/c2a41ea924bd8227622363c3d12f456cd2186924/config/v1/types_apiserver.go#L38-L48 ?

At a brief glance, this would be more of an override scenario (i.e prefer the configuration in the linked type) but I want to make sure I'm properly understanding that - is that accurate?

Are there any other implementations like this one that we are aware of for certificate customization of core platform components we need to take into consideration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This enhancement only affects OpenShift’s internal certificate generation, not user-provided certificates, trust anchors, TLS parameters, or external CA integration. I have added more details to the enhancement.

Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Initial pass of the API


The compatibility level is enforced through the `+openshift:compatibility-gen:level` annotation and will be validated by the API review process. The annotation will change from `level=4` to `level=1` when the API is promoted to v1.

#### PKI Resource
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note that for now I'm going to keep my review more high-level and focused on the overall structure of the API.

There are a handful of additional small things that would picked up by the linter if you created a PR with these changes against the openshift/api repo.

If you open a PR against openshift/api let me know and we can keep discussions on the API surface focused in one area moving forward.

// defaults specifies the default certificate configuration
// for all certificates unless overridden by category or specific
// certificate configuration.
// If not specified, uses platform defaults (typically RSA 2048).
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have any known defaulting behavior for core components that do not follow RSA 2048?

Comment on lines 293 to 298
// key specifies the cryptographic parameters for the certificate's key pair.
// +kubebuilder:validation:Required
Key KeyConfig `json:"key"`

// Future extensibility: fields like Lifetime, Rotation, Extensions
// can be added here without restructuring the API.
Copy link
Contributor

Choose a reason for hiding this comment

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

Because future extensibility is noted here, I think it is worth discussing how this works in general.

Adding new API fields will need to be added as optional.

Do you envision a future where this configuration option allows for setting other configuration fields but not key?

For example, in a future where rotation options are added, would it be reasonable for something like:

certificate:
  rotation: ...

to be valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great point. Updated.


// KeyConfig specifies cryptographic parameters for key generation.
//
// +kubebuilder:validation:XValidation:rule="(self.algorithm == 'RSA' && has(self.rsa) && !has(self.ecdsa)) || (self.algorithm == 'ECDSA' && has(self.ecdsa) && !has(self.rsa))",message="algorithm must match the configuration: use rsa field for RSA, ecdsa field for ECDSA"
Copy link
Contributor

Choose a reason for hiding this comment

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

The pattern we normally follow here is: https://github.com/openshift/api/blob/c2a41ea924bd8227622363c3d12f456cd2186924/example/v1/types_stable.go#L140

We will typically do one of those expressions for each discriminator-discriminant pair.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

Comment on lines +352 to +385
// +kubebuilder:validation:XValidation:rule="self.certificateName in [
// 'admin-kubeconfig-signer',
// 'kubelet-bootstrap-kubeconfig-signer',
// 'kube-apiserver-localhost-signer',
// 'kube-apiserver-service-network-signer',
// 'kube-apiserver-lb-signer',
// 'root-ca',
// 'kube-apiserver-to-kubelet-signer',
// 'kube-control-plane-signer',
// 'aggregator-signer',
// 'kubelet-signer',
// 'aggregator-ca',
// 'etcd-signer',
// 'etcd-metrics-signer',
// 'service-ca',
// 'csr-signer-ca',
// 'kube-apiserver-localhost-server',
// 'kube-apiserver-service-network-server',
// 'kube-apiserver-lb-server',
// 'kube-apiserver-internal-lb-server',
// 'machine-config-server',
// 'ironic-server',
// 'etcd-peer-server',
// 'etcd-server',
// 'etcd-metrics-server',
// 'admin-kubeconfig-client',
// 'kubelet-client',
// 'kube-apiserver-to-kubelet-client',
// 'kube-control-plane-kube-controller-manager-client',
// 'kube-control-plane-kube-scheduler-client',
// 'aggregator-client',
// 'apiserver-proxy-client',
// 'journal-gatewayd-client',
// ]",message="certificateName must be a well-known certificate name"
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is a static list that doesn't change frequently, this is probably better suited as an enum constraint.

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding to this, I've got no idea whether or not the CRD generators handle a multi-line marker like this. I suspect not.

Comment on lines 423 to 427
type PKIStatus struct {
// No status fields are currently defined. Each certificate-generating operator
// independently consumes the PKI configuration and reports status through
// its own ClusterOperator status resource.
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If there is no status associated with this resource, it is OK to not have a status struct. Just make sure you also remove the status subresource for the API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

Spec PKISpec `json:"spec"`
}

type PKISpec struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

My only concern with the current spec structure is that we have only optional fields which makes the empty value valid (i.e spec: {}) - which we generally try to avoid because it makes nothing mean something.

Reading the enhancement, it seems like this is going to be an initial resource stamped out by some cluster operator with some sort of default configuration (or one overridden by configuration via installer).

I'm wondering if it would make sense to have a required discriminated union here so that the empty spec isn't valid.

Something like:

spec:
  policy: PlatformDefaults

which signals to the platform components that there is no opinion from the end-user and they should continue using whatever their defaults are.

When an end-user wants to configure this they do something like:

spec:
  policy: Custom
  custom:
    defaults: ...
    categories: ...
    overrides: ...

I don't know that policy is the right name for the field here, but hopefully it still gets my point across.

…and update relevant documentation accordingly.
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2025

@sanchezl: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Comment on lines +350 to +354
Type PKIManagementType `json:"type"`

// Embed PKIProfile to provide reusable certificate parameter fields.
// Go API utilities can use PKIProfile to programmatically define custom profiles.
PKIProfile `json:",inline"`
Copy link
Contributor

Choose a reason for hiding this comment

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

For discriminated unions we generally encourage the use of a field whose name matches the discriminator. This allows us to expand in the future to support other values that may require configuration without causing an overlap for the fields that need to be supplied.

I'd expect this to end up looking something like:

type: Custom
custom:
  ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants