Fix nil bootstrap_creator_admin_permissions treated as truthy by OPA#4
Conversation
…d is absent AWS omits BootstrapClusterCreatorAdminPermissions from the accessConfig response when the cluster uses API auth mode and the field is false. Returning nil caused the OPA policy to receive null, which is truthy, triggering a false violation.
|
Warning Review limit reached
More reviews will be available in 29 minutes and 58 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
clusterBootstrapCreatorAdminPermissionsreturned*boolnil when AWS omits the field from theaccessConfigresponseBootstrapClusterCreatorAdminPermissionswhen usingAPIauth mode and the value isfalsenullfor this field;object.getreturnsnull(not the default) when the key exists with value null, andnullis truthy in OPA — causing a false violationFix
Return
bool(not*bool) and default tofalsewhen the field is absent or nil.Test plan
go test ./internal/...passeseks_cluster_restrict_bootstrap_creator_adminnow passes for a cluster withbootstrap_creator_admin_permissions = falsein Terraform