-
Notifications
You must be signed in to change notification settings - Fork 1
Pass in enabled mTLS spec when a cert is provided #86
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
Changes from all commits
f8b6b2f
adf5848
4d99c33
3d61e3d
93abd77
2a66283
9612dd7
a1a1098
72e041b
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 |
|---|---|---|
|
|
@@ -56,7 +56,7 @@ func (c *Client) AddCACerts(ctx context.Context, params AddCACertsParams) (*oper | |
| spec := ns.GetSpec() | ||
| // Ensure MtlsAuth is initialized before accessing its fields | ||
| if spec.MtlsAuth == nil { | ||
| spec.MtlsAuth = &namespacev1.MtlsAuthSpec{} | ||
| spec.MtlsAuth = &namespacev1.MtlsAuthSpec{Enabled: true} | ||
|
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. Existing mTLS stays disabledHigh Severity
Additional Locations (1)Reviewed by Cursor Bugbot for commit 93abd77. Configure here.
Contributor
Author
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. Is there ever a case where we add certs/filters and we don't have it enabled? 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. mTLS stays disabled adding certsMedium Severity In Additional Locations (1)Reviewed by Cursor Bugbot for commit a1a1098. Configure here. |
||
| } | ||
| spec.MtlsAuth.AcceptedClientCa = bundleBytes | ||
|
|
||
|
|
@@ -110,7 +110,7 @@ func (c *Client) DeleteCACerts(ctx context.Context, params DeleteCACertsParams) | |
| } else { | ||
| // Ensure MtlsAuth is initialized before accessing its fields | ||
| if spec.MtlsAuth == nil { | ||
| spec.MtlsAuth = &namespacev1.MtlsAuthSpec{} | ||
| spec.MtlsAuth = &namespacev1.MtlsAuthSpec{Enabled: true} | ||
| } | ||
| spec.MtlsAuth.AcceptedClientCa = bundleBytes | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ func (c *Client) AddCertFilters(ctx context.Context, params AddCertFiltersParams | |
| spec := ns.GetSpec() | ||
| // Ensure MtlsAuth is initialized | ||
| if spec.MtlsAuth == nil { | ||
| spec.MtlsAuth = &namespacev1.MtlsAuthSpec{} | ||
| spec.MtlsAuth = &namespacev1.MtlsAuthSpec{Enabled: true} | ||
|
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. mTLS not enabled on addMedium Severity This PR turns on Additional Locations (1)Reviewed by Cursor Bugbot for commit 9612dd7. Configure here. |
||
| } | ||
|
|
||
| existingFilters := spec.MtlsAuth.GetCertificateFilters() | ||
|
|
@@ -101,7 +101,7 @@ func (c *Client) DeleteCertFilters(ctx context.Context, params DeleteCertFilters | |
|
|
||
| // Update the spec with the new filter list | ||
| if spec.MtlsAuth == nil { | ||
| spec.MtlsAuth = &namespacev1.MtlsAuthSpec{} | ||
| spec.MtlsAuth = &namespacev1.MtlsAuthSpec{Enabled: true} | ||
|
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. Delete filters enables empty mTLSLow Severity In Reviewed by Cursor Bugbot for commit 93abd77. Configure here.
Contributor
Author
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. Is there ever a case where we have cert filters enabled, we delete it, and the namespace has enabled:false on mtls? |
||
| } | ||
| spec.MtlsAuth.CertificateFilters = newFilters | ||
|
|
||
|
|
||


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.
Enabled unset on existing MtlsAuth
High Severity
In
AddCACerts,MtlsAuth.Enabledis set totrueonly whenspec.MtlsAuthis nil. When the namespace already has anMtlsAuthblock (the usual add-cert path), onlyAcceptedClientCais updated, soEnabledstays false and mTLS can remain off despite CA changes.Reviewed by Cursor Bugbot for commit adf5848. Configure here.