Skip to content

fix(ioa_rule_group): accept windows ruletype_id 5 on read#401

Draft
yoclaire wants to merge 1 commit into
CrowdStrike:mainfrom
yoclaire:claireyoung/windows-ruletype-5-on-read
Draft

fix(ioa_rule_group): accept windows ruletype_id 5 on read#401
yoclaire wants to merge 1 commit into
CrowdStrike:mainfrom
yoclaire:claireyoung/windows-ruletype-5-on-read

Conversation

@yoclaire
Copy link
Copy Markdown
Contributor

Closes #400.

Adds a read-side alias map (ruleTypeReadAliasMap) so multiple Falcon API rule-type IDs can collapse to one Terraform type enum value on read. Concrete case: Windows Process Creation rules created outside the provider can carry ruletype_id = "5" (the provider writes "1"); the read path previously errored with "Unknown rule type ID" on terraform plan / import.

Write path is unchanged — ruleTypeIDMap still owns one canonical API ID per Terraform type, and the schema OneOf validator at ioa_rule_group_resource.go:502 still pins users to the four canonical type names. The alias map only affects round-trip on read/import/refresh.

Tested with go test ./... (all packages pass). Did not run make acctest — requires FALCON_CLIENT_ID / FALCON_CLIENT_SECRET.

See #400 for the original error text, repro, and a more general "type → list of API ids" shape that could replace this if more aliases turn up across platforms. This PR keeps the change minimal and scoped to the observed Windows/5 case.

Some Falcon-side Windows Process Creation rules carry ruletype_id 5
(vs the canonical 1 the provider writes). The flat name->ID map shape
in ruleTypeIDMap cannot express the alias, so the inverted read map
misses on these rules and the resource errors with "Unknown rule type
ID". Adds a separate read-side alias map so multiple API IDs can
collapse to one Terraform schema enum on read; writes are unaffected.

Closes CrowdStrike#400
@yoclaire yoclaire force-pushed the claireyoung/windows-ruletype-5-on-read branch from 997c288 to 3f9bdbf Compare May 21, 2026 20:10
@yoclaire yoclaire changed the title fix(ioa_rule_group): accept windows ruletype_id 5 on read as Process Creation fix(ioa_rule_group): accept windows ruletype_id 5 on read May 21, 2026
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.

crowdstrike_ioa_rule_group read fails on Windows rules with ruletype_id=5 ("Unknown rule type ID")

1 participant