-
Notifications
You must be signed in to change notification settings - Fork 550
bug: apigateway/api_gw_cache_encrypted.sql opposite condition #13761
Copy link
Copy link
Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
APIGateway.5 control says:
The control fails if any method in an API Gateway REST API stage is configured to cache and the cache is not encrypted.
But current sql would got be 'pass'. It is correct if 'fail' when caching enabled and encrypted disabled.
Expected Behavior
Patch it works:
diff --git a/plugins/source/aws/policies/queries/apigateway/api_gw_cache_encrypted.sql b/plugins/source/aws/policies/queries/apigateway/api_gw_cache_encrypted.sql
index 2bd54a0ce..a935298be 100644
--- a/plugins/source/aws/policies/queries/apigateway/api_gw_cache_encrypted.sql
+++ b/plugins/source/aws/policies/queries/apigateway/api_gw_cache_encrypted.sql
@@ -8,11 +8,11 @@ select
arn as resource_id,
case
when stage_caching_enabled is true
- or (
+ and (
caching_enabled is true
and cache_data_encrypted is not true
- ) then 'pass'
- else 'fail'
+ ) then 'fail'
+ else 'pass'
end as status
from
view_aws_apigateway_method_settings
CloudQuery (redacted) config
N/A
Steps To Reproduce
No response
CloudQuery (redacted) logs
N/A
CloudQuery version
main
Additional Context
No response
Pull request (optional)
- I can submit a pull request
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels