{
  "name": "ZeroFoxAlertsDefinition",
  "apiVersion": "2022-09-01-preview",
  "type": "Microsoft.SecurityInsights/dataConnectorDefinitions",
  "location": "{{location}}",
  "kind": "Customizable",
  "properties": {
    "connectorUiConfig": {
      "id": "ZeroFoxAlertsDefinition",
      "title": "ZeroFox Alerts",
      "publisher": "ZeroFox Enterprise",
      "descriptionMarkdown": "Collects alerts from ZeroFox API.",
      "graphQueriesTableName": "ZeroFoxAlertPoller_CL",
      "graphQueries": [
        {
          "metricName": "Total alerts received",
          "legend": "ZeroFox Alerts",
          "baseQuery": "ZeroFoxAlertPoller_CL"
        }
      ],
      "sampleQueries": [
        {
          "description": "List all ZeroFox alerts",
          "query": "ZeroFoxAlertPoller_CL\n| sort by TimeGenerated asc"
        },
        {
          "description": "Count alerts by network type",
          "query": "ZeroFoxAlertPoller_CL\n| summarize Count = count() by ThreatSource=network_s"
        },
        {
          "description": "Count alerts by entity",
          "query": "ZeroFoxAlertPoller_CL\n| summarize Count = count() by Entity=entity_name_s"
        }
      ],
      "dataTypes": [
        {
          "name": "ZeroFoxAlertPoller_CL",
          "lastDataReceivedQuery": "ZeroFoxAlertPoller_CL\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
        }
      ],
      "connectivityCriteria": [
        { "type": "HasDataConnectors" }
      ],
      "availability": {
        "status": 1,
        "isPreview": false
      },
      "permissions": {
        "resourceProvider": [
          {
            "provider": "Microsoft.OperationalInsights/solutions",
            "permissionsDisplayText": "read and write permissions are required.",
            "providerDisplayName": "Workspace",
            "scope": "Workspace",
            "requiredPermissions": {
              "action": true,
              "write": true,
              "read": true,
              "delete": true
            }
          }
        ],
        "customs": [
          {
            "name": "ZeroFox Integrations API Key",
            "description": "A ZeroFox Integrations API Key is required. Request it at integrations@zerofox.com."
          }
        ]
      },
      "instructionSteps": [
        {
          "title": "Connect ZeroFox to Microsoft Sentinel",
          "description": "To enable the connector, provide the required information below and click Connect.",
          "instructions": [
            {
              "type": "Textbox",
              "parameters": {
                "label": "Provide your ZeroFox Integrations API Key",
                "placeholder": "ZeroFox Integrations API Key",
                "type": "password",
                "name": "apikey",
                "validations": {
                  "required": true
                }
              }
            },
            {
              "type": "Dropdown",
              "parameters": {
                "label": "Polling Frequency",
                "name": "pollingFrequency",
                "options": [
                  { "key": "10", "text": "Every 10 minutes" },
                  { "key": "15", "text": "Every 15 minutes" },
                  { "key": "30", "text": "Every 30 minutes" },
                  { "key": "60", "text": "Every hour" },
                  { "key": "120", "text": "Every 2 hours" },
                  { "key": "360", "text": "Every 6 hours" },
                  { "key": "720", "text": "Every 12 hours" }
                ],
                "placeholder": "Select polling frequency",
                "required": true,
                "defaultValue": "60"
              }
            },
            {
              "type": "ConnectionToggleButton",
              "parameters": {
                "label": "toggle",
                "name": "toggle"
              }
            }
          ]
        }
      ]
    }
  }
}
