Schedule icon
Request icon
Return icon
Switch icon
Log icon
SlackIncomingWebhook icon
OutputValues icon

Authentik Outpost Health and Directory Sentinel

Audit Authentik SSO identity provider health, monitor outpost connectivity, classify authentication cluster availability, and alert Slack via Kestra.

Categories
Infrastructure

Continuously audits Authentik identity and access management (IAM) platforms by probing core REST endpoints, validating outpost instances (Proxy, LDAP, RADIUS), classifying authentication cluster health, and routing incident alerts to Slack.

How it works

  1. probe_authentik_version queries the /api/v3/admin/version/ endpoint using an API bearer token to verify Authentik core responsiveness and software release status.
  2. probe_authentik_outposts queries /api/v3/outposts/instances/ to discover all deployed outpost integrations, extracting active instance counts and protocol types.
  3. probe_authentik_system queries /api/v3/admin/system/ to retrieve backend diagnostics including PostgreSQL latency and Redis task queue responsiveness.
  4. classify_outpost_status evaluates response codes and registered instance totals through a Pebble conditional expression, classifying status into HEALTHY, WARNING, PROBE_FAILED, or CORE_UNREACHABLE.
  5. route_by_outpost_status branches workflow execution based on the classification:
    • HEALTHY: Logs current Authentik version, active outpost counts, and system status.
    • WARNING: Dispatches a Slack notification warning operations teams that deployed outposts have fallen below the expected threshold.
    • PROBE_FAILED: Alerts engineers that the API token lacks required read permissions for outpost objects.
    • CORE_UNREACHABLE: Dispatches an incident alert notifying on-call engineers that the Authentik core server is completely unreachable.
  6. log_audit_summary records structured outputs capturing cluster health and outpost counts for audit compliance.
  7. errors captures unexpected task exceptions and posts a high-priority incident notice to Slack.

What you get

  • Automated, continuous validation of Authentik IAM infrastructure without external proprietary agents.
  • Early detection of disconnected proxy, LDAP, or RADIUS outposts before end users experience single sign-on (SSO) authentication failures.
  • Instant Slack alerts providing execution IDs, unreachable endpoints, and diagnostic context.
  • Centralized audit tracking of identity provider versioning and infrastructure state.
  • Fully automated scheduling coupled with on-demand manual trigger capabilities.

Who it's for

  • Platform Engineers and Site Reliability Engineers operating Authentik as their primary SSO / IdP provider.
  • Security and Identity Engineers managing zero-trust reverse proxies, LDAP outposts, and directory sync.
  • DevSecOps teams responsible for maintaining high availability for corporate authentication services.

Why orchestrate this with Kestra

Identity providers like Authentik are mission-critical: an outage in core services or disconnected outposts immediately halts employee logins and automated API access across an organization. Relying on manual checks or isolated shell cron jobs creates blind spots and lacks durable execution tracking. Kestra provides declarative, auditable orchestration with centralized secret management, robust HTTP probing, dynamic status classification, and immediate failure alerting.

Prerequisites

  • A running Authentik server instance with HTTP access from the Kestra worker.
  • An Authentik API service account token with read permissions for the /api/v3/ endpoints.
  • An incoming Slack webhook URL for alert delivery.

Secrets

  • AUTHENTIK_API_TOKEN: Authentik bearer token used to authenticate REST API requests against administrative endpoints.
  • SLACK_WEBHOOK: Incoming Slack webhook URL used by alert_warning_slack, alert_probe_failed_slack, alert_unreachable_slack, and the errors handler.

Quick start

  1. Generate an API token in the Authentik Admin interface under System > Tokens & Credentials.
  2. Add AUTHENTIK_API_TOKEN and SLACK_WEBHOOK as secrets within your Kestra namespace.
  3. Start a local Authentik instance using Docker:
    docker run -d --name authentik -p 9000:9000 ghcr.io/goauthentik/server:latest server
    
  4. Run this flow manually in Kestra with authentik_host: "localhost" or "authentik" to verify connectivity and outpost discovery.
  5. Enable the every_15_minutes trigger to automate continuous background monitoring.

How to extend

  • Add nested HTTP calls to /api/v3/outposts/instances/{pk}/health/ to inspect individual outpost heartbeat timestamps (last_seen) and flag stale instances.
  • Integrate with PagerDuty or Opsgenie using dedicated Kestra notification plugins for automated on-call incident escalation.
  • Add a remediation task to trigger outpost container restarts via the Docker or Kubernetes plugin when an outpost reports an unhealthy state.
  • Track failed user logins and account lockout events by querying /api/v3/events/events/.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.