fix(secure): deprecate dead rule resources (container/filesystem/network/process/syscall)#734
Open
ivanlysiuk-sysdig wants to merge 2 commits into
Open
Conversation
…work/process/syscall) These resources + data sources translate to ruleType values (CONTAINER / FILESYSTEM / NETWORK / PROCESS / SYSCALL) that the Sysdig backend stopped accepting when list-matching policy code was removed in SSPROD-66298 (see draios/secure-backend#55421). The backend's RuntimePolicyRule.UnmarshalJSON now rejects them with HTTP 400 "unknown ruleType: <type>". Repro on a fresh OnPrem stack with secure/policies main HEAD: $ curl -X POST .../api/secure/rules \ -d '{"details":{"ruleType":"CONTAINER",...}}' HTTP 400: "The field details has an unknown ruleType: CONTAINER" Same for FILESYSTEM / NETWORK / PROCESS / SYSCALL. Mark them deprecated via Schema.DeprecationMessage so users see a clear plan/apply-time warning pointing at sysdig_secure_rule_falco. Existing state plans aren't broken; new Create calls would still 400 (no way to prevent that without removing the resources entirely, which is a bigger breaking change that should land with a major version bump). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR deprecates five legacy “sub-type” Secure rule resources and their matching data sources (container, filesystem, network, process, syscall) that no longer work with current Sysdig backends (backend rejects those ruleType values). Deprecation is implemented via schema.Resource.DeprecationMessage so Terraform surfaces an explicit warning and points users to sysdig_secure_rule_falco.
Changes:
- Added
DeprecationMessagetosysdig_secure_rule_{container,filesystem,network,process,syscall}resources. - Added
DeprecationMessagetosysdig_secure_rule_{container,filesystem,network,process,syscall}data sources. - Deprecation messages include migration guidance and tracking reference (SSPROD-68481).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sysdig/resource_sysdig_secure_rule_container.go | Deprecates the container rule resource with migration guidance to Falco rules. |
| sysdig/resource_sysdig_secure_rule_filesystem.go | Deprecates the filesystem rule resource with migration guidance to Falco rules. |
| sysdig/resource_sysdig_secure_rule_network.go | Deprecates the network rule resource with migration guidance to Falco rules. |
| sysdig/resource_sysdig_secure_rule_process.go | Deprecates the process rule resource with migration guidance to Falco rules. |
| sysdig/resource_sysdig_secure_rule_syscall.go | Deprecates the syscall rule resource with migration guidance to Falco rules. |
| sysdig/data_source_sysdig_secure_rule_container.go | Deprecates the container rule data source and points to the Falco data source. |
| sysdig/data_source_sysdig_secure_rule_filesystem.go | Deprecates the filesystem rule data source and points to the Falco data source. |
| sysdig/data_source_sysdig_secure_rule_network.go | Deprecates the network rule data source and points to the Falco data source. |
| sysdig/data_source_sysdig_secure_rule_process.go | Deprecates the process rule data source and points to the Falco data source. |
| sysdig/data_source_sysdig_secure_rule_syscall.go | Deprecates the syscall rule data source and points to the Falco data source. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Open-source repo convention — keep the user-visible warning focused on what to migrate to, not on the internal ticket that motivated the change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
legobrick
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five sub-type rule resources and their matching data sources —
sysdig_secure_rule_container,_filesystem,_network,_process,_syscall— are broken end-to-end against current Sysdig backends. TheirCreate/Updatecalls hitPOST /api/secure/ruleswithruleTypevalues (CONTAINER,FILESYSTEM,NETWORK,PROCESS,SYSCALL) that the backend stopped accepting when list-matching policy code was removed. The endpoint returns HTTP 400"unknown ruleType: <type>".This adds
Schema.DeprecationMessageon the resource and data source definitions so users see a clearterraform plan/apply-time warning pointing them atsysdig_secure_rule_falco.Repro
Against a fresh Sysdig stack:
Same for
FILESYSTEM/NETWORK/PROCESS/SYSCALL.The modern backend rule unmarshaller only accepts:
FALCO,DRIFT,MACHINE_LEARNING,AWS_MACHINE_LEARNING,MALWARE,OKTA_MACHINE_LEARNING,FIM.Changes
sysdig/resource_sysdig_secure_rule_{container,filesystem,network,process,syscall}.goDeprecationMessageon the returnedschema.Resource.sysdig/data_source_sysdig_secure_rule_{container,filesystem,network,process,syscall}.goNet: +35, -25. Pure metadata change — no behavior change beyond Terraform surfacing the deprecation banner.
What users see
When
sysdig_secure_rule_container(etc.) appears in a config:Why not remove
Outright removal would be a breaking change for anyone with these resources in state (
terraform planwould error out before they can migrate). Deprecation now warns users; a follow-up at a major-version bump can remove them.Why not restore backend support
The structured ruleTypes were tied to the (now-removed) list-matching code path. Re-introducing them would resurrect that surface. Out of scope.
Test plan
go build ./...— cleango vet ./sysdig/...— cleangofmt -l sysdig/...— clean🤖 Generated with Claude Code