Schedule icon
Script icon
Create icon
If icon
SlackIncomingWebhook icon
Log icon

Automated SSL/TLS Certificate Expiration and Renewal Sentinel

Monitor SSL/TLS certificate expiry with Kestra. Query TLS handshake peer certificates, calculate days to expiration, file GitHub issues, and alert Slack.

Categories
CloudInfrastructure

Expired TLS certificates trigger browser security warnings, broken API connections, and immediate business downtime. This blueprint provides a scheduled Day 2 security sentinel that establishes direct TLS handshakes against public or internal domains, calculates remaining valid days, automatically logs renewal tasks into GitHub Issues, and alerts SecOps teams on Slack when certificates cross expiration thresholds.

How it works

  1. A Schedule trigger (io.kestra.plugin.core.trigger.Schedule) fires daily (e.g. at 06:00 UTC) to audit production domain certificates.
  2. The inspect_tls_certificate task (io.kestra.plugin.scripts.python.Script) opens a TLS socket to hostname:port, reads peer certificate metadata, calculates days until expiry, and checks if it falls below warning_days_threshold.
  3. The create_cert_renewal_issue task (io.kestra.plugin.github.issues.Create) logs a structured renewal tracking issue in the security repository.
  4. The check_expiration_threshold task (io.kestra.plugin.core.flow.If) evaluates needs_renewal: true: if within the warning window, it alerts the team via Slack with direct links to the tracking issue. Otherwise, it logs a compliant health check.

What you get

  • Automated certificate validity auditing with zero manual browser checks or command-line OpenSSL probing.
  • Proactive alerts weeks in advance before certificate expirations cause outages.
  • Centralized renewal issue tracking on GitHub.
  • Real-time Slack notifications alerting DevOps and platform teams to impending expirations.

Who it's for

  • SecOps and infrastructure engineers managing domain certificates across environments.
  • SREs and platform teams preventing preventable SSL-related outages.
  • API gateway and web platform administrators auditing custom domain endpoints.

Why orchestrate this with Kestra

Monitoring certificate expiration across diverse endpoints, computing time deltas, creating auditable tickets, and broadcasting alerts requires connecting disparate networks and APIs. Kestra coordinates the schedule, isolated Python network probing, GitHub issue creation, and Slack alerting into a clean, auditable YAML workflow.

Prerequisites

  • A running Kestra instance with Python, GitHub, and Slack plugins installed.
  • Network connectivity from Kestra workers to the target domain on port 443.
  • A GitHub Personal Access Token with repo issues scope.
  • A Slack incoming webhook configured for security alerts.

Secrets

  • GITHUB_TOKEN: GitHub OAuth or Personal Access Token for logging renewal issues.
  • SLACK_WEBHOOK: Incoming Webhook URL for SecOps alerts.

Quick start

  1. Configure the two secrets in your Kestra namespace or instance settings.
  2. Import this flow into your target namespace (e.g., company.security).
  3. Set hostname to your primary production domain or API gateway.
  4. Execute manually to verify certificate inspection, GitHub issue creation, and Slack alerting.
  5. Enable the schedule trigger for continuous daily protection.

How to extend

  • Pass an array of hostnames and wrap inspection inside a Loop task to monitor your entire domain portfolio in a single run.
  • Connect a Certbot or Let's Encrypt automation task to trigger zero-touch renewal for automated domains.
  • Integrate with AWS Route 53 or Cloudflare tasks to automatically verify DNS challenge records.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.