Certificate Expiry Incident Response
Domain: {{ affected_domain }}
Provider: {{ certificate_provider }}
Status: {{ expiry_status }}
Impact of Expired Certificates
- Browsers show security warnings, blocking user access
- API clients reject connections with TLS errors
- Mobile apps may hard-fail with certificate pinning errors
- Service-to-service communication breaks if mTLS is used
- Webhooks from third parties fail
- Search engine rankings can be affected
Phase 1 — Immediate Diagnosis (0-5 min)
Check Certificate Status
# Check certificate expiry for a domain
echo | openssl s_client -servername {{ affected_domain }} -connect {{ affected_domain }}:443 2>/dev/null | openssl x509 -noout -dates -subject -issuer
# Check certificate chain
echo | openssl s_client -servername {{ affected_domain }} -connect {{ affected_domain }}:443 -showcerts 2>/dev/null
# Check days until expiry
echo | openssl s_client -servername {{ affected_domain }} -connect {{ affected_domain }}:443 2>/dev/null | openssl x509 -noout -checkend 0
# Exit code 1 = expired, 0 = still valid
# Check from a specific file
openssl x509 -in /path/to/cert.pem -noout -dates
# Verify certificate matches private key
openssl x509 -noout -modulus -in cert.pem | openssl md5
openssl rsa -noout -modulus -in key.pem | openssl md5
# Both MD5 values must match
Identify All Affected Endpoints
Phase 2 — Emergency Renewal (5-30 min)
Option 1: Automated Renewal (Let's Encrypt / ACME)
# Certbot renewal
sudo certbot renew --cert-name {{ affected_domain }} --force-renewal
# Verify new certificate
sudo certbot certificates --cert-name {{ affected_domain }}
Option 2: Cloud Provider Managed Certificates
# AWS ACM — request new certificate
aws acm request-certificate \
--domain-name {{ affected_domain }} \
--validation-method DNS
# GCP — managed certificate auto-renews; check status
gcloud compute ssl-certificates describe CERT_NAME
# Azure — check App Service managed certificate
az webapp config ssl list --resource-group RG_NAME
Option 3: Manual Certificate Renewal
- Generate new CSR:
openssl req -new -newkey rsa:2048 -nodes \
-keyout {{ affected_domain }}.key \
-out {{ affected_domain }}.csr \
-subj "/CN={{ affected_domain }}"
- Submit CSR to certificate provider ({{ certificate_provider }})
- Complete domain validation (DNS or HTTP)
- Download and install new certificate
Option 4: Emergency Self-Signed (last resort, internal only)
openssl req -x509 -newkey rsa:2048 -nodes \
-keyout emergency.key -out emergency.crt \
-days 30 -subj "/CN={{ affected_domain }}"
WARNING: Self-signed certificates will cause browser warnings and API client failures. Use only for internal services as a temporary measure.
Phase 3 — Deploy New Certificate
Deployment Checklist
Verification After Deployment
# Verify new certificate is being served
echo | openssl s_client -servername {{ affected_domain }} -connect {{ affected_domain }}:443 2>/dev/null | openssl x509 -noout -dates -subject
# Test HTTPS connectivity
curl -vI https://{{ affected_domain }} 2>&1 | grep -E "expire|subject|issuer|SSL"
# Check certificate chain is complete
echo | openssl s_client -servername {{ affected_domain }} -connect {{ affected_domain }}:443 2>/dev/null | grep -E "Verify|depth"
Verification Checklist
Phase 4 — Prevention
Automated Renewal Setup
Monitoring and Alerting
Organizational Process
Counter-Rationalizations
| Shortcut |
Counter |
Why |
| "We can skip some steps for this case" |
Adapt the workflow steps, don't skip them |
Skipped steps are where incidents and oversights originate |
| "The user seems to already know what to do" |
Complete all workflow phases with the user |
The workflow catches blind spots that experience alone misses |
| "This is a minor case, full process is overkill" |
Scale the process down, don't turn it off |
Minor cases become major when unstructured; the process scales, not disappears |
| "I'll fill in the details later" |
Complete each section before moving on |
Deferred details are forgotten; real-time capture is more accurate |
| "The template output isn't necessary" |
Always produce the structured output format |
Structured output enables comparison, audit trails, and handoff to other teams |
1---2name: certificate-expiry-incident3enabled: true4description: |5 Use when performing certificate expiry incident — tLS/SSL certificate expiry6 incident response and prevention playbook. Covers emergency certificate7 renewal, impact assessment, interim mitigations, certificate chain validation,8 automated renewal configuration, monitoring setup, and organizational9 processes to prevent certificate-related outages.10required_connections:11 - prefix: slack12 label: "Slack (for incident coordination)"13config_fields:14 - key: affected_domain15 label: "Affected Domain"16 required: true17 placeholder: "e.g., api.example.com, *.example.com"18 - key: certificate_provider19 label: "Certificate Provider"20 required: false21 placeholder: "e.g., Let's Encrypt, DigiCert, ACM"22 - key: expiry_status23 label: "Expiry Status"24 required: true25 placeholder: "e.g., expired 2 hours ago, expires in 24 hours"26features:27 - INCIDENT28metadata:29 source: https://skillmd.com/skills/cloudthinker-ai/certificate-expiry-incident30---3132# Certificate Expiry Incident Response3334Domain: **{{ affected_domain }}**35Provider: **{{ certificate_provider }}**36Status: **{{ expiry_status }}**3738## Impact of Expired Certificates3940- Browsers show security warnings, blocking user access41- API clients reject connections with TLS errors42- Mobile apps may hard-fail with certificate pinning errors43- Service-to-service communication breaks if mTLS is used44- Webhooks from third parties fail45- Search engine rankings can be affected4647## Phase 1 — Immediate Diagnosis (0-5 min)4849### Check Certificate Status50```bash51# Check certificate expiry for a domain52echo | openssl s_client -servername {{ affected_domain }} -connect {{ affected_domain }}:443 2>/dev/null | openssl x509 -noout -dates -subject -issuer5354# Check certificate chain55echo | openssl s_client -servername {{ affected_domain }} -connect {{ affected_domain }}:443 -showcerts 2>/dev/null5657# Check days until expiry58echo | openssl s_client -servername {{ affected_domain }} -connect {{ affected_domain }}:443 2>/dev/null | openssl x509 -noout -checkend 059# Exit code 1 = expired, 0 = still valid6061# Check from a specific file62openssl x509 -in /path/to/cert.pem -noout -dates6364# Verify certificate matches private key65openssl x509 -noout -modulus -in cert.pem | openssl md566openssl rsa -noout -modulus -in key.pem | openssl md567# Both MD5 values must match68```6970### Identify All Affected Endpoints71- [ ] Which domains use this certificate? (check SANs)72- [ ] Is this a wildcard cert affecting multiple subdomains?73- [ ] Where is this certificate deployed? (load balancers, CDN, servers, containers)74- [ ] Are there any certificate-pinned clients?7576## Phase 2 — Emergency Renewal (5-30 min)7778### Option 1: Automated Renewal (Let's Encrypt / ACME)79```bash80# Certbot renewal81sudo certbot renew --cert-name {{ affected_domain }} --force-renewal8283# Verify new certificate84sudo certbot certificates --cert-name {{ affected_domain }}85```8687### Option 2: Cloud Provider Managed Certificates88```bash89# AWS ACM — request new certificate90aws acm request-certificate \91 --domain-name {{ affected_domain }} \92 --validation-method DNS9394# GCP — managed certificate auto-renews; check status95gcloud compute ssl-certificates describe CERT_NAME9697# Azure — check App Service managed certificate98az webapp config ssl list --resource-group RG_NAME99```100101### Option 3: Manual Certificate Renewal1021. Generate new CSR:103```bash104openssl req -new -newkey rsa:2048 -nodes \105 -keyout {{ affected_domain }}.key \106 -out {{ affected_domain }}.csr \107 -subj "/CN={{ affected_domain }}"108```1092. Submit CSR to certificate provider ({{ certificate_provider }})1103. Complete domain validation (DNS or HTTP)1114. Download and install new certificate112113### Option 4: Emergency Self-Signed (last resort, internal only)114```bash115openssl req -x509 -newkey rsa:2048 -nodes \116 -keyout emergency.key -out emergency.crt \117 -days 30 -subj "/CN={{ affected_domain }}"118```119**WARNING:** Self-signed certificates will cause browser warnings and API client failures. Use only for internal services as a temporary measure.120121## Phase 3 — Deploy New Certificate122123### Deployment Checklist124- [ ] New certificate validated (correct domain, valid chain, key matches)125- [ ] Deploy to load balancer(s)126- [ ] Deploy to CDN edge (if applicable)127- [ ] Deploy to application servers (if terminating TLS)128- [ ] Update Kubernetes secrets (if applicable)129- [ ] Restart/reload web servers (nginx, Apache, etc.)130- [ ] Flush any TLS session caches131132### Verification After Deployment133```bash134# Verify new certificate is being served135echo | openssl s_client -servername {{ affected_domain }} -connect {{ affected_domain }}:443 2>/dev/null | openssl x509 -noout -dates -subject136137# Test HTTPS connectivity138curl -vI https://{{ affected_domain }} 2>&1 | grep -E "expire|subject|issuer|SSL"139140# Check certificate chain is complete141echo | openssl s_client -servername {{ affected_domain }} -connect {{ affected_domain }}:443 2>/dev/null | grep -E "Verify|depth"142```143144### Verification Checklist145- [ ] Certificate shows new expiry date146- [ ] Full certificate chain is valid147- [ ] No mixed content warnings148- [ ] API clients connecting successfully149- [ ] Monitoring tools reporting healthy150- [ ] SSL Labs test passing (https://www.ssllabs.com/ssltest/)151152## Phase 4 — Prevention153154### Automated Renewal Setup155- [ ] Configure ACME/certbot auto-renewal with cron or systemd timer156- [ ] Use cloud-managed certificates where possible (ACM, GCP managed)157- [ ] Test renewal process in staging before relying on it158159### Monitoring and Alerting160- [ ] Set up certificate expiry monitoring (alert at 30, 14, 7, 3, 1 days)161- [ ] Monitor certificate validity from external vantage points162- [ ] Add certificate expiry to team dashboard163- [ ] Configure alerts for renewal failures164165### Organizational Process166- [ ] Maintain certificate inventory (domain, provider, expiry, owner, location)167- [ ] Assign certificate ownership to specific teams168- [ ] Include certificate review in quarterly security audits169- [ ] Document renewal procedures in runbook170- [ ] Add certificate checks to production readiness review171172## Counter-Rationalizations173174| Shortcut | Counter | Why |175|----------|---------|-----|176| "We can skip some steps for this case" | Adapt the workflow steps, don't skip them | Skipped steps are where incidents and oversights originate |177| "The user seems to already know what to do" | Complete all workflow phases with the user | The workflow catches blind spots that experience alone misses |178| "This is a minor case, full process is overkill" | Scale the process down, don't turn it off | Minor cases become major when unstructured; the process scales, not disappears |179| "I'll fill in the details later" | Complete each section before moving on | Deferred details are forgotten; real-time capture is more accurate |180| "The template output isn't necessary" | Always produce the structured output format | Structured output enables comparison, audit trails, and handoff to other teams |181