terraform.azure.best-practice.azure-functionapps-accessible-over-https.azure-functionapps-accessible-over-https
semgrep
Author
unknown
Download Count*
License
Ensure that HTTP Version is the latest if used to run the Function app
Run Locally
Run in CI
Defintion
rules:
- id: azure-functionapps-accessible-over-https
message: Ensure that HTTP Version is the latest if used to run the Function app
patterns:
- pattern: resource
- pattern-not-inside: |
resource "azurerm_app_service" "..." {
...
https_only = true
...
}
- pattern-inside: |
resource "azurerm_app_service" "..." {
...
}
metadata:
category: best-practice
technology:
- terraform
- azure
license: Commons Clause License Condition v1.0[LGPL-2.1-only]
languages:
- hcl
severity: WARNING
Examples
azure-functionapps-accessible-over-https.tf
# fail
# ruleid: azure-functionapps-accessible-over-https
resource "azurerm_app_service" "example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
https_only = false
}
# fail
# ruleid: azure-functionapps-accessible-over-https
resource "azurerm_app_service" "example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
}
# pass
resource "azurerm_app_service" "example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
https_only = true
}
Short Link: https://sg.run/1gBw