-
Notifications
You must be signed in to change notification settings - Fork 28
chore: Reduce certificate lifetime to 14 days, clean up subject/SANs #539
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: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ import ( | |
| "context" | ||
| "errors" | ||
| "fmt" | ||
| "strings" | ||
|
|
||
| apierrors "k8s.io/apimachinery/pkg/api/errors" | ||
| apimeta "k8s.io/apimachinery/pkg/api/meta" | ||
|
|
@@ -22,12 +21,12 @@ const ( | |
| // CertIssuerName is the cert-manager ClusterIssuer used for TLS certificates. | ||
| CertIssuerName = "supabase-issuer" | ||
|
|
||
| // CertDuration is the certificate duration (5 years), matching non-HA projects. | ||
| CertDuration = "44640h0m0s" | ||
| // CertDuration is the certificate duration. | ||
| CertDuration = "336h0m0s" | ||
|
|
||
| // CertLiteralSubjectTemplate is the literal subject template for certificates. | ||
| // The CN placeholder is replaced with the certCommonName. | ||
| CertLiteralSubjectTemplate = "C=US, ST=Delware, L=New Castle,O=Supabase Inc, CN=%s" | ||
| CertLiteralSubjectTemplate = "C=US, ST=Delaware, L=New Castle, O=Supabase Inc, CN=%s" | ||
| ) | ||
|
|
||
| var certGVK = schema.GroupVersionKind{ | ||
|
|
@@ -47,11 +46,7 @@ func buildCertificate( | |
| ) (*unstructured.Unstructured, error) { | ||
| cn := cluster.Spec.CertCommonName | ||
|
|
||
| // Build the secondary SAN by stripping the "db." prefix if present. | ||
| dnsNames := []any{cn} | ||
|
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. Can you please update Also, can you confirm that dropping the stripped SAN is safe? The subject spelling fix seems fine, but removing this SAN could break any client still connecting via the non- |
||
| if after, ok := strings.CutPrefix(cn, "db."); ok { | ||
| dnsNames = append(dnsNames, after) | ||
| } | ||
|
|
||
| cert := &unstructured.Unstructured{} | ||
| cert.SetGroupVersionKind(certGVK) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Wondering if we should separate the constructors or use different duration for, e.g., external facing certificates (multigateway) and component-to-component certificates.