{
  "name": "DataBahnPush",
  "apiVersion": "2022-09-01-preview",
  "type": "Microsoft.SecurityInsights/dataConnectorDefinitions",
  "location": "{{location}}",
  "kind": "Customizable",
  "properties": {
    "connectorUiConfig": {
      "id": "DataBahnPush",
      "title": "DataBahn",
      "publisher": "DataBahn",
      "logo": "databahn.svg",
      "descriptionMarkdown": "The [DataBahn](https://databahn.ai/) connector provides the capability to push real-time platform telemetry from your DataBahn environment directly into Microsoft Sentinel using the Codeless Connector Framework (CCF) Push pattern. This connector ingests audit logs, operational alerts, and device inventory into custom Log Analytics tables for analysis, alerting, and visualization.",
      "graphQueries": [
        {
          "metricName": "Audit Logs",
          "legend": "databahn_audit_logs_CL",
          "baseQuery": "databahn_audit_logs_CL"
        },
        {
          "metricName": "Alerts",
          "legend": "databahn_alerts_CL",
          "baseQuery": "databahn_alerts_CL"
        },
        {
          "metricName": "Device Inventory",
          "legend": "databahn_device_inventory_CL",
          "baseQuery": "databahn_device_inventory_CL"
        }
      ],
      "sampleQueries": [
        {
          "description": "Audit Logs",
          "query": "databahn_audit_logs_CL\n | sort by TimeGenerated desc"
        },
        {
          "description": "Alerts",
          "query": "databahn_alerts_CL\n | sort by TimeGenerated desc"
        },
        {
          "description": "Device Inventory",
          "query": "databahn_device_inventory_CL\n | sort by TimeGenerated desc"
        }
      ],
      "dataTypes": [
        {
          "name": "databahn_audit_logs_CL",
          "lastDataReceivedQuery": "databahn_audit_logs_CL\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
        },
        {
          "name": "databahn_alerts_CL",
          "lastDataReceivedQuery": "databahn_alerts_CL\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
        },
        {
          "name": "databahn_device_inventory_CL",
          "lastDataReceivedQuery": "databahn_device_inventory_CL\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
        }
      ],
      "connectivityCriteria": [
        {
          "type": "IsConnectedQuery",
          "value": [
            "databahn_audit_logs_CL\n            | summarize LastLogReceived = max(TimeGenerated)\n            | project IsConnected = LastLogReceived > ago(7d)"
          ]
        }
      ],
      "availability": {
        "status": 1
      },
      "permissions": {
        "resourceProvider": [
          {
            "provider": "Microsoft.OperationalInsights/workspaces",
            "permissionsDisplayText": "read and write permissions are required.",
            "providerDisplayName": "Workspace",
            "scope": "Workspace",
            "requiredPermissions": {
              "write": true,
              "read": true,
              "delete": true
            }
          }
        ],
        "customs": [
          {
            "name": "Microsoft Entra",
            "description": "Permission to create an app registration in Microsoft Entra ID. Typically requires Entra ID Application Developer role or higher."
          },
          {
            "name": "Microsoft Azure",
            "description": "Permission to assign Monitoring Metrics Publisher role on data collection rule (DCR). Typically requires Azure RBAC Owner or User Access Administrator role."
          }
        ]
      },
      "instructionSteps": [
        {
          "title": "1. Create ARM Resources and Provide the Required Permissions",
          "description": "This connector enables your DataBahn platform to push audit logs, alerts, and device inventory directly to Microsoft Sentinel via the Azure Monitor Ingestion API.",
          "instructions": [
            {
              "type": "Markdown",
              "parameters": {
                "content": "#### Automated Configuration and Secure Data Ingestion with Entra Application \nClicking on \"Deploy\" will trigger the creation of Log Analytics tables and a Data Collection Rule (DCR). \nIt will then create an Entra application, link the DCR to it, and set the entered secret in the application. This setup enables data to be sent securely to the DCR using an Entra token."
              }
            },
            {
              "parameters": {
                "label": "Deploy DataBahn connector resources",
                "applicationDisplayName": "DataBahn Connector Application"
              },
              "type": "DeployPushConnectorButton"
            }
          ]
        },
        {
          "title": "2. Configure Your DataBahn Platform",
          "description": "Use the following parameters to configure your DataBahn Highway destination to push data to the workspace.",
          "instructions": [
            {
              "parameters": {
                "label": "Tenant ID (Directory ID)",
                "fillWith": ["TenantId"]
              },
              "type": "CopyableLabel"
            },
            {
              "parameters": {
                "label": "Entra App Registration Application ID",
                "fillWith": ["ApplicationId"],
                "placeholder": "Deploy push connector to get the App Registration Application ID"
              },
              "type": "CopyableLabel"
            },
            {
              "parameters": {
                "label": "Entra App Registration Secret",
                "fillWith": ["ApplicationSecret"],
                "placeholder": "Deploy push connector to get the App Registration Secret"
              },
              "type": "CopyableLabel"
            },
            {
              "parameters": {
                "label": "Data Collection Endpoint Uri",
                "fillWith": ["DataCollectionEndpoint"],
                "placeholder": "Deploy push connector to get the Data Collection Endpoint Uri"
              },
              "type": "CopyableLabel"
            },
            {
              "parameters": {
                "label": "Data Collection Rule Immutable ID",
                "fillWith": ["DataCollectionRuleId"],
                "placeholder": "Deploy push connector to get the Data Collection Rule Immutable ID"
              },
              "type": "CopyableLabel"
            },
            {
              "parameters": {
                "label": "Audit Logs Stream Name",
                "value": "Custom-databahn_audit_logs"
              },
              "type": "CopyableLabel"
            },
            {
              "parameters": {
                "label": "Alerts Stream Name",
                "value": "Custom-databahn_alerts"
              },
              "type": "CopyableLabel"
            },
            {
              "parameters": {
                "label": "Device Inventory Stream Name",
                "value": "Custom-databahn_device_inventory"
              },
              "type": "CopyableLabel"
            }
          ]
        }
      ]
    }
  }
}
