{
  "id": "ImpervaWAFGateway",
  "title": "Imperva WAF Gateway",
  "publisher": "Imperva",
  "descriptionMarkdown": "The [Imperva](https://www.imperva.com) connector will allow you to quickly connect your Imperva WAF Gateway alerts to Azure Sentinel. This provides you additional insight into your organization's WAF traffic and improves your security operation capabilities.",
  "graphQueries": [
      {
          "metricName": "Total data received",
          "legend": "ImpervaWAFGateway",
          "baseQuery": "CommonSecurityLog\n | where DeviceVendor == \"Imperva Inc.\"\n | where DeviceProduct == \"WAF Gateway\""
      }
  ],
  "sampleQueries": [
      {
          "description" : "Find all log events of high priority.",
          "query": "CommonSecurityLog\n | where DeviceVendor == \"Imperva Inc.\" | where DeviceProduct == \"WAF Gateway\" | where LogSeverity == \"High\""
      },
      {
          "description": "Find all events that were blocked.",
          "query": "CommonSecurityLog\n | where DeviceVendor == \"Imperva Inc.\" | where DeviceProduct == \"WAF Gateway\" | where DeviceAction == \"block\""
      },
      {
          "description": "Find all events that were SQL Injection alerts.",
          "query": "CommonSecurityLog\n | where DeviceVendor == \"Imperva Inc.\" | where DeviceProduct == \"WAF Gateway\" | where Activity == \"sql-injection\""
      }
  ],
  "dataTypes": [
      {
          "name": "CommonSecurityLog (ImpervaWAFGateway)",
          "lastDataReceivedQuery": "CommonSecurityLog\n | where DeviceVendor == \"Imperva Inc.\"\n | where DeviceProduct == \"WAF Gateway\"\n | summarize Time = max(TimeGenerated)\n| where isnotempty(Time)"
      }
  ],
  "connectivityCriterias": [
      {
          "type": "IsConnectedQuery",
          "value": [
              "CommonSecurityLog\n| where DeviceVendor == \"Imperva\"\n | where DeviceProduct == \"WAF Gateway\"\n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(30d)"
          ]
      }
  ],
  "availability": {
      "status": 1,
      "isPreview": false
  },
  "permissions": {
      "resourceProvider": [
          {
              "provider": "Microsoft.OperationalInsights/workspaces",
              "permissionsDisplayText": "read and write permissions are required.",
              "providerDisplayName": "Workspace",
              "scope": "Workspace",
              "requiredPermissions": {
                  "read": true,
                  "write": true,
                  "delete": true
              }
          },
          {
              "provider": "Microsoft.OperationalInsights/workspaces/sharedKeys",
              "permissionsDisplayText": "read permissions to shared keys for the workspace are required. [See the documentation to learn more about workspace keys](https://docs.microsoft.com/azure/azure-monitor/platform/agent-windows#obtain-workspace-id-and-key).",
              "providerDisplayName": "Keys",
              "scope": "Workspace",
              "requiredPermissions": {
                  "action": true
              }
          }
      ]
  },
  "instructionSteps": [
    {
        "title": "1. Linux Syslog agent configuration",
        "description": "Install and configure the Linux agent to collect your Common Event Format (CEF) Syslog messages and forward them to Azure Sentinel.\n\n> Notice that the data from all regions will be stored in the selected workspace",
        "innerSteps": [
            {
                "title": "1.1 Select or create a Linux machine",
                "description": "Select or create a Linux machine that Azure Sentinel will use as the proxy between your security solution and Azure Sentinel this machine can be on your on-prem environment, Azure or other clouds."
            },
            {
                "title": "1.2 Install the CEF collector on the Linux machine",
                "description": "Install the Microsoft Monitoring Agent on your Linux machine and configure the machine to listen on the necessary port and forward messages to your Azure Sentinel workspace. The CEF collector collects CEF messages on port 514 TCP.\n\n> 1. Make sure that you have Python on your machine using the following command: python -version.\n\n> 2. You must have elevated permissions (sudo) on your machine.",
                "instructions": [
                    {
                        "parameters": {
                            "fillWith": [
                                "WorkspaceId",
                                "PrimaryKey"
                            ],
                            "label": "Run the following command to install and apply the CEF collector:",
                            "value": "sudo wget -O cef_installer.py https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/DataConnectors/CEF/cef_installer.py&&sudo python cef_installer.py {0} {1}"
                        },
                        "type": "CopyableLabel"
                    }
                ]
            }
        ]
    },
    {
        "title": "2. Forward Common Event Format (CEF) logs to Syslog agent",
        "description": "Set your security solution to send Syslog messages in CEF format to the proxy machine. Make sure you to send the logs to port 514 TCP on the machine's IP address."
    },    
    {
        "title": "3. SecureSphere MX Configuration",
        "description": "This connector requires an Action Interface and Action Set to be created on the Imperva SecureSphere MX.  [Follow the steps](https://community.imperva.com/blogs/craig-burlingame1/2020/11/13/steps-for-enabling-imperva-waf-gateway-alert) to create the requirements.",
        "innerSteps": [
            {
                "title": "3.1 Create the Action Interface",
                "description": "Create a new Action Interface that contains the required parameters to send WAF alerts to Azure Sentinel."
            },
            {
                "title": "3.2 Create the Action Set ",
                "description": "Create a new Action Set that uses the Action Interface configured."
            },
            {
                "title": "3.3 Apply the Action Set",
                "description": "Apply the Action Set to any Security Policies you wish to have alerts for sent to Azure Sentinel."
            }            
        ]
    },
    {
        "title": "4. Validate connection",
        "description": "Follow the instructions to validate your connectivity:\n\nOpen Log Analytics to check if the logs are received using the CommonSecurityLog schema.\n\n",
        "innerSteps": [
            {
                "title": "4.1 Check for logs in the past 5 minutes using the following command.\n\nCommonSecurityLog | where DeviceVendor == \"Imperva Inc.\" | where DeviceProduct == \"WAF Gateway\" | where TimeGenerated == ago(5m)"
            }
        ]
    },
    {
        "title": "5. Secure your machine ",
        "description": "Make sure to configure the machine's security according to your organization's security policy\n\n\n[Learn more >](https://aka.ms/SecureCEF)"
    }
  ],
  "metadata": {
    "id": "f8699c9c-536c-4d28-9049-d0c555dd8c8c",
    "version": "1.0.0",
    "kind": "dataConnector",
    "source": {
        "kind": "community"
    },
    "author": {
        "name": "Imperva"
    },
    "support": {
        "name": "Imperva",
        "link": "https://www.imperva.com/support/technical-support/",
        "tier": "developer"
    }
}
}
