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

CrowdStrike Falcon Sensor Agent Offline Watchdog

Queries CrowdStrike Falcon OAuth2 API for host endpoint sensors that have stopped reporting heartbeats beyond SLAs, alerting SecOps teams on Slack.

Categories
CloudInfrastructure

Audits CrowdStrike Falcon endpoint detection and response (EDR) sensor connectivity across enterprise hosts via OAuth2 REST APIs, identifying offline sensors, heartbeat failures, and agent uninstalls before endpoint visibility blindspots emerge.

How it works

  1. OAuth2 Token Negotiation: Negotiates short-lived bearer tokens against the CrowdStrike Falcon OAuth2 authentication service using client credentials.
  2. Host Query Formulation: Queries the /devices/queries/devices/v1 endpoint filtering for devices whose last_seen timestamp exceeds configured offline thresholds.
  3. Sensor Detail Extraction: Interrogates /devices/entities/devices/v1 retrieving hostnames, IP addresses, OS versions, and sensor agent release numbers.
  4. SecOps Incident Alerting: Dispatches rich diagnostic alerts to designated SecOps Slack channels specifying offline hostnames and elapsed offline durations.

Architecture diagram

flowchart TD
    A[periodic_falcon_audit Schedule Trigger] --> B[scan_falcon_sensor_heartbeats Python Script]
    B --> C[check_offline_sensor_count Flowable If]
    C -- Threshold Breached --> D[notify_slack_secops_incident Webhook]
    C -- Metrics Nominal --> E[log_nominal_sensor_state Log]
    D --> E
    E --> F[export_falcon_manifest Return]

Architecture components

  • Trigger (periodic_falcon_audit): Drives scheduled recurring surveillance cycles without human intervention.
  • Inspection Task (scan_falcon_sensor_heartbeats): Queries target APIs and structures diagnostic indicators via Kestra outputs.
  • Evaluation Gate (check_offline_sensor_count): Evaluates operational safety boundaries using deterministic boolean branching.
  • Notification Action (notify_slack_secops_incident): Dispatches rich, actionable incident messages directly to team channels.
  • Manifest Return (export_falcon_manifest): Emits structured compliance payloads for SIEM and analytics records.

Key capabilities

  • Automated Health Polling: Continuous scheduled surveillance executed on customizable recurring intervals without dedicated agent daemons.
  • Deterministic Threshold Evaluation: Pure boolean and numeric tolerance checks eliminating false positives and alert noise.
  • Contextual Incident Notification: Rich Slack messages populated with explicit resource identifiers, error reasons, and metrics.
  • Machine-Readable Audit Manifest: Structured execution telemetry exported for compliance archives, SIEM ingestion, or analytics dashboards.

What you get

  • Continuous automated surveillance of CrowdStrike Falcon EDR sensor coverage across server and workstation fleets
  • Early warning for silent agent crashes, network egress blocking, or unauthorized sensor uninstalls by adversaries
  • Guaranteed compliance visibility preventing unmonitored host blindspots during security audit reviews
  • Structured compliance manifest detailing total sensors audited, offline hostnames, and audit timestamps

Who it's for

  • Security Operations Center (SOC) Analysts tracking endpoint detection and response agent coverage
  • Corporate IT Systems Administrators maintaining fleet-wide endpoint software health and telemetry
  • DevSecOps Engineers ensuring all newly provisioned cloud virtual machines maintain active EDR agents

Why orchestrate this with Kestra

  • Serverless execution environment interacting with CrowdStrike Falcon APIs without maintaining dedicated agent hosts
  • Native secret vault integration safeguarding high-privilege CrowdStrike API secrets and webhook endpoints
  • Declarative Flowable branching logic directing execution between nominal status logs and high-urgency alerts
  • Extensible workflow engine capable of triggering automated cloud instance quarantine or re-imaging

