Script icon
Docker icon
If icon
SlackIncomingWebhook icon
Log icon
Return icon
Schedule icon

Nebula Mesh Lighthouse Handshake and Certificate Expiration Sentinel

Audits Defined Networking Nebula mesh lighthouse health to detect UDP handshake stalls, node reachability failures, and certificate expiry.

Categories
CloudInfrastructure

Automates continuous health and security surveillance for Defined Networking Nebula encrypted overlay mesh networks.

How it works

  1. A schedule trigger initiates the Nebula lighthouse health audit every 15 minutes.
  2. The Python task queries the Nebula lighthouse Prometheus metrics endpoint on port 4280.
  3. The script extracts UDP handshake latencies, active peer tunnels, unreachable hosts, and CA certificate expiration dates.
  4. An evaluation gate determines whether handshake latencies, peer reachability, or certificate windows breach bounds.
  5. When mesh health breaches are detected, an incident notification is posted to the Network SRE Slack channel.
  6. When encrypted tunnels function normally with low latency, nominal telemetry is logged.
  7. A structured JSON audit manifest is emitted for zero-trust network compliance records and security audits.

Architecture diagram

graph TD
    Trigger[Schedule Trigger: 15m] --> ScanMetrics[Python Script: Scrape Nebula Metrics]
    ScanMetrics --> EvalBreach{Handshake > Threshold OR Cert Expiring?}
    EvalBreach -- Yes --> SlackAlert[Slack: High-Urgency Network Alert]
    EvalBreach -- No --> LogNominal[Log: Nominal Mesh State]
    SlackAlert --> EmitManifest[Debug Return: Mesh Audit Manifest]
    LogNominal --> EmitManifest

Architecture components

  • Trigger: Automated schedule polling at 15-minute recurring intervals.
  • Script Task: Scrapes Nebula lighthouse Prometheus telemetry inside isolated Docker container runners.
  • Decision Gate: Compares current host handshake latencies and certificate expiration horizons against thresholds.
  • Notification Task: Dispatches structured Slack messages detailing mesh latency and peer disconnection counts.
  • Audit Manifest: Emits JSON execution payloads containing overlay network health and verification timestamps.

Key capabilities

  • Continuous surveillance of peer discovery and NAT traversal through Nebula central lighthouse nodes.
  • Early warning detection for expiring Nebula node and CA certificates before overlay traffic drops.
  • Automated detection of unreachable node peers caused by UDP firewall rules or relay disconnections.
  • Isolated Docker task execution ensuring reliable Python script execution without system dependencies.

What you get

  • Real-time visibility into encrypted zero-trust overlay mesh communication latency and packet routing.
  • Proactive alerts preventing network-wide partition incidents due to expired cryptographic certificates.
  • Standardized audit manifests containing exact tunnel counts, handshake metrics, and timestamps.
  • Zero-dependency deployment compatible with hybrid cloud and multi-datacenter network topologies.

Who it's for

  • Network SREs and systems engineers operating zero-trust overlay mesh networks across hybrid clouds.
  • Infrastructure security architects managing mutual TLS node certificates and encryption keys.
  • Cloud platform administrators connecting distributed edge nodes and Kubernetes worker clusters.
  • Compliance officers auditing zero-trust cryptographic identities and network connectivity SLAs.

Why orchestrate this with Kestra

  • Serverless Docker Isolation: Executes telemetry scraping in ephemeral Docker environments without persistent workers.
  • Centralized Secrets Governance: Protects sensitive Slack webhooks using encrypted namespace secrets.
  • Declarative YAML Workflows: Manages zero-trust mesh monitoring as versioned code in Git repositories.
  • Comprehensive Audit History: Preserves historical network latency and certificate records in searchable Kestra logs.

Use cases

  • Certificate Expiration Guard: Alerts security teams before cryptographic certificate expiration disconnects mesh nodes.
  • Cross-Cloud Latency Monitoring: Detects routing degradation between multi-cloud nodes traversing public UDP paths.
  • Edge Node Disconnect Detection: Identifies disconnected IoT or branch office nodes unable to reach the lighthouse.

Inputs

Name Type Default Description
nebula_metrics_url STRING http://nebula-lighthouse.mesh.corp.net:4280 Internal HTTP URL exposing Prometheus metrics for Nebula.
mesh_network_name STRING production-zero-trust-mesh Identifier of the target Nebula overlay mesh network.
max_handshake_latency_ms INT 150 Maximum allowable host handshake latency in milliseconds.
min_certificate_days_remaining INT 21 Minimum days remaining on certificate before alerting.
alert_on_unreachable_peers BOOL true Toggle whether unreachable peers trigger an alert.

Expected outputs

  • {{ outputs.scan_nebula_mesh_telemetry.vars.handshake_latency_ms }}: Maximum observed host handshake latency.
  • {{ outputs.scan_nebula_mesh_telemetry.vars.active_tunnels_count }}: Count of active encrypted overlay peer tunnels.
  • {{ outputs.scan_nebula_mesh_telemetry.vars.cert_days_remaining }}: Days remaining on active lighthouse certificate.
  • {{ outputs.scan_nebula_mesh_telemetry.vars.is_alerting }}: Boolean flag indicating if mesh health SLA is breached.
  • {{ outputs.scan_nebula_mesh_telemetry.vars.audit_timestamp }}: ISO-8601 UTC timestamp of the mesh audit run.

Prerequisites

  • Defined Networking Nebula 1.7+ deployed with lighthouse nodes exposing Prometheus metrics.
  • Network connectivity from the Kestra worker to the lighthouse metrics port (default 4280).
  • Configured Slack incoming webhook URL with permissions to post in network alert channels.

Secrets

  • SLACK_WEBHOOK_URL: Secure webhook URL for routing overlay mesh alerts to the Network SRE Slack channel.

Quick start

  1. Verify that Nebula lighthouse exposes Prometheus metrics on HTTP port 4280.
  2. Add the SLACK_WEBHOOK_URL secret within your Kestra namespace settings.
  3. Specify your mesh network identifier in mesh_network_name.
  4. Run a manual flow execution via the Kestra UI to validate lighthouse metric ingestion.
  5. Enable the periodic_nebula_audit schedule trigger to establish automated monitoring.

Common pitfalls and troubleshooting

  • UDP Hole Punching: High handshake latency often results from asymmetric NAT firewalls blocking direct UDP packets.
  • Certificate Authority Rollover: When rotating root Nebula CA certificates, ensure all nodes receive the new CA bundle.
  • Lighthouse Redundancy: Always deploy at least two redundant lighthouses across distinct cloud availability zones.
  • MTU Fragmentation: If encrypted packets drop, verify that the overlay MTU (default 1300) accounts for UDP encapsulation.

How to extend

  • Automated Certificate Renewal: Trigger automated Nebula certificate signing workflows when expiration drops below 14 days.
  • Dynamic Route Optimization: Query secondary lighthouse nodes to assess path latency across alternative transit routes.
  • PagerDuty Escalation: Escalate to on-call network engineers if all lighthouse nodes report zero active tunnels.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.