github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/rules/cloud/policies/azure/database/postgres_configuration_log_connections.tf.go (about)

     1  package database
     2  
     3  var terraformPostgresConfigurationLogConnectionsGoodExamples = []string{
     4  	`
     5   resource "azurerm_resource_group" "example" {
     6     name     = "example-resources"
     7     location = "West Europe"
     8   }
     9   
    10   resource "azurerm_postgresql_server" "example" {
    11     name                = "example-psqlserver"
    12     location            = azurerm_resource_group.example.location
    13     resource_group_name = azurerm_resource_group.example.name
    14   
    15     administrator_login          = "psqladminun"
    16     administrator_login_password = "H@Sh1CoR3!"
    17   
    18     sku_name   = "GP_Gen5_4"
    19     version    = "9.6"
    20     storage_mb = 640000
    21   }
    22   
    23   resource "azurerm_postgresql_configuration" "example" {
    24   	name                = "log_connections"
    25   	resource_group_name = azurerm_resource_group.example.name
    26   	server_name         = azurerm_postgresql_server.example.name
    27   	value               = "on"
    28     }
    29     
    30     `,
    31  }
    32  
    33  var terraformPostgresConfigurationLogConnectionsBadExamples = []string{
    34  	`
    35   resource "azurerm_resource_group" "example" {
    36     name     = "example-resources"
    37     location = "West Europe"
    38   }
    39   
    40   resource "azurerm_postgresql_server" "example" {
    41     name                = "example-psqlserver"
    42     location            = azurerm_resource_group.example.location
    43     resource_group_name = azurerm_resource_group.example.name
    44   
    45     administrator_login          = "psqladminun"
    46     administrator_login_password = "H@Sh1CoR3!"
    47   
    48     sku_name   = "GP_Gen5_4"
    49     version    = "9.6"
    50     storage_mb = 640000
    51   }
    52   `,
    53  }
    54  
    55  var terraformPostgresConfigurationLogConnectionsLinks = []string{
    56  	`https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_configuration`, `https://docs.microsoft.com/en-us/azure/postgresql/concepts-server-logs#configure-logging`,
    57  }
    58  
    59  var terraformPostgresConfigurationLogConnectionsRemediationMarkdown = ``