github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/rules/cloud/policies/aws/apigateway/enable_cache_encryption.tf.go (about) 1 package apigateway 2 3 var terraformEnableCacheEncryptionGoodExamples = []string{ 4 ` 5 resource "aws_api_gateway_rest_api" "example" { 6 7 } 8 9 resource "aws_api_gateway_stage" "example" { 10 11 } 12 13 resource "aws_api_gateway_method_settings" "good_example" { 14 rest_api_id = aws_api_gateway_rest_api.example.id 15 stage_name = aws_api_gateway_stage.example.stage_name 16 method_path = "path1/GET" 17 18 settings { 19 metrics_enabled = true 20 logging_level = "INFO" 21 caching_enabled = true 22 cache_data_encrypted = true 23 } 24 } 25 `, 26 } 27 28 var terraformEnableCacheEncryptionBadExamples = []string{ 29 ` 30 resource "aws_api_gateway_rest_api" "example" { 31 32 } 33 34 resource "aws_api_gateway_stage" "example" { 35 rest_api_id = aws_api_gateway_rest_api.example.id 36 } 37 38 resource "aws_api_gateway_method_settings" "bad_example" { 39 rest_api_id = aws_api_gateway_rest_api.example.id 40 stage_name = aws_api_gateway_stage.example.stage_name 41 method_path = "path1/GET" 42 43 settings { 44 metrics_enabled = true 45 logging_level = "INFO" 46 caching_enabled = true 47 cache_data_encrypted = false 48 } 49 } 50 `, 51 } 52 53 var terraformEnableCacheEncryptionLinks = []string{ 54 `https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_method_settings#cache_data_encrypted`, 55 } 56 57 var terraformEnableCacheEncryptionRemediationMarkdown = ``