Repository: bridgecrewio/checkov

Issue:
CKV_AZURE_103 not accepting vsts_configuration as valid Git repository
**Describe the bug**
The rule CKV_AZURE_103 only accepts the Github configuration for Git source control for an Azure Data Factory instance. However, it is possible to configure a Git source control using the `vsts_configuration`. 

**To Reproduce**
Steps to reproduce the behavior:
Create the following resource
```hcl
resource "azurerm_data_factory" "main" {

  # General
  name                = "dummy-name"
  resource_group_name = azurerm_resource_group.primary.name
  location            = azurerm_resource_group.primary.location

  # Azure DevOps
  vsts_configuration {
    account_name    = var.account_name
    branch_name     = var.branch_name
    project_name    = var.project_name
    repository_name = var.repository_name
    root_folder     = var.root_folder
    tenant_id       = data.azurerm_client_config.current.tenant_id
  }

}
```

**Expected behavior**
Expected to accept both vsts_configuration and github_configuration as valid Git source control configurations.

**Desktop (please complete the following information):**
 - OS: Ubuntu 20.04 LTS
 - Checkov Version 2.0.86


Discussion:

Resolving patch:
diff --git a/checkov/terraform/checks/resource/azure/DataFactoryUsesGitRepository.py b/checkov/terraform/checks/resource/azure/DataFactoryUsesGitRepository.py
--- a/checkov/terraform/checks/resource/azure/DataFactoryUsesGitRepository.py
+++ b/checkov/terraform/checks/resource/azure/DataFactoryUsesGitRepository.py
@@ -1,21 +1,25 @@
-from checkov.common.models.consts import ANY_VALUE
-from checkov.common.models.enums import CheckCategories
-from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
+from typing import Dict, List, Any
 
+from checkov.common.models.enums import CheckCategories, CheckResult
+from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
 
-class DataFactoryUsesGitRepository(BaseResourceValueCheck):
-    def __init__(self):
+
+class DataFactoryUsesGitRepository(BaseResourceCheck):
+    def __init__(self) -> None:
         name = "Ensure that Azure Data Factory uses Git repository for source control"
         id = "CKV_AZURE_103"
-        supported_resources = ['azurerm_data_factory']
+        supported_resources = ["azurerm_data_factory"]
         categories = [CheckCategories.GENERAL_SECURITY]
         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
 
-    def get_inspected_key(self):
-        return "github_configuration/[0]/repository_name"
-
-    def get_expected_value(self):
-        return ANY_VALUE
+    def scan_resource_conf(self, conf: Dict[str, List[Any]]) -> CheckResult:
+        github = conf.get("github_configuration", [{}])[0]
+        if github.get("repository_name"):
+            return CheckResult.PASSED
+        vsts = conf.get("vsts_configuration", [{}])[0]
+        if vsts.get("repository_name"):
+            return CheckResult.PASSED
+        return CheckResult.FAILED
 
 
 check = DataFactoryUsesGitRepository()


Test patch:
diff --git a/tests/terraform/checks/resource/azure/example_DataFactoryUsesGitRepository/main.tf b/tests/terraform/checks/resource/azure/example_DataFactoryUsesGitRepository/main.tf
new file mode 100644
--- /dev/null
+++ b/tests/terraform/checks/resource/azure/example_DataFactoryUsesGitRepository/main.tf
@@ -0,0 +1,38 @@
+# pass
+
+resource "azurerm_data_factory" "github" {
+  location            = azurerm_resource_group.example.location
+  name                = "example"
+  resource_group_name = azurerm_resource_group.example.name
+
+  github_configuration {
+    account_name    = "bridgecrewio"
+    branch_name     = "master"
+    git_url         = "https://github.com"
+    repository_name = "checkov"
+    root_folder     = "/"
+  }
+}
+
+resource "azurerm_data_factory" "vsts" {
+  location            = azurerm_resource_group.example.location
+  name                = "example"
+  resource_group_name = azurerm_resource_group.example.name
+
+  vsts_configuration {
+    account_name    = "bridgecrewio"
+    branch_name     = "master"
+    project_name    = "chechov"
+    repository_name = "checkov"
+    root_folder     = "/"
+    tenant_id       = "123456789"
+  }
+}
+
+# fail
+
+resource "azurerm_data_factory" "fail" {
+  location            = azurerm_resource_group.example.location
+  name                = "example"
+  resource_group_name = azurerm_resource_group.example.name
+}
diff --git a/tests/terraform/checks/resource/azure/test_DataFactoryUsesGitRepository.py b/tests/terraform/checks/resource/azure/test_DataFactoryUsesGitRepository.py
--- a/tests/terraform/checks/resource/azure/test_DataFactoryUsesGitRepository.py
+++ b/tests/terraform/checks/resource/azure/test_DataFactoryUsesGitRepository.py
@@ -1,40 +1,37 @@
 import unittest
+from pathlib import Path
 
-import hcl2
-
+from checkov.runner_filter import RunnerFilter
 from checkov.terraform.checks.resource.azure.DataFactoryUsesGitRepository import check
-from checkov.common.models.enums import CheckResult
+from checkov.terraform.runner import Runner
 
 
 class TestDataFactoryUsesGitRepository(unittest.TestCase):
+    def test(self):
+        test_files_dir = Path(__file__).parent / "example_DataFactoryUsesGitRepository"
+
+        report = Runner().run(root_folder=test_files_dir, runner_filter=RunnerFilter(checks=[check.id]))
+        summary = report.get_summary()
+
+        passing_resources = {
+            "azurerm_data_factory.github",
+            "azurerm_data_factory.vsts",
+        }
+        failing_resources = {
+            "azurerm_data_factory.fail",
+        }
+
+        passed_check_resources = {c.resource for c in report.passed_checks}
+        failed_check_resources = {c.resource for c in report.failed_checks}
+
+        self.assertEqual(summary["passed"], 2)
+        self.assertEqual(summary["failed"], 1)
+        self.assertEqual(summary["skipped"], 0)
+        self.assertEqual(summary["parsing_errors"], 0)
+
+        self.assertEqual(passing_resources, passed_check_resources)
+        self.assertEqual(failing_resources, failed_check_resources)
+
 
-    def test_failure(self):
-        hcl_res = hcl2.loads("""
-            resource "azurerm_data_factory" "example" {
-              name                = "example"
-              location            = azurerm_resource_group.example.location
-              resource_group_name = azurerm_resource_group.example.name
-            }
-                """)
-        resource_conf = hcl_res['resource'][0]['azurerm_data_factory']['example']
-        scan_result = check.scan_resource_conf(conf=resource_conf)
-        self.assertEqual(CheckResult.FAILED, scan_result)
-
-    def test_success(self):
-        hcl_res = hcl2.loads("""
-            resource "azurerm_data_factory" "example" {
-              name                = "example"
-              location            = azurerm_resource_group.example.location
-              resource_group_name = azurerm_resource_group.example.name
-              github_configuration {
-                repository_name = "checkov"
-              }
-            }
-                """)
-        resource_conf = hcl_res['resource'][0]['azurerm_data_factory']['example']
-        scan_result = check.scan_resource_conf(conf=resource_conf)
-        self.assertEqual(CheckResult.PASSED, scan_result)
-
-
-if __name__ == '__main__':
+if __name__ == "__main__":
     unittest.main()