-
Notifications
You must be signed in to change notification settings - Fork 587
Add TLS adherance feature gate #2680
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
base: master
Are you sure you want to change the base?
Changes from all commits
c7aecd0
ccf214d
1716f59
f2b7f8a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -62,6 +62,35 @@ type APIServerSpec struct { | |||||||||||||||||||||||||||||||||||||||||
| // The current default is the Intermediate profile. | ||||||||||||||||||||||||||||||||||||||||||
| // +optional | ||||||||||||||||||||||||||||||||||||||||||
| TLSSecurityProfile *TLSSecurityProfile `json:"tlsSecurityProfile,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||
| // tlsAdherence controls which components in the cluster adhere to the TLS security profile | ||||||||||||||||||||||||||||||||||||||||||
| // configured on this APIServer resource. | ||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||
| // Valid values are "LegacyExternalAPIServerComponentsOnly" and "StrictAllComponents". | ||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||
| // When set to "LegacyExternalAPIServerComponentsOnly", only the externally exposed | ||||||||||||||||||||||||||||||||||||||||||
| // API server components (kube-apiserver, openshift-apiserver, oauth-apiserver) honor the configured | ||||||||||||||||||||||||||||||||||||||||||
| // TLS profile. Other components continue to use their individual TLS configurations. | ||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||
| // When set to "StrictAllComponents", all components must honor the configured TLS profile. | ||||||||||||||||||||||||||||||||||||||||||
| // This mode is recommended for security-conscious deployments and is required for | ||||||||||||||||||||||||||||||||||||||||||
| // certain compliance frameworks. | ||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||
| // Note: The Kubelet and IngressController components are excluded from tlsAdherence control | ||||||||||||||||||||||||||||||||||||||||||
| // as they have their own dedicated TLS configuration mechanisms via KubeletConfig and | ||||||||||||||||||||||||||||||||||||||||||
| // IngressController CRs respectively. | ||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||
| // Components that encounter an unknown value for tlsAdherence should treat it as "StrictAllComponents" | ||||||||||||||||||||||||||||||||||||||||||
| // and log a warning to ensure forward compatibility while defaulting to the more secure behavior. | ||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||
| // This field is optional. When omitted, it is interpreted as "no opinion" and the cluster | ||||||||||||||||||||||||||||||||||||||||||
| // defaults to LegacyExternalAPIServerComponentsOnly behavior. Future versions of OpenShift | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+85
to
+86
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have some standard terminology we like to use here for consistency. As an example: api/config/v1/types_network.go Lines 244 to 246 in 6186972
We should follow this convention as well so we aren't locked into a contractual default in case we want to do something like change the default behavior to |
||||||||||||||||||||||||||||||||||||||||||
| // may require explicitly setting this field to "StrictAllComponents" before upgrading. | ||||||||||||||||||||||||||||||||||||||||||
| // Administrators are encouraged to migrate to "StrictAllComponents" proactively. | ||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||
| // Once set, this field may be changed to a different value. | ||||||||||||||||||||||||||||||||||||||||||
| // +openshift:enable:FeatureGate=TLSAdherence | ||||||||||||||||||||||||||||||||||||||||||
| // +optional | ||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to configure validation on this field, and set the default.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see you are defining the Enum validation on the type, which is fine. Let's also include the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, reading the tlsAdherence description again, it seems like you are wanting it to be possible for an empty string to be allowed to be persisted for this field in etcd, which would allow us in theory to change the default semantic later in the future from legacy to strict without a change in the actual tlsAdherence value. In practice, I think the problem with that idea is that each component essentially has their own implementation of this API and we'd have to do a really good job coordinating a semantic switch from legacy to strict. What do folks think about:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For configuration APIs we generally try to avoid setting the default via In this case, I don't think we will be doing that but I still wouldn't use the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks, I was hoping you'd have some good advice here. It is the intent to eventually make all components honor the cluster-wide default, so I supposed we'll just have to deal with trying to coordinate a semantic change across a bunch of components at once when the time comes. To facilitate that, I'd suggest a library-go function somehow like this: // in configv1
const TLSAdherenceNoOpinion = ""func ShouldAllComponentsAdhere(tlsAdherence configv1.TLSAdherence) bool {
if tlsAdherence == configv1.TLSAdherenceNoOpinion || tlsAdherence == configv1.LegacyExternalAPIServerComponentsOnly {
return false
}
return true
}And then when we want to change the semantic, we'd update that function to: func ShouldAllComponentsAdhere(tlsAdherence configv1.TLSAdherence) bool {
if tlsAdherence == configv1.LegacyExternalAPIServerComponentsOnly {
return false
}
return true
} |
||||||||||||||||||||||||||||||||||||||||||
| TLSAdherence TLSAdherencePolicy `json:"tlsAdherence,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||
| // audit specifies the settings for audit configuration to be applied to all OpenShift-provided | ||||||||||||||||||||||||||||||||||||||||||
| // API servers in the cluster. | ||||||||||||||||||||||||||||||||||||||||||
| // +optional | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -237,6 +266,23 @@ const ( | |||||||||||||||||||||||||||||||||||||||||
| type APIServerStatus struct { | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| // TLSAdherencePolicy defines which components adhere to the TLS security profile. | ||||||||||||||||||||||||||||||||||||||||||
| // +kubebuilder:validation:Enum=LegacyExternalAPIServerComponentsOnly;StrictAllComponents | ||||||||||||||||||||||||||||||||||||||||||
| type TLSAdherencePolicy string | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| const ( | ||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a constant for |
||||||||||||||||||||||||||||||||||||||||||
| // TLSAdherenceLegacyExternalAPIServerComponentsOnly means only the externally exposed | ||||||||||||||||||||||||||||||||||||||||||
| // API server components (kube-apiserver, openshift-apiserver, oauth-apiserver) honor | ||||||||||||||||||||||||||||||||||||||||||
| // the configured TLS profile. Other components continue to use their individual TLS | ||||||||||||||||||||||||||||||||||||||||||
| // configurations. | ||||||||||||||||||||||||||||||||||||||||||
| TLSAdherenceLegacyExternalAPIServerComponentsOnly TLSAdherencePolicy = "LegacyExternalAPIServerComponentsOnly" | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| // TLSAdherenceStrictAllComponents means all components must honor the configured TLS | ||||||||||||||||||||||||||||||||||||||||||
| // profile. This mode is recommended for security-conscious deployments and is required | ||||||||||||||||||||||||||||||||||||||||||
| // for certain compliance frameworks. | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+280
to
+282
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should include a note here (and in the |
||||||||||||||||||||||||||||||||||||||||||
| TLSAdherenceStrictAllComponents TLSAdherencePolicy = "StrictAllComponents" | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+274
to
+283
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we settle on this in the EP, we should update this.
My current expectation is that this isn't an exclusion but rather a preference scenario where, if specified, the Kubelet / Ingress Controller components will be configured with what is specified in their existing APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that makes sense. It positions
apiserveras the truly cluster-wide default. And it is still aligned with the fact that other components may have their own special configuration knobs that override the default.