Skip to content

chore: Reduce certificate lifetime to 14 days, clean up subject/SANs#539

Open
jnschaeffer wants to merge 2 commits into
multigres:mainfrom
jnschaeffer:jns/reduce-cert-lifetime
Open

chore: Reduce certificate lifetime to 14 days, clean up subject/SANs#539
jnschaeffer wants to merge 2 commits into
multigres:mainfrom
jnschaeffer:jns/reduce-cert-lifetime

Conversation

@jnschaeffer

Copy link
Copy Markdown

This PR reduces the duration of an issued certificate from 5 years to 14 days, fixes a typo in the subject name, and removes logic that modifies the DNS SANs based on whether the DNS name starts with "db.".

@jnschaeffer
jnschaeffer requested a review from a team as a code owner July 7, 2026 20:33
This commit reduces the duration of an issued certificate from 5 years
to 14 days, fixes a typo in the subject name, and removes logic that
modifies the DNS SANs based on whether the DNS name starts with "db.".

Signed-off-by: John Schaeffer <john.schaeffer@supabase.io>
@jnschaeffer
jnschaeffer force-pushed the jns/reduce-cert-lifetime branch from 545587d to 40d7b12 Compare July 7, 2026 20:39
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔬 Go Test Coverage Report

Summary

Coverage Type Result
Threshold 70%
Previous Test Coverage Unknown%
New Test Coverage Unknown%

Status

⚠️ SKIPPED (Build Failed?)

Detail

Show New Coverage
No coverage report generated (Build likely failed).

cn := cluster.Spec.CertCommonName

// Build the secondary SAN by stripping the "db." prefix if present.
dnsNames := []any{cn}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please update certificate_test.go to match this? TestBuildCertificate still expects the stripped secondary SAN (abc123.supabase.red) here, plus the old Delware subject string.

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-db. hostname.

This commit updates the certificate tests to match the new certificate
subject and SANs.

Signed-off-by: John Schaeffer <john.schaeffer@supabase.io>
// CertDuration is the certificate duration (5 years), matching non-HA projects.
CertDuration = "44640h0m0s"
// CertDuration is the certificate duration.
CertDuration = "336h0m0s"

@niconosenzo niconosenzo Jul 14, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants