terraform.azure.security.azure-redis-cache-enable-non-ssl-port.azure-redis-cache-enable-non-ssl-port
semgrep
Author
unknown
Download Count*
License
Ensure that only SSL are enabled for Cache for Redis
Run Locally
Run in CI
Defintion
rules:
- id: azure-redis-cache-enable-non-ssl-port
message: Ensure that only SSL are enabled for Cache for Redis
patterns:
- pattern: resource
- pattern-inside: |
resource "azurerm_redis_cache" "..." {
...
enable_non_ssl_port = true
...
}
metadata:
owasp:
- A03:2017 - Sensitive Data Exposure
- A02:2021 - Cryptographic Failures
cwe:
- "CWE-319: Cleartext Transmission of Sensitive Information"
category: security
technology:
- terraform
- azure
references:
- https://owasp.org/Top10/A02_2021-Cryptographic_Failures
subcategory:
- audit
likelihood: LOW
impact: LOW
confidence: LOW
license: Commons Clause License Condition v1.0[LGPL-2.1-only]
vulnerability_class:
- Mishandled Sensitive Information
languages:
- hcl
severity: WARNING
Examples
azure-redis-cache-enable-non-ssl-port.tf
# fail
# ruleid: azure-redis-cache-enable-non-ssl-port
resource "azurerm_redis_cache" "example" {
name = "example-cache"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
capacity = 2
family = "C"
sku_name = "Standard"
enable_non_ssl_port = true
minimum_tls_version = "1.2"
public_network_access_enabled = true
redis_configuration {
}
}
# pass
resource "azurerm_redis_cache" "example" {
name = "example-cache"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
capacity = 2
family = "C"
sku_name = "Standard"
enable_non_ssl_port = false
minimum_tls_version = "1.2"
public_network_access_enabled = true
redis_configuration {
}
}
# pass
resource "azurerm_redis_cache" "example" {
name = "example-cache"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
capacity = 2
family = "C"
sku_name = "Standard"
minimum_tls_version = "1.2"
redis_configuration {
}
}
Short Link: https://sg.run/5e46