Schedule icon
Request icon
Script icon
Log icon
Switch icon
SlackIncomingWebhook icon
Fail icon

Pomerium Identity-Aware Proxy Databroker and Session Sync Sentinel

Audit Pomerium IAP databroker storage errors and IdP sync telemetry to prevent identity desync and session outages via Kestra.

Categories
Infrastructure

Continuously audits Pomerium Zero Trust identity-aware proxy deployments to detect databroker storage errors, monitor identity provider (IdP) directory synchronization health, verify synced record counts, and dispatch actionable Slack alerts before enterprise users encounter access outages.

How it works

  1. periodic_sync_audit (io.kestra.plugin.core.trigger.Schedule) triggers every 15 minutes with configurable thresholds and connection parameters. It ships disabled by default so initial connectivity can be verified manually.
  2. probe_pomerium_metrics (io.kestra.plugin.core.http.Request) queries the Pomerium Prometheus metrics endpoint (GET /metrics) to fetch real-time operational telemetry across all proxy subsystems.
  3. analyze_databroker_telemetry (io.kestra.plugin.scripts.python.Script) parses the Prometheus text exposition stream to extract pomerium_databroker_storage_errors_total, pomerium_identity_manager_user_info_fetch_errors_total, and pomerium_databroker_synced_records. It classifies cluster health into CRITICAL_DATABROKER_ERROR, IDP_SYNC_WARNING, or HEALTHY.
  4. log_telemetry_summary (io.kestra.plugin.core.log.Log) outputs a structured telemetry overview into the execution audit trail.
  5. classify_health_status (io.kestra.plugin.core.flow.Switch) evaluates the calculated status:
    • CRITICAL_DATABROKER_ERROR: Dispatches an urgent alert to #security-ops via io.kestra.plugin.slack.notifications.SlackIncomingWebhook highlighting storage persistence failures that risk session drops, then terminates via io.kestra.plugin.core.execution.Fail to trigger on-call escalation.
    • IDP_SYNC_WARNING: Dispatches a Slack notification warning security engineers that directory synchronization or user info refresh is degraded while access proxy routing remains functional.
    • HEALTHY: Confirms zero storage errors and positive synchronized record counts via io.kestra.plugin.core.log.Log.
  6. log_audit_complete (io.kestra.plugin.core.log.Log) writes a final immutable compliance record documenting flow parameters and resulting cluster state.
  7. The global errors handler catches connection timeouts or unreachable hosts to dispatch an urgent out-of-band Slack notification when Pomerium is down.

What you get

  • Early warning of distributed databroker storage failures before edge proxies drop active user sessions or deny policy authorization.
  • Continuous validation of Identity Provider (OIDC, Google, Okta, Azure AD, GitHub) directory refresh calls to catch expired service account tokens or rate limit exhaustion.
  • Automated severity-based triage routing critical databroker outages to incident response channels while logging routine identity warnings separately.
  • Fully automated immutable execution audit history in Kestra for Zero Trust security compliance and SOC 2 access reviews.

Who it's for

  • Security Engineers and DevSecOps teams responsible for Zero Trust network access (ZTNA) and identity-aware reverse proxies.
  • Platform and Site Reliability Engineers managing corporate single sign-on (SSO) gateways and internal developer portals.
  • Systems Administrators auditing directory synchronization stability across distributed identity infrastructure.

Why orchestrate this with Kestra

Pomerium does not include native threshold-based alerting or team collaboration webhooks out of the box. Relying on raw cron scripts or manual dashboard checks creates visibility gaps that surface only after employees are locked out of internal tools. Kestra delivers scheduled execution, declarative error handling, secure credential masking, and automated multi-branch alerting in a single version-controlled workflow.

Prerequisites

  • A running Pomerium instance (open-source or enterprise) exposing its Prometheus metrics listener. Pomerium provides an official open-source Docker image (pomerium/pomerium:latest) that runs locally without commercial licensing.
  • A Slack incoming webhook URL configured for security alerts.

Secrets

  • SLACK_WEBHOOK_URL: Incoming webhook URL used by alert_critical_databroker_outage, alert_idp_sync_warning, and alert_sentinel_probe_failed to send notifications to #security-ops.

Quick start

  1. Start a local Pomerium container or mock metrics endpoint:
    docker run -d --name pomerium-sentinel-test -p 9090:9090 pomerium/pomerium:latest
    
  2. Add the SLACK_WEBHOOK_URL secret to your Kestra namespace.
  3. Import this flow into Kestra and trigger an execution with default inputs.
  4. Confirm that probe_pomerium_metrics succeeds and log_audit_complete confirms nominal status.
  5. Test alerting by triggering an execution with max_storage_errors_threshold set to -1 to simulate a critical databroker incident.
  6. Enable periodic_sync_audit to schedule continuous 15-minute background auditing.

How to extend

  • Add an automated remediation branch to restart the Pomerium databroker container via io.kestra.plugin.docker.Run or reload Kubernetes deployments via io.kestra.plugin.kubernetes.pods.Restart when critical storage errors persist.
  • Forward historical telemetry metrics to Prometheus Pushgateway or Datadog for long-term SSO trend analysis.
  • Integrate with PagerDuty via io.kestra.plugin.pagerduty.notifications.PagerDutyAlert to trigger high-priority paging during full proxy outages.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.