Skip to content

feat(crowdstrike): add alerts, host response, IOC, Spotlight, RTR, and case tools - #6746

Open
waleedlatif1 wants to merge 6 commits into
stagingfrom
feat/crowdstrike-depth
Open

feat(crowdstrike): add alerts, host response, IOC, Spotlight, RTR, and case tools#6746
waleedlatif1 wants to merge 6 commits into
stagingfrom
feat/crowdstrike-depth

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

CrowdStrike Falcon shipped with three Identity Protection sensor tools. This adds 20 more across alerts, host response, host groups, custom IOCs, Spotlight, Real Time Response, and Case Management — 23 tools total.

Why the branch is shaped around Alerts and Cases rather than Detects and Incidents: the two APIs a Falcon integration would normally build on are gone.

  • Detects API — decommissioned 2025-09-30. CrowdStrike's own swagger docstrings say so verbatim. /detects/queries/detects/v1, /detects/entities/detects/v2, and friends were superseded by the Alerts API.
  • Incidents API — removed in March 2026. gofalcon's 07-28-2026 regen deleted falcon/client/incidents/ entirely, including query_behaviors / get_behaviors. Case Management is the replacement.

So this builds on /alerts/* (v2 queries, v2/v3 entities) and /cases/*, not on the dead surfaces. No specific March day is asserted — neither SDK attests one, only "March 2026".

Tools added

  • Alerts — query, get details, update (status, assignment, comment, show-in-UI)
  • Host response — contain / lift containment / hide / restore host actions
  • Host groups — query, get details, add-hosts / remove-hosts actions
  • Custom IOCs — query, get details, create, update, delete
  • Spotlight — query vulnerabilities, get vulnerability details
  • Real Time Response — init session, execute command, poll command status, close session
  • Case Management — query cases, get case details

Fixes found while building

  • An invented csrutil RTR base command was removed — it appears nowhere in FalconPy. reg corrected to reg query.
  • Delete Indicators was silently dropping its filter param, so a filter-scoped delete fell back to the ID list.
  • query_sensors regression from the route split: the shared buildUrl helper skips only undefined, so an empty filter/sort string emitted ?filter= / ?sort= where the pre-split route omitted the param — sending Falcon an empty FQL expression. The contract now rejects blank values, matching the newer operations.
  • Ten RTR fields the tools already returned (deviceId, platform, pwd, offlineQueued, existingAidSessions, createdAt, queuedCommandOffline, baseCommand, taskId, sequenceId) were unreachable as block outputs.

Deliberately not implemented

  • Case create / update / merge and the IOC enum fields stay unimplemented or free-text: CrowdStrike's swagger types them as bare strings with no enums, so there is nothing to validate against without guessing.

Structure

app/api/tools/crowdstrike/query/route.ts was split into falcon.ts (auth, URL building, envelope helpers), normalize.ts (per-resource normalizers), and operations.ts (the 20 new operations). The three original sensor operations stay inline in the route and are excluded from ExtendedOperation by type, so none of the new envelope-error semantics apply to them — verified field-by-field as behavior-preserving.

Type of Change

  • New feature

Testing

24 tests in operations.test.ts covering alert query/details/update, host and host-group actions, envelope-error handling, IOC filter precedence, Spotlight cursor pagination, RTR session lifecycle, case normalization, and the blank-filter rejection. Each new test verified to fail without its fix.

bun run lint, bun run type-check, bun run check:api-validation, bun run tool-metadata:check, and bun run integration-catalog:check all pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…d case tools

CrowdStrike Falcon shipped only three read-only Identity Protection sensor
tools. This adds 20 tools across the response and investigation surface SecOps
teams actually automate against.

Alerts (current Alerts API): query, get details, update status/assignment/
tags/comment/visibility. Hosts: contain, lift containment, hide, unhide. Host
groups: query, get details, add/remove hosts. IOC Management: query, get, create,
update, delete. Spotlight: query vulnerabilities, get vulnerability details. Real
Time Response: init session, execute a read-only command, poll command status,
delete session. Case Management: query cases, get case details.

Every endpoint, request field, and response field is taken from CrowdStrike's
published surface (developer.crowdstrike.com API reference, FalconPy endpoint
definitions, and the swagger-generated gofalcon models). Required API scope is
documented in each tool description.

Deliberately not implemented:
- Detects API: decommissioned 2025-09-30, superseded by Alerts.
- CrowdScore Incidents API and behaviors: decommissioned 2026-03-09 and removed
  from the developer center entirely. Case Management is CrowdStrike's
  replacement, so its two documented read operations are implemented instead.
- Case create/update/merge: the swagger types case `status` and
  `severity_info.level` as bare strings with no enum, so a correct write cannot
  be built without guessing.

CrowdStrike answers 200 with a populated `errors` array for partial failures.
Responses now surface those per-item errors, and an empty result set carrying
errors is reported as a failure rather than silently succeeding.

The route's shared Falcon client, response normalizers, and operation dispatch
move into colocated modules so the handler stays readable at 23 operations.
…g the IOC delete filter

Validation pass over all 23 tools against CrowdStrike's swagger-generated SDKs
(gofalcon falcon/models + falcon/client, FalconPy _endpoint/*.py) turned up four
real defects.

The Execute RTR Command dropdown offered `csrutil` and a bare `reg`. Neither is
a read-tier base command: CrowdStrike's own swagger description for
RTR_ExecuteCommand enumerates cat, cd, clear, env, eventlog, filehash, getsid,
help, history, ipconfig, ls, mount, netstat, ps, and "reg query". `csrutil`
appears nowhere in CrowdStrike's published surface, and `reg` alone is not a
base command — the registry variants are "reg query" (read) and "reg set"/"reg
delete" (Active Responder). Both entries are corrected everywhere they were
repeated: dropdown, tool description, and param description.

Delete Indicators showed a Filter input, declared the param, accepted it in the
contract, and implemented CrowdStrike's documented filter-takes-precedence rule
in the route — but the block never mapped the field into the tool call, so the
filter was silently discarded and a filter-only delete failed validation. The
`filter` case is now mapped alongside the ID list.

A 200 carrying only envelope errors was reported as HTTP 200 with success:false,
which reads as a success to anything inspecting status. Failures now adopt the
per-item error code the envelope supplies, falling back to 502.

Alert updates gain a first-class Remove Tags By Prefix field. The spelling was
previously unresolvable, so it was left to the raw action-parameter escape
hatch; CrowdStrike's swagger settles it as `remove_tags_by_prefix` in both the
PatchEntitiesAlertsV2 and PatchEntitiesAlertsV3 descriptions.

Case Management and Spotlight scopes now name the OAuth scope string
(case-templates:read, spotlight-vulnerabilities:read) alongside the label the
Falcon API client UI shows, so either rendering is findable.
…e the RTR outputs

The falcon.ts/normalize.ts/operations.ts split routed query_sensors through the
shared buildUrl helper, which skips only undefined. An empty filter or sort
string therefore emitted `?filter=` / `?sort=` where the pre-split route omitted
the param, sending Falcon an empty FQL expression. Reject blank values in the
contract instead, matching the newer operations.

Also surface the ten RTR fields the tools already return but the block never
declared, and broaden the block metadata past the original sensor-only surface.
@vercel

vercel Bot commented Aug 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 16, 2026 12:38am

Request Review

@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Adds live Falcon response actions (host containment, IOC create/update/delete, alert writes) and RTR on endpoints; mis-scoped credentials or bad filters can isolate hosts or change fleet-wide prevention behavior.

Overview
Expands CrowdStrike from three Identity Protection sensor tools to 23 operations across Alerts, host response, host groups, custom IOCs, Spotlight, read-only Real Time Response, Case Management, and the existing sensor APIs—aligned with the current Alerts and Cases APIs rather than decommissioned Detects/Incidents surfaces.

The query route is refactored into shared Falcon HTTP/auth helpers (falcon.ts), resource normalizers (normalize.ts), and an operation executor (operations.ts). Sensor paths now use the same client and treat CrowdStrike 200 envelopes with only errors as failures; successful and partial responses can include an errors array on outputs.

The block and docs add operation-specific subBlocks (FQL, pagination cursors vs offset, alert updates, host actions including containment, IOC lifecycle, RTR session flow), stricter param mapping (optional keys cleared so stale fields don’t leak across operations, dedicated delete filter, per-endpoint limit caps), new block outputs for RTR fields, templates/skills, and full action reference in crowdstrike.mdx.

Reviewed by Cursor Bugbot for commit badcb40. Configure here.

Comment thread apps/sim/lib/api/contracts/tools/crowdstrike.ts
@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR expands the CrowdStrike integration from Identity Protection sensor queries to a 23-tool Falcon suite.

  • Adds Alerts, host response, host groups, IOC Management, Spotlight, RTR, and Case Management operations.
  • Introduces shared Falcon request/envelope helpers and resource normalizers.
  • Extends contracts, block configuration, tool registration, generated metadata, tests, and integration documentation.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/api/tools/crowdstrike/query/operations.ts Implements the expanded Falcon operations and correctly distinguishes error-only query envelopes from successful empty results.
apps/sim/lib/api/contracts/tools/crowdstrike.ts Defines operation-specific request and response schemas, including enforced mutual exclusion for IOC pagination modes.
apps/sim/app/api/tools/crowdstrike/query/falcon.ts Centralizes authentication, Falcon requests, URL construction, pagination extraction, and envelope-error parsing.
apps/sim/app/api/tools/crowdstrike/query/normalize.ts Normalizes Falcon alert, IOC, vulnerability, host-group, and case records into stable tool outputs.
apps/sim/blocks/blocks/crowdstrike.ts Expands the CrowdStrike workflow block with operation-specific inputs, tool dispatch, and outputs.
apps/sim/app/api/tools/crowdstrike/query/operations.test.ts Covers the new operation flows and the fixes for both previously reported defects.

Sequence Diagram

sequenceDiagram
  participant W as Workflow Block
  participant T as CrowdStrike Tool
  participant R as CrowdStrike API Route
  participant F as Falcon API
  W->>T: Invoke selected operation
  T->>R: POST validated tool parameters
  R->>R: Validate operation contract
  R->>F: Authenticate and call Falcon endpoint
  F-->>R: Resource/error envelope
  R->>R: Normalize resources and envelope errors
  R-->>T: Typed operation output
  T-->>W: Workflow-visible result
Loading

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/sta..." | Re-trigger Greptile

Comment thread apps/sim/app/api/tools/crowdstrike/query/operations.ts
Comment thread apps/sim/lib/api/contracts/tools/crowdstrike.ts Outdated
…uard IOC pagination

Falcon can answer 200 with an errors array and no resources. The detail
operations already treated that as a failure, but the five query branches
returned an empty successful result, so a failed alert query read as a valid
no-match to the calling workflow.

Blank FQL rejection now covers the alert, host-group, indicator, vulnerability,
and case contracts too, not just sensors, and Query Indicators rejects offset
combined with after instead of forwarding a pagination pair CrowdStrike refuses.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit dd25265. Configure here.

…ropped output docs

The executor merges `tools.config.params` over the raw block inputs, so a key the
mapper omitted kept its raw subBlock value — and an untouched subBlock is stored
as `null`, which the route contract rejects. Query Alerts with an empty Filter,
Update Alerts without every optional field, and Delete Indicators without an
audit comment all 400'd before reaching CrowdStrike. Seed every optional key as
`undefined` so omission is authoritative, which also stops a value left over from
another operation riding along.

Shared output consts in `outputs.ts` were silently dropped from the generated
docs: the generator scans tool source and resolves consts only from `types.ts`,
so `errors`, `affected`, and `pagination` rows vanished from 17 tool pages and
every nested property row with them. Inline the literals.

Against CrowdStrike's own generated SDKs and developer portal:
- add csrutil, ifconfig, users, and the eventlog subcommand forms to the
  read-tier RTR base commands, matching PSFalcon's ValidateSet
- add detection_suppress/detection_unsuppress and cap host actions at the
  documented 100 ids
- cap the IOC search limit at the documented 500, not 2000
- correct the Cases scope to "Cases: Read"; case-templates guards a different
  collection
- type the IOC payload so a blank string cannot clear a stored field on PATCH
- send `MsaRangeSpec` bounds capitalized, as the spec serializes them
- fail the sensor and RTR-session-close paths on a 200 whose envelope carries
  only errors, and surface partial sensor errors
- give Delete Indicators its own filter so a stale alert query cannot widen it
- drop the pre-selected network-isolating host action
…epth

# Conflicts:
#	apps/sim/tools/generated/tool-ids.ts
#	apps/sim/tools/generated/tool-metadata.ts
#	apps/sim/tools/generated/tool-outputs.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit badcb40. Configure here.

localIp: getString(hostInfo.local_ip),
machineDomain: getString(hostInfo.machine_domain),
osVersion: getString(hostInfo.os_version),
platform: getString(hostInfo.platform),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong vulnerability platform field

Medium Severity

normalizeVulnerability reads host_info.platform, but Spotlight exposes the host platform as platform_name (matching the FQL field host_info.platform_name documented elsewhere in this change). Vulnerability details therefore return hostInfo.platform as null even when Falcon includes platform data.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit badcb40. Configure here.

comment: nonBlankQuerySchema('Comment'),
retrodetects: z.boolean().optional(),
ignoreWarnings: z.boolean().optional(),
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indicator updates skip required id

High Severity

updateIndicatorsSchema reuses indicatorPayloadSchema, where id is optional. The update tool docs require each entry to include id, but the contract accepts id-less PATCH payloads. Those requests can fail late at Falcon or apply unclear updates to fleet prevention indicators.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit badcb40. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant