{
  "name": "VaronisSaaSAlertsPush",
  "apiVersion": "2022-09-01-preview",
  "type": "Microsoft.SecurityInsights/dataConnectorDefinitions",
  "location": "[parameters('workspace-location')]",
  "kind": "Customizable",
  "properties": {
    "connectorUiConfig": {
      "id": "VaronisSaaSAlertsPush",
      "title": "Varonis SaaS (Push)",
      "publisher": "Varonis",
      "descriptionMarkdown": "The [Varonis SaaS](https://www.varonis.com/) connector provides the capability to push real-time DatAlert security alerts from your Varonis application directly into Microsoft Sentinel using the Codeless Connector Framework (CCF) Push pattern. Varonis prioritizes deep data visibility, classification capabilities, and automated remediation for data access. This connector ingests alert severity, event types, user information, and related details into a custom Log Analytics table for analysis, alerting, and visualization.",
      "graphQueries": [
        {
          "metricName": "Total alerts received",
          "legend": "VaronisAlertsV2_CL",
          "baseQuery": "VaronisAlertsV2_CL"
        },
        {
          "metricName": "High severity alerts",
          "legend": "High severity alerts",
          "baseQuery": "VaronisAlertsV2_CL\n| where AlertSeverity_s == \"High\""
        },
        {
          "metricName": "Medium severity alerts",
          "legend": "Medium severity alerts",
          "baseQuery": "VaronisAlertsV2_CL\n| where AlertSeverity_s == \"Medium\""
        },
        {
          "metricName": "Low severity alerts",
          "legend": "Low severity alerts",
          "baseQuery": "VaronisAlertsV2_CL\n| where AlertSeverity_s == \"Low\""
        }
      ],
      "sampleQueries": [
        {
          "description": "All Varonis alerts",
          "query": "VaronisAlertsV2_CL\n | sort by TimeGenerated desc"
        },
        {
          "description": "High severity Varonis alerts",
          "query": "VaronisAlertsV2_CL\n | where AlertSeverity_s == \"High\"\n | sort by TimeGenerated desc"
        },
        {
          "description": "Alerts by category",
          "query": "VaronisAlertsV2_CL\n | summarize Count = count() by AlertCategory_s\n | sort by Count desc"
        }
      ],
      "dataTypes": [
        {
          "name": "VaronisAlertsV2_CL",
          "lastDataReceivedQuery": "VaronisAlertsV2_CL\n| summarize Time = max(TimeGenerated)\n| where isnotempty(Time)"
        }
      ],
      "connectivityCriteria": [
        {
          "type": "IsConnectedQuery",
          "value": [
            "VaronisAlertsV2_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 Varonis SaaS application to push DatAlert security alerts 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 a Log Analytics table 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."
              }
            },
            {
              "type": "DeployPushConnectorButton",
              "parameters": {
                "label": "Deploy Varonis SaaS Push connector resources",
                "applicationDisplayName": "Varonis SaaS Push Connector Application"
              }
            }
          ]
        },
        {
          "title": "2. Configure Your Varonis Application",
          "description": "Use the following parameters to configure your Varonis SaaS application to push DatAlert alerts to the workspace.",
          "instructions": [
            {
              "type": "CopyableLabel",
              "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": "Stream Name",
                "value": "Custom-VaronisSaaSAlerts"
              }
            },
            {
              "type": "Markdown",
              "parameters": {
                "content": "#### Configure Varonis SaaS Application\nUpdate your Varonis SaaS application configuration with the above credentials to enable DatAlert alert push to Microsoft Sentinel."
              }
            }
          ]
        }
      ]
    }
  }
}
