prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Azure Function App Slots - Ensure web app redirects all HTTP traffic to HTTPS in Azure Function App Slots
  **Describe the issue**
  It seems that there are no checks that ensure that the following resource only allows HTTPS:
  
  - azurerm_function_app_slot
  - azurerm_linux_function_app_slot
  - azurerm_windows_function_app_slot
  
  **Examples**
  
  ````hcl
  resource "azurerm_function_app_slot" "example" {
    name                       = "test-azure-functions_slot"
    location                   = azurerm_resource_group.example.location
    resource_group_name        = azurerm_resource_group.example.name
    app_service_plan_id        = azurerm_app_service_plan.example.id
    function_app_name          = azurerm_function_app.example.name
    storage_account_name       = azurerm_storage_account.example.name
    storage_account_access_key = azurerm_storage_account.example.primary_access_key
    https_only                = true
  }
  
  resource "azurerm_linux_function_app_slot" "example" {
    name                 = "example-linux-function-app-slot"
    function_app_id      = azurerm_linux_function_app.example.id
    storage_account_name = azurerm_storage_account.example.name
  
    site_config {
      require_https = true 
    }
  }
  
  resource "azurerm_windows_function_app" "example" {
    name                 = "example-windows-function-app"
    resource_group_name  = azurerm_resource_group.example.name
    location             = azurerm_resource_group.example.location
    storage_account_name = azurerm_storage_account.example.name
    service_plan_id      = azurerm_service_plan.example.id
  
    site_config {
      require_https = true 
    }
  }
  
  ````
  
  **Version (please complete the following information):**
   - N/A
   
  **Additional context**
  
  N/A
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `checkov/terraform/checks/resource/azure/FunctionAppsAccessibleOverHttps.py`
  Content:
  ```
  1 from checkov.common.models.enums import CheckCategories
  2 from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
  3 
  4 
  5 class FunctionAppsAccessibleOverHttps(BaseResourceValueCheck):
  6     def __init__(self):
  7         name = "Ensure that Function apps is only accessible over HTTPS"
  8         id = "CKV_AZURE_70"
  9         supported_resources = ['azurerm_function_app']
  10         categories = [CheckCategories.NETWORKING]
  11         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
  12 
  13     def get_inspected_key(self):
  14         return 'https_only'
  15 
  16 
  17 check = FunctionAppsAccessibleOverHttps()
  18
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/checkov/terraform/checks/resource/azure/FunctionAppsAccessibleOverHttps.py b/checkov/terraform/checks/resource/azure/FunctionAppsAccessibleOverHttps.py
  --- a/checkov/terraform/checks/resource/azure/FunctionAppsAccessibleOverHttps.py
  +++ b/checkov/terraform/checks/resource/azure/FunctionAppsAccessibleOverHttps.py
  @@ -1,17 +1,44 @@
  -from checkov.common.models.enums import CheckCategories
  -from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
  +from __future__ import annotations
   
  +from typing import Any
   
  -class FunctionAppsAccessibleOverHttps(BaseResourceValueCheck):
  -    def __init__(self):
  +from checkov.common.models.enums import CheckCategories, CheckResult
  +from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
  +
  +
  +class FunctionAppsAccessibleOverHttps(BaseResourceCheck):
  +
  +    def __init__(self) -> None:
           name = "Ensure that Function apps is only accessible over HTTPS"
           id = "CKV_AZURE_70"
  -        supported_resources = ['azurerm_function_app']
  +        supported_resources = ['azurerm_function_app', 'azurerm_linux_function_app', 'azurerm_windows_function_app',
  +                               'azurerm_function_app_slot', 'azurerm_linux_function_app_slot',
  +                               'azurerm_windows_function_app_slot']
           categories = [CheckCategories.NETWORKING]
           super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
   
  -    def get_inspected_key(self):
  -        return 'https_only'
  +    def scan_resource_conf(self, conf: dict[str, list[Any]]) -> CheckResult:
  +        # default=false for https_only
  +        if 'https_only' not in conf.keys():
  +            return CheckResult.FAILED
  +
  +        https_only = conf.get('https_only')[0]
  +        if not https_only:
  +            return CheckResult.FAILED
  +
  +        # relevant for linux/windows resources
  +        if 'auth_settings_v2' in conf.keys():
  +            auth_settings_v2 = conf['auth_settings_v2'][0]
  +
  +            # default=true for require_https
  +            if 'require_https' not in auth_settings_v2.keys():
  +                return CheckResult.PASSED
  +
  +            require_https = auth_settings_v2.get('require_https')[0]
  +            if not require_https:
  +                return CheckResult.FAILED
  +
  +        return CheckResult.PASSED
   
   
   check = FunctionAppsAccessibleOverHttps()
  
verification_info: {"golden_diff": "diff --git a/checkov/terraform/checks/resource/azure/FunctionAppsAccessibleOverHttps.py b/checkov/terraform/checks/resource/azure/FunctionAppsAccessibleOverHttps.py\n--- a/checkov/terraform/checks/resource/azure/FunctionAppsAccessibleOverHttps.py\n+++ b/checkov/terraform/checks/resource/azure/FunctionAppsAccessibleOverHttps.py\n@@ -1,17 +1,44 @@\n-from checkov.common.models.enums import CheckCategories\n-from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck\n+from __future__ import annotations\n \n+from typing import Any\n \n-class FunctionAppsAccessibleOverHttps(BaseResourceValueCheck):\n-    def __init__(self):\n+from checkov.common.models.enums import CheckCategories, CheckResult\n+from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n+\n+\n+class FunctionAppsAccessibleOverHttps(BaseResourceCheck):\n+\n+    def __init__(self) -> None:\n         name = \"Ensure that Function apps is only accessible over HTTPS\"\n         id = \"CKV_AZURE_70\"\n-        supported_resources = ['azurerm_function_app']\n+        supported_resources = ['azurerm_function_app', 'azurerm_linux_function_app', 'azurerm_windows_function_app',\n+                               'azurerm_function_app_slot', 'azurerm_linux_function_app_slot',\n+                               'azurerm_windows_function_app_slot']\n         categories = [CheckCategories.NETWORKING]\n         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n \n-    def get_inspected_key(self):\n-        return 'https_only'\n+    def scan_resource_conf(self, conf: dict[str, list[Any]]) -> CheckResult:\n+        # default=false for https_only\n+        if 'https_only' not in conf.keys():\n+            return CheckResult.FAILED\n+\n+        https_only = conf.get('https_only')[0]\n+        if not https_only:\n+            return CheckResult.FAILED\n+\n+        # relevant for linux/windows resources\n+        if 'auth_settings_v2' in conf.keys():\n+            auth_settings_v2 = conf['auth_settings_v2'][0]\n+\n+            # default=true for require_https\n+            if 'require_https' not in auth_settings_v2.keys():\n+                return CheckResult.PASSED\n+\n+            require_https = auth_settings_v2.get('require_https')[0]\n+            if not require_https:\n+                return CheckResult.FAILED\n+\n+        return CheckResult.PASSED\n \n \n check = FunctionAppsAccessibleOverHttps()\n", "issue": "Azure Function App Slots - Ensure web app redirects all HTTP traffic to HTTPS in Azure Function App Slots\n**Describe the issue**\r\nIt seems that there are no checks that ensure that the following resource only allows HTTPS:\r\n\r\n- azurerm_function_app_slot\r\n- azurerm_linux_function_app_slot\r\n- azurerm_windows_function_app_slot\r\n\r\n**Examples**\r\n\r\n````hcl\r\nresource \"azurerm_function_app_slot\" \"example\" {\r\n  name                       = \"test-azure-functions_slot\"\r\n  location                   = azurerm_resource_group.example.location\r\n  resource_group_name        = azurerm_resource_group.example.name\r\n  app_service_plan_id        = azurerm_app_service_plan.example.id\r\n  function_app_name          = azurerm_function_app.example.name\r\n  storage_account_name       = azurerm_storage_account.example.name\r\n  storage_account_access_key = azurerm_storage_account.example.primary_access_key\r\n  https_only                = true\r\n}\r\n\r\nresource \"azurerm_linux_function_app_slot\" \"example\" {\r\n  name                 = \"example-linux-function-app-slot\"\r\n  function_app_id      = azurerm_linux_function_app.example.id\r\n  storage_account_name = azurerm_storage_account.example.name\r\n\r\n  site_config {\r\n    require_https = true \r\n  }\r\n}\r\n\r\nresource \"azurerm_windows_function_app\" \"example\" {\r\n  name                 = \"example-windows-function-app\"\r\n  resource_group_name  = azurerm_resource_group.example.name\r\n  location             = azurerm_resource_group.example.location\r\n  storage_account_name = azurerm_storage_account.example.name\r\n  service_plan_id      = azurerm_service_plan.example.id\r\n\r\n  site_config {\r\n    require_https = true \r\n  }\r\n}\r\n\r\n````\r\n\r\n**Version (please complete the following information):**\r\n - N/A\r\n \r\n**Additional context**\r\n\r\nN/A\n", "before_files": [{"content": "from checkov.common.models.enums import CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck\n\n\nclass FunctionAppsAccessibleOverHttps(BaseResourceValueCheck):\n    def __init__(self):\n        name = \"Ensure that Function apps is only accessible over HTTPS\"\n        id = \"CKV_AZURE_70\"\n        supported_resources = ['azurerm_function_app']\n        categories = [CheckCategories.NETWORKING]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def get_inspected_key(self):\n        return 'https_only'\n\n\ncheck = FunctionAppsAccessibleOverHttps()\n", "path": "checkov/terraform/checks/resource/azure/FunctionAppsAccessibleOverHttps.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom typing import Any\n\nfrom checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n\nclass FunctionAppsAccessibleOverHttps(BaseResourceCheck):\n\n    def __init__(self) -> None:\n        name = \"Ensure that Function apps is only accessible over HTTPS\"\n        id = \"CKV_AZURE_70\"\n        supported_resources = ['azurerm_function_app', 'azurerm_linux_function_app', 'azurerm_windows_function_app',\n                               'azurerm_function_app_slot', 'azurerm_linux_function_app_slot',\n                               'azurerm_windows_function_app_slot']\n        categories = [CheckCategories.NETWORKING]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf: dict[str, list[Any]]) -> CheckResult:\n        # default=false for https_only\n        if 'https_only' not in conf.keys():\n            return CheckResult.FAILED\n\n        https_only = conf.get('https_only')[0]\n        if not https_only:\n            return CheckResult.FAILED\n\n        # relevant for linux/windows resources\n        if 'auth_settings_v2' in conf.keys():\n            auth_settings_v2 = conf['auth_settings_v2'][0]\n\n            # default=true for require_https\n            if 'require_https' not in auth_settings_v2.keys():\n                return CheckResult.PASSED\n\n            require_https = auth_settings_v2.get('require_https')[0]\n            if not require_https:\n                return CheckResult.FAILED\n\n        return CheckResult.PASSED\n\n\ncheck = FunctionAppsAccessibleOverHttps()\n", "path": "checkov/terraform/checks/resource/azure/FunctionAppsAccessibleOverHttps.py"}]}