Skip to content

Fix execute.py response parsing for real API shapes - #7

Open
mraible wants to merge 4 commits into
eth0izzle:mainfrom
CrowdStrike:fix/execute-response-parsing
Open

Fix execute.py response parsing for real API shapes#7
mraible wants to merge 4 commits into
eth0izzle:mainfrom
CrowdStrike:fix/execute-response-parsing

Conversation

@mraible

@mraible mraible commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Fixes two bugs in execute.py that prevented --wait from working, both confirmed against live workflow executions.

1. execute_workflow() crashed on the real response shape. The execute endpoint returns resources as a list of bare execution-ID strings, but the code called resources[0].get("id"), raising 'str' object has no attribute 'get'. Now handles both the string and object shapes.

2. poll_results() never detected terminal status. It checked status in ("completed", "failed", "error"), but the execution-results API returns capitalized values (Succeeded, Failed, Canceled, NonRecoverable, ActionRequired — per references/best-practices.md). A finished run never matched, so polling always ran until timeout. Now matches the documented statuses case-insensitively.

The existing tests asserted fictional lowercase statuses (completed, running) that the platform never returns, so they passed while the code was broken. Updated them to real API casing and added coverage for the bare-string execution ID.

Verified against live executions in a test CID: execution IDs parse correctly and polling transitions In progressFailed/Succeeded and stops. All 84 tests pass.

mraible added 4 commits May 19, 2026 10:25
…ion (#4)

* Add Fusion SOAR JSON structure reference from Charlotte team

Authoritative BPMN-based JSON schema doc covering the internal workflow
model: triggers, activities, flows, gateways, submodels (loops), CEL
extensions (cs.* functions), data references, custom variables, and
three complete examples. Updates SKILL.md to reference the new doc
when authoring workflows.

* Add local structural validation to validate.py

Adds a structural_check() step between pre-flight and API validation
that catches schema errors without needing API credentials. Validates:
action IDs are 32-char hex, actions have required id/name fields,
class-based actions include version_constraint, trigger type is valid,
next references resolve to defined labels, loop for.input matches a
trigger parameter, and data references have balanced brackets.

Also adds PyYAML to requirements.txt (needed for yaml.safe_load) and
11 new tests covering each validation rule (93 total, all passing).

* Bump dependencies to latest versions

crowdstrike-falconpy 1.6.1 → 1.6.2
pytest 9.0.2 → 9.0.3
PyYAML 6.0.2 → 6.0.3
* Fix README install instructions

- Replace generic SKILL-NAME placeholder with actual plugin name (fusion-workflows)
- Add CrowdStrike fork as primary install option with latest improvements
- Keep upstream (eth0izzle) as stable alternative
- Clarify that both repos provide the same plugin with two skills
- Update manual install to show both repo options

* Keep upstream repo URL, fix only the SKILL-NAME placeholder

Revert CrowdStrike fork references. The actual bug was the generic
SKILL-NAME placeholder, which is now replaced with the real plugin
name (fusion-workflows) and a note about the two skills it provides.

* Remove .git suffix from marketplace add command

The /plugin marketplace add command takes the bare repo URL without
the .git suffix. The git clone command in Manual Setup keeps it.
Real Fusion SOAR playbooks exported from the CrowdStrike Content Library
with real action IDs. The import logic detects non-global actions and
prompts users to configure integrations or substitute available actions.

Categories:
- threat-intel: VirusTotal domain/URL enrichment + Zscaler blocklist
- identity-response: brute force auto-resolution, phishing with ITP
- notifications: Slack messaging, endpoint containment with approval
- ngsiem: duplicate detection auto-close
- response-actions: 6 Palo Alto NGFW EDL/DAG playbooks
- tutorials: 6 Introduction to... concept playbooks

CrowdStrike-native action IDs are universal across all clouds.
Plugin actions (Slack, Zscaler, PAN NGFW) require the integration
installed from the CrowdStrike Store.
Two bugs in execute.py, both confirmed against live workflow executions:

- execute_workflow() assumed the execute endpoint returns resources as
  a list of dicts (resources[0].get('id')), but it returns bare
  execution-ID strings, crashing with 'str' object has no attribute 'get'.
  Now handles both shapes.
- poll_results() checked status in ('completed','failed','error'), but
  the execution-results API returns capitalized statuses
  (Succeeded/Failed/Canceled/NonRecoverable/ActionRequired per
  references/best-practices.md). A finished run never matched the terminal
  set, so polling always ran until timeout. Now matches the documented
  statuses case-insensitively.

Updated tests to use real API status casing and added coverage for the
bare-string execution ID.
@mraible

mraible commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@eth0izzle This PR has all the previous PRs I created in it because I branched from our fork's main. This was a mistake. Please let me know if you need me to rebase or fix conflicts.

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