github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/rules/cloud/policies/aws/apigateway/enable_access_logging.tf.go (about)

     1  package apigateway
     2  
     3  var terraformEnableAccessLoggingGoodExamples = []string{
     4  	`
     5   resource "aws_apigatewayv2_stage" "good_example" {
     6     api_id = aws_apigatewayv2_api.example.id
     7     name   = "example-stage"
     8   
     9     access_log_settings {
    10      destination_arn = "arn:aws:logs:region:0123456789:log-group:access_logging"
    11      format          = "json"
    12     }
    13   }
    14   
    15   resource "aws_api_gateway_stage" "good_example" {
    16     deployment_id = aws_api_gateway_deployment.example.id
    17     rest_api_id   = aws_api_gateway_rest_api.example.id
    18     stage_name    = "example"
    19   
    20     access_log_settings {
    21       destination_arn = "arn:aws:logs:region:0123456789:log-group:access_logging"
    22       format          = "json"
    23     }
    24   }
    25   `,
    26  }
    27  
    28  var terraformEnableAccessLoggingBadExamples = []string{
    29  	`
    30   resource "aws_apigatewayv2_stage" "bad_example" {
    31     api_id = aws_apigatewayv2_api.example.id
    32     name   = "example-stage"
    33   }
    34   
    35   resource "aws_apigatewayv2_stage" "bad_example" {
    36     deployment_id = aws_api_gateway_deployment.example.id
    37     rest_api_id   = aws_api_gateway_rest_api.example.id
    38     stage_name    = "example"
    39   }
    40   `,
    41  }
    42  
    43  var terraformEnableAccessLoggingLinks = []string{
    44  	`https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_stage#access_log_settings`,
    45  }
    46  
    47  var terraformEnableAccessLoggingRemediationMarkdown = ``