Closed nickbabkin closed 2 years ago
IIRC, this is an issue with "enabled": false
in the overrides disabling all the others because the value was modified at one time or another. From memory, the solution is that you should now explicitly send it set the true since the value has been modified (aka, it doesn’t happen if you haven’t changed it previously).
@vences do you recall?
(if it is, this is a known thing with using booleans as zero, optional and default values in Terraform)
@jacobbednarz this is correct, setting enabled: true
under overrides helped.
However, it has now enabled all the rules. How can I use default cloudflare rule settings (the ones managed by CF security team) combined with couple custom overrides?
Basically, now I have two options: 1) Either use default cloudflare recommended settings with no overrides at all 2) Apply custom overrides while enabling all the rules (even the rules that are recommended to be disabled by Cloudflare)
Any way out of this misery ? :)
Its worth noting in this thread, that the implications to the end user can be somewhat catastrophic. As was mentioned here, the first time we applied our template w/o including enable
, the ruleset was created and everything worked. But on subsequent deployments of the same template enabled: false
was injected. We didnt catch this and our Production WAF was disabled for months. To further complicate matters, the Portal UI clearly shows everything is enabled. It wasnt until I queried the rulesets via the API that I discovered why we hadnt seen a single rule trip. Its no fun having to explain to your CISO that your shiny new WAF has been off for months. Its even less fun to explain that Cloudflare knew this was an issue.
This functionality has been released in v3.17.0 of the Terraform Cloudflare Provider.
Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!
Confirmation
Terraform and Cloudflare provider version
terraform -v Terraform v1.1.3 on darwin_amd64
Affected resource(s)
cloudflare_ruleset
Terraform configuration files
Debug output
PLAN:
APPLY:
Panic output
No response
Expected output
We expect only the override to be applied
Actual output
All rules that were enabled by default in the ruleset get disabled
Steps to reproduce
Additional factoids
No response
References
No response