{
  "name": "ZeroFoxAlertsDefinition",
  "apiVersion": "2022-09-01-preview",
  "type": "Microsoft.SecurityInsights/dataConnectorDefinitions",
  "location": "{{location}}",
  "kind": "Customizable",
  "parameters": {
    "apikey": {
      "type": "securestring"
    }
  },
  "properties": {
    "connectorUiConfig": {
      "id": "ZeroFoxAlertsDefinition",
      "title": "ZeroFox Enterprise - Alerts (Polling CCF)",
      "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": "IsConnectedQuery",
          "value": [
            "ZeroFoxAlertPoller_CL\n            | summarize LastLogReceived = max(TimeGenerated)\n            | project IsConnected = LastLogReceived > ago(3d)"
          ]
        }
      ],
      "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 Personal Access Token (PAT)",
            "description": "A ZeroFox PAT is required. You can get it in Data Connectors > [API Data Feeds](https://cloud.zerofox.com/data_connectors/api)."
          }
        ]
      },
      "instructionSteps": [
        {
          "description": "Connect ZeroFox to Microsoft Sentinel",
          "instructions": [
            {
              "type": "Textbox",
              "parameters": {
                "label": "Provide your ZeroFox PAT",
                "placeholder": "Zerofox PAT",
                "type": "password",
                "name": "apikey",
                "validations": {
                  "required": true
                }
              }
            },
            {
              "parameters": {
                "label": "toggle",
                "name": "toggle"
              },
              "type": "ConnectionToggleButton"
            }
          ],
          "title": "Connect ZeroFox to Microsoft Sentinel"
        }
      ]
    }
  }
}
