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

webhook: validate certificateRefs when tls is set and mode is Terminate #1441

Closed
mlavacca opened this issue Oct 7, 2022 · 1 comment · Fixed by #1460
Closed

webhook: validate certificateRefs when tls is set and mode is Terminate #1441

mlavacca opened this issue Oct 7, 2022 · 1 comment · Fixed by #1460
Assignees
Labels
area/webhook kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@mlavacca
Copy link
Member

mlavacca commented Oct 7, 2022

What would you like to be added:

The TLSModeType documentation states:

// Mode defines the TLS behavior for the TLS session initiated by the client.
// There are two possible modes:
//
// - Terminate: The TLS session between the downstream client
// and the Gateway is terminated at the Gateway. This mode requires
// certificateRefs to be set and contain at least one element.
// - Passthrough: The TLS session is NOT terminated by the Gateway. This
// implies that the Gateway can't decipher the TLS stream except for
// the ClientHello message of the TLS protocol.
// CertificateRefs field is ignored in this mode.
//
// Support: Core
//
// +optional
// +kubebuilder:default=Terminate
Mode *TLSModeType `json:"mode,omitempty"`

In particular, when the TLSConfig is set, and the TLSModeType is terminate, the certificateRefs field must always be set and contain at least one reference to an object.
To ensure this condition, the Gateway validation should be improved to ensure that such a condition is always verified.

Why this is needed:

When the TLSModeType is set to terminate, there is always the need for a valid certificate to terminate the TLS connection.

@mlavacca mlavacca added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 7, 2022
@shaneutt shaneutt added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. area/webhook labels Oct 7, 2022
@shaneutt shaneutt added this to the v0.7.0 milestone Oct 7, 2022
@gyohuangxin
Copy link
Member

I'd like to implement it.
/assign

@shaneutt shaneutt removed the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Oct 14, 2022
@shaneutt shaneutt modified the milestones: v0.7.0, v0.6.0 Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/webhook kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants