Interview Prep/DevSecOps/Certificates, TLS and security incident response

At 05:30 every client starts failing with `x509: certificate has expired or is not yet valid`

BeginnerTroubleshootingCertificates, TLS and security incident response
Answer

Likely causes → The certificate expired because nobody renewed a manually issued one, or automated renewal was failing silently. Less often, the client clock is wrong ("not yet valid").

Diagnose →

echo | openssl s_client -connect api.acme.com:443 -servername api.acme.com 2>/dev/null | openssl x509 -noout -dates
date -u

Fix → Renew and deploy now (cmctl renew api-tls -n prod, or reissue in your CA or ACM). Then restart or reload anything that caches the certificate.

Prevent → Automate renewal everywhere, and alert at 21 and 7 days before expiry with blackbox exporter's probe_ssl_earliest_cert_expiry or cert-manager's certmanager_certificate_expiration_timestamp_seconds.

All DevSecOps questions

More on Certificates, TLS and security incident response