New to Kestra?
Use blueprints to kickstart your first workflows.
Audit NetBird WireGuard peer connectivity, detect expired login sessions and pending approvals, classify mesh health, and alert Slack via Kestra.
Continuously audits NetBird zero-trust WireGuard overlay networks by querying the Management REST API, validating peer connectivity states, identifying expired login sessions or unapproved devices, classifying mesh health, and dispatching incident alerts to Slack.
probe_netbird_users queries /api/users using an API access token to verify NetBird Management service vitality and credential validity.probe_netbird_peers retrieves the complete inventory of registered peers across the mesh network, extracting internal IPs, online connection statuses, login expiration flags, and approval requirements.probe_netbird_routes queries /api/routes to verify defined subnet routers and network routing health.classify_network_status evaluates peer attributes using a Pebble conditional expression:login_expired: true) and categorizes state as LOGIN_EXPIRED_CRITICAL.approval_required: true) as APPROVAL_PENDING.connected: false) exceeding max_tolerated_disconnected_peers as PEERS_DISCONNECTED_WARNING.HEALTHY.API_UNREACHABLE or PROBE_FAILED.route_by_network_status switches workflow execution based on the classification:HEALTHY: Logs total peers, active network routes, and confirmed connectivity.LOGIN_EXPIRED_CRITICAL: Dispatches an urgent escalation alert to Slack naming machines with severed WireGuard tunnels due to expired credentials.PEERS_DISCONNECTED_WARNING: Posts a warning to Slack naming offline hostnames and assigned internal IPs.APPROVAL_PENDING: Alerts administrators that new edge peers require connection authorization.API_UNREACHABLE: Alerts on-call operations that the NetBird management control plane is down.log_audit_summary produces structured outputs recording peer counts, connected/disconnected ratios, and security flags for compliance reporting.errors catches unexpected task exceptions and posts a diagnostic notice to Slack.NetBird secures mission-critical interconnectivity between distributed microservices, databases, and remote environments. When a peer's authentication session expires or an edge subnet router goes offline, internal communication fails without traditional network monitoring picking it up immediately. Kestra delivers declarative, auditable orchestration with centralized secret management, robust HTTP probing, dynamic multi-state classification, and rapid multi-channel alerting.
NETBIRD_API_KEY: Personal Access Token or Service User token used for Token authentication against /api/ endpoints.SLACK_WEBHOOK: Incoming Slack webhook URL used by alert_disconnected_peers_slack, alert_expired_logins_slack, alert_approval_pending_slack, alert_probe_failed_slack, alert_unreachable_slack, and the errors handler.NETBIRD_API_KEY and SLACK_WEBHOOK as secrets within your Kestra namespace.git clone https://github.com/netbirdio/netbird && cd netbird/infrastructure_files
docker compose up -d
netbird_host: "localhost" or "netbird-management".HEALTHY, and records audit outputs.every_4_hours trigger to automate continuous background monitoring.PUT /api/peers/{id} to automatically approve known staging peers matching an authorized hostname pattern.LOGIN_EXPIRED_CRITICAL states affecting production database primary nodes.prod-servers vs developer-laptops)./api/setup-keys to audit pre-shared key expiration and alert before automated CI enrollment keys expire.