-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement mutual TLS authentication support for Ingress #3532
Conversation
Hi @shraddhabang. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
/ok-to-test |
/retest |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3532 +/- ##
==========================================
- Coverage 55.75% 55.11% -0.64%
==========================================
Files 149 149
Lines 8843 8979 +136
==========================================
+ Hits 4930 4949 +19
- Misses 3579 3691 +112
- Partials 334 339 +5 ☔ View full report in Codecov by Sentry. |
pkg/ingress/model_build_listener.go
Outdated
if exists := t.annotationParser.ParseStringAnnotation(annotations.IngressSuffixMutualAuthentication, &rawMtlsConfigString, ing.Ing.Annotations); !exists { | ||
if !fromIngressClassParams { | ||
return map[int64]*elbv2model.MutualAuthenticationAttributes{443: { | ||
Mode: string(elbv2model.MutualAuthenticationOffMode), |
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.
What if the users do not have port 443 in the listeners (like they have port 8080), and neither do they specify the mtls setting?
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.
also need to call out the default mtls in the ingress annotation and ingress class param doc.
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.
This will be ignored then while building the Listener SDK request since we only map the port and their respective setting in mTLS.
/retest |
/retest |
1 similar comment
/retest |
@@ -107,6 +109,10 @@ type IngressClassParamsSpec struct { | |||
// +optional | |||
SSLPolicy string `json:"sslPolicy,omitEmpty"` | |||
|
|||
// MutualAuthentication specifies the mutual TLS authentication config for all Ingresses that belong to IngressClass with this IngressClassParams. | |||
// +optional | |||
MutualAuthentication *MutualAuthentication `json:"mutualAuthentication,omitempty"` |
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.
type MutualAuthentication struct {
Mode ...
TrustStoreArn...
}
type IngressClassParamsSpec struct {
....
// MutualAuthentication specifies the mutual TLS authentication config for all Ingresses that belong to IngressClass with this IngressClassParams.
// +optional
MutualAuthentication *MutualAuthentication `json:"mutualAuthentication,omitempty"`
}
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.
As discussed, removed the support for IngressClassParam from this release. We will add a documentation update which will specify that warning to use mTLS config on IngressGroups. Thanks for the review.
We will add the IngressClassParam support for mTLS in follow up patch release.
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: M00nF1sh, shraddhabang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…igs#3532) * Implement mutual TLS authentication support for Ingress * Addressing comments and adding policy updates * Adding dependency for maps * removing ingressClassParam support
Issue
#3499
Description
Support for (mTLS) Mutual Transport Layer Security on Ingress through AWS LB Controller
This PR adds the support for mutual TLS authentication support for Ingress. Its delivers mTLS feature by integrating the Trust Stores into listener management. The customer will be able to set the mTLS mode and will be able to provide the existing Trust Store Name/ARN (they have created through CLI/Console) through new annotations for Ingress.
New Ingress Annotation
Example
We will identify the HTTPS listener based on its port and set the specified the mTLS configuration. So in the above example, we specified four HTTPS listeners with ports 80, 443, 8080, 8443. As per the annotation, the listener HTTPS:80 will be set to "passthrough” mode, the listener HTTPS:443 will be set to “verify” mode and will be associated with the provided trust-store-arn “arn:aws:elasticloadbalancing:trustStoreArn”. The remaining listeners HTTPS:8080 and HTTPS:8443 will be set to default mTLS mode i.e “off”.
New load balancer attributes for enabling connection logs for Ingresses and IngressGroup
We are also adding the support for connection logs support similar to what we support for access logs today for ALB.
Example on Ingress annotation
Example on IngressClassParams specification
More : https://docs.aws.amazon.com/elasticloadbalancing/latest/application/mutual-authentication.html
Checklist
README.md
, or thedocs
directory) - Will raise separate PR for thisBONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