Skip to content

Commit 687b3c4

Browse files
committed
fix: reduce TLS certificate duration from 10 years to 1 year
- Change certificate duration from 87600h (10y) to 8760h (1y) - Shorter-lived certificates reduce the attack surface if a private key is compromised, following security best practices - cert-manager will still auto-renew 30 days before expiry
1 parent c3ac8c3 commit 687b3c4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/resources/generate_resources_pod_mutating_webhooks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ func CreateCertificate(name string, svc corev1.Service) *certmanager.Certificate
147147
Spec: certmanager.CertificateSpec{
148148
SecretName: name + "-webhook-secret",
149149
Duration: &metav1.Duration{
150-
Duration: 87600 * time.Hour,
150+
Duration: 8760 * time.Hour, // 1 year
151151
},
152152
RenewBefore: &metav1.Duration{
153-
Duration: 720 * time.Hour,
153+
Duration: 720 * time.Hour, // 30 days
154154
},
155155
DNSNames: []string{
156156
svc.Name + "." + svc.Namespace + ".svc",

0 commit comments

Comments
 (0)