Use cases

  • Adversary Sensor Tampering Detection: Detect hosts where malicious actors or ransomware variants have disabled the falcon-sensor service daemon.
  • Egress Firewall Misconfiguration Auditing: Identify hosts unable to transmit heartbeats due to corporate proxy or egress firewall port restrictions.
  • Ephemeral Cloud Instance Decommissioning: Audit stale orphaned sensor registrations following dynamic autoscaling group termination events.

Inputs

Name Type Default Description
falcon_client_id STRING cs-falcon-api-client-id CrowdStrike Falcon API Client ID with Hosts Read permissions.
falcon_base_url STRING https://api.crowdstrike.com Base HTTPS URL of the CrowdStrike Falcon cloud environment (api.crowdstrike.com, api.us-2.crowdstrike.com).
max_offline_hours INT 24 Maximum tolerated duration in hours since last sensor heartbeat before a host is classified as offline.
offline_sensor_threshold INT 1 Count of offline endpoint sensors required to trigger an automated SecOps incident alert.
alert_on_offline BOOL True Toggle whether Slack webhook alerts are dispatched upon detecting offline endpoint sensors.

Expected outputs

  • {{ outputs.scan_falcon_sensor_heartbeats.vars.total_sensors_audited }}: Total number of CrowdStrike Falcon sensor devices processed during the audit execution.
  • {{ outputs.scan_falcon_sensor_heartbeats.vars.offline_sensor_count }}: Total count of active host endpoints identified as exceeding maximum offline duration limits.
  • {{ outputs.scan_falcon_sensor_heartbeats.vars.offline_hostnames }}: Comma-separated list of hostnames associated with offline CrowdStrike Falcon sensors.
  • {{ outputs.scan_falcon_sensor_heartbeats.vars.sensor_details }}: Detailed breakdown of offline hostnames, operating systems, and last seen timestamps.
  • {{ outputs.scan_falcon_sensor_heartbeats.vars.is_alerting }}: Boolean flag indicating whether offline sensor volume breached configured alert thresholds.

Prerequisites

  • Active CrowdStrike Falcon customer tenant with API client credentials generated in Falcon Console.
  • CrowdStrike API Client possessing Hosts:Read and Host groups:Read permission scopes.
  • Valid FALCON_CLIENT_SECRET secret stored within Kestra namespace secret configuration.
  • Configured Slack incoming webhook URL with permissions to post messages into the designated alert channel.

Secrets

  • FALCON_CLIENT_SECRET: Vault secret required for authenticated API execution and notifications.
  • SLACK_WEBHOOK_URL: Vault secret required for authenticated API execution and notifications.

Quick start

  1. Register required authentication credentials and webhook endpoints in Kestra namespace secrets.
  2. Import this blueprint into your Kestra instance under the company.security namespace.
  3. Review input defaults such as threshold limits, lookback windows, and alert toggles.
  4. Execute the flow manually to verify network connectivity, API permissions, and Slack notifications.
  5. Enable the automated schedule trigger to commence continuous background surveillance.

Common pitfalls and troubleshooting

  • Transient Workstation Sleep States: Laptops and remote employee workstations frequently sleep overnight; tune offline thresholds to 24-48 hours for client fleets.
  • API Client Scope Requirements: Ensure the CrowdStrike API client possesses explicit Hosts:Read permissions rather than generic event streaming scopes.
  • Cloud Instance Terminations: AWS EC2 or Azure VM instances terminated without proper de-registration remain in Falcon until auto-pruned (typically 45 days).
  • CrowdStrike Cloud Regional Endpoints: Ensure falcon_base_url matches the specific cloud tenant region (US-1, US-2, EU-1, US-GOV-1).

How to extend

  • Automated Host Network Isolation: Trigger CrowdStrike Falcon API calls to initiate network containment on hosts exhibiting prolonged anomalous disconnections.
  • ServiceNow CMDB Synchronization: Automatically reconcile offline Falcon sensor hostnames against enterprise CMDB assets to flag decommissioning status.
  • PagerDuty Escalation: Escalate to PagerDuty high-urgency incident response if critical production database servers lose EDR coverage.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.