{
  "name": "ForescoutHostPropertyMonitor",
  "apiVersion": "2025-07-01-preview",
  "type": "Microsoft.SecurityInsights/dataConnectorDefinitions",
  "location": "{{location}}",
  "kind": "Customizable",
  "properties": {
    "connectorUiConfig": {
      "id": "ForescoutHostPropertyMonitor",
      "title": "Forescout Host Property Monitor (Push Connector via Codeless Connector Framework)",
      "publisher": "Forescout",
      "descriptionMarkdown": "The Forescout Host Property Monitor connector allows you to connect host/policy/compliance properties from Forescout platform with Microsoft Sentinel, to view, create custom incidents, and improve investigation. This gives you more insight into your organization network and improves your security operation capabilities.",
      "graphQueries": [
        {
          "metricName": "Total host properties received",
          "legend": "Forescout Host Properties",
          "baseQuery": "ForescoutHostProperties_CL"
        },
        {
          "metricName": "Total policy status records received",
          "legend": "Forescout Policy Status",
          "baseQuery": "ForescoutPolicyStatus_CL"
        },
        {
          "metricName": "Total compliance status records received",
          "legend": "Forescout Compliance Status",
          "baseQuery": "ForescoutComplianceStatus_CL"
        },
        {
          "metricName": "Non-compliant hosts",
          "legend": "Non-Compliant Hosts",
          "baseQuery": "ForescoutComplianceStatus_CL | where Status == 'fail'"
        }
      ],
      "sampleQueries": [
        {
          "description": "Get 5 latest host property entries",
          "query": "ForescoutHostProperties_CL | take 5"
        },
        {
          "description": "Get 5 latest host policy entries",
          "query": "ForescoutPolicyStatus_CL | take 5"
        },
        {
          "description": "Get 5 latest host compliance entries",
          "query": "ForescoutComplianceStatus_CL | take 5"
        },
        {
          "description": "Recent entries from all streams",
          "query": "union isfuzzy=true ForescoutHostProperties_CL, ForescoutPolicyStatus_CL, ForescoutComplianceStatus_CL\n| order by TimeGenerated desc\n| take 20"
        }
      ],
      "dataTypes": [
        {
          "name": "ForescoutHostProperties_CL",
          "lastDataReceivedQuery": "ForescoutHostProperties_CL\n| where TimeGenerated > ago(12h) | summarize Time = max(TimeGenerated)\n| where isnotempty(Time)"
        },
        {
          "name": "ForescoutPolicyStatus_CL",
          "lastDataReceivedQuery": "ForescoutPolicyStatus_CL\n| where TimeGenerated > ago(12h) | summarize Time = max(TimeGenerated)\n| where isnotempty(Time)"
        },
        {
          "name": "ForescoutComplianceStatus_CL",
          "lastDataReceivedQuery": "ForescoutComplianceStatus_CL\n| where TimeGenerated > ago(12h) | summarize Time = max(TimeGenerated)\n| where isnotempty(Time)"
        }
      ],
      "connectivityCriteria": [
        {
          "type": "HasDataConnectors"
        },
        {
          "type": "IsConnectedQuery",
          "value": [
            "ForescoutHostProperties_CL | where TimeGenerated > ago(30d) | take 1"
          ]
        }
      ],
      "availability": {
        "isPreview": true,
        "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,
              "action": false
            }
          }
        ],
        "customs": [
          {
            "name": "Microsoft.Insights/dataCollectionEndpoints",
            "description": "Data Collection Endpoint is required for the modern push connector to receive data from the external security system."
          },
          {
            "name": "Microsoft.Insights/dataCollectionRules",
            "description": "Data Collection Rule is required to define the schema and transformations for incoming data."
          },
          {
            "name": "Microsoft.Authorization/roleAssignments",
            "description": "Role assignment is required to grant the Entra application permissions to send data to the Data Collection Rule."
          },
          {
            "name": "Forescout Plugin requirement",
            "description": "Please make sure Forescout Microsoft Sentinel plugin is running on Forescout platform. Instructions on how to configure Forescout Microsoft Sentinel plugin are provided at Forescout Documentation Portal (https://docs.forescout.com)"
          }
        ]
      },
      "instructionSteps": [
        {
          "title": "1. Create ARM Resources and Provide the Required Permissions",
          "description": "This connector receives data from external security systems that push logs to Microsoft Sentinel. The external system must be configured to send raw event data to the Microsoft Sentinel Ingestion API. Clicking on **Deploy** will trigger the creation of Log Analytics tables and a Data Collection Rule (DCR). It 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.\n\n[Learn more about the connector setup process](https://review.learn.microsoft.com/azure/sentinel/create-push-codeless-connector)",
          "instructions": [
            {
              "type": "Markdown",
              "parameters": {
                "content": "## Azure Resource Deployment\n\nThe deployment process will create the following resources:\n- Log Analytics custom table(s)\n- Data Collection Endpoint (DCE)\n- Data Collection Rule (DCR)\n- Entra ID Application Registration\n- Role assignments for data ingestion"
              }
            },
            {
              "type": "DeployPushConnectorButton",
              "parameters": {
                "label": "Deploy Forescout Host Property Monitor connector resources (Multi-Stream)",
                "applicationDisplayName": "Forescout Host Property Monitor (Push Connector via Codeless Connector Framework)"
              }
            },
            {
              "type": "Markdown",
              "parameters": {
                "content": "### Configuration Values\n\nAfter deployment, copy the following values to configure your external security system:"
              }
            },
            {
              "type": "CopyableLabel",
              "parameters": {
                "fillWith": [
                  "TenantId"
                ],
                "label": "Tenant ID (Directory ID)",
                "value": "{0}"
              }
            },
            {
              "type": "CopyableLabel",
              "parameters": {
                "fillWith": [
                  "ApplicationId"
                ],
                "label": "Entra App Registration Application ID",
                "value": "{0}"
              }
            },
            {
              "type": "CopyableLabel",
              "parameters": {
                "fillWith": [
                  "ApplicationSecret"
                ],
                "label": "Entra App Registration Secret",
                "value": "{0}"
              }
            },
            {
              "type": "CopyableLabel",
              "parameters": {
                "fillWith": [
                  "DataCollectionEndpoint"
                ],
                "label": "Data Collection Endpoint Url",
                "value": "{0}"
              }
            },
            {
              "type": "CopyableLabel",
              "parameters": {
                "fillWith": [
                  "DataCollectionRuleId"
                ],
                "label": "Data Collection Rule Immutable ID",
                "value": "{0}"
              }
            },
            {
              "type": "Markdown",
              "parameters": {
                "content": "### Stream Names (3 streams)\n\nUse the appropriate stream name when configuring each data source:"
              }
            },
            {
              "type": "CopyableLabel",
              "parameters": {
                "fillWith": [],
                "label": "Stream Name (ForescoutHostProperties)",
                "value": "Custom-ForescoutHostProperties_CL"
              }
            },
            {
              "type": "CopyableLabel",
              "parameters": {
                "fillWith": [],
                "label": "Stream Name (ForescoutPolicyStatus)",
                "value": "Custom-ForescoutPolicyStatus_CL"
              }
            },
            {
              "type": "CopyableLabel",
              "parameters": {
                "fillWith": [],
                "label": "Stream Name (ForescoutComplianceStatus)",
                "value": "Custom-ForescoutComplianceStatus_CL"
              }
            },
            {
              "type": "InfoMessage",
              "parameters": {
                "text": "Keep these values secure. You will need them to configure your external security system.",
                "visible": true,
                "inline": true
              }
            }
          ]
        },
        {
          "title": "2. Configure your external system to push logs",
          "description": "Use the following parameters to configure your external security system to send logs to the workspace.\n\n### Configuration Steps\n\n1. Access your external security system's configuration interface.\n2. Navigate to the data forwarding, integration, or SIEM settings.\n3. Select **Azure Monitor** or **Microsoft Sentinel** as the destination.\n4. Select **Data Collection Endpoint** as the authentication method.\n5. Configure the required fields using the values from the previous step:\n   - **Tenant ID**: Copy from above\n   - **Application (Client) ID**: Copy from above\n   - **Client Secret**: Copy from above\n   - **Data Collection Endpoint**: Copy from above\n   - **Data Collection Rule Immutable ID**: Copy from above\n   - **Stream Name**: Copy the appropriate stream name from above\n6. Save the configuration and enable/start the forwarder.\n\n### Validation\n\n> **Note**: Data will appear in the following tables in your Log Analytics workspace within a few minutes:\n> - **ForescoutHostProperties**\n> - **ForescoutPolicyStatus**\n> - **ForescoutComplianceStatus**\n\nTo verify data is being received, run the following queries in your Log Analytics workspace:\n\n**Table 1: ForescoutHostProperties**\n\n```kusto\nForescoutHostProperties\n| where TimeGenerated > ago(1h)\n| take 10\n```\n\n**Table 2: ForescoutPolicyStatus**\n\n```kusto\nForescoutPolicyStatus\n| where TimeGenerated > ago(1h)\n| take 10\n```\n\n**Table 3: ForescoutComplianceStatus**\n\n```kusto\nForescoutComplianceStatus\n| where TimeGenerated > ago(1h)\n| take 10\n```\n\n**All Tables Combined:**\n\n```kusto\nunion ForescoutHostProperties, ForescoutPolicyStatus, ForescoutComplianceStatus\n| where TimeGenerated > ago(1h)\n| take 10\n```\n\n### Troubleshooting\n\nIf data is not appearing:\n- Verify the configuration values are correct\n- Check that the forwarder/integration is enabled and running\n- Review logs in your external security system for any errors\n- Ensure network connectivity from your system to Azure\n- Verify the Entra application has the correct permissions",
          "instructions": [
            {
              "type": "Markdown",
              "parameters": {
                "content": "After deploying the Azure resources, configure the Forescout Microsoft Sentinel plugin to send data to the deployed DCE/DCR endpoints for all three data types: **ForescoutHostProperties_CL**, **ForescoutPolicyStatus_CL**, and **ForescoutComplianceStatus_CL**."
              }
            },
            {
              "type": "Markdown",
              "parameters": {
                "content": "For detailed configuration instructions, refer to the [Forescout Documentation Portal](https://docs.forescout.com)"
              }
            },
            {
              "type": "Markdown",
              "parameters": {
                "content": "### Important: Connection Status\n\nThis is a **push-based connector** - it receives data from Forescout and does not maintain an active polling connection. The connector shows as \"Connected\" when data has been received within the last 30 days."
              }
            }
          ]
        },
        {
          "title": "Uninstall connector",
          "description": "Disconnect from all sources and delete the connector instances.",
          "instructions": [
            {
              "type": "Markdown",
              "parameters": {
                "content": "## 1. Disconnect from All Sources\n\nBefore deleting the connector, stop the external system from sending data to Microsoft Sentinel:\n\n1. Access your external security system's configuration interface.\n2. Navigate to the data forwarding, integration, or SIEM settings.\n3. Disable or remove the Microsoft Sentinel / Azure Monitor integration.\n4. Verify that data has stopped flowing by checking that no new rows appear in the table(s) in your Log Analytics workspace."
              }
            },
            {
              "type": "Markdown",
              "parameters": {
                "content": "## 2. Delete the Connector Instances\n\nRun the following PowerShell commands to remove the push connector instances:"
              }
            },
            {
              "type": "Markdown",
              "parameters": {
                "content": "```powershell\n$sub = \"<subscription-id>\"\n$rg  = \"<resource-group-name>\"\n$ws  = \"<workspace-name>\"\n\n@(\"ForescoutHostPropertyMonitor-ForescoutHostProperties\", \"ForescoutHostPropertyMonitor-ForescoutPolicyStatus\", \"ForescoutHostPropertyMonitor-ForescoutComplianceStatus\") | ForEach-Object {\n    Write-Host \"Deleting $_...\" -NoNewline\n    az rest --method DELETE --uri \"/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.OperationalInsights/workspaces/$ws/providers/Microsoft.SecurityInsights/dataConnectors/$_`?api-version=2024-09-01\"\n    Write-Host \" Done\" -ForegroundColor Green\n}\n```"
              }
            },
            {
              "type": "Markdown",
              "parameters": {
                "content": "> **NOTE**: Replace `<subscription-id>`, `<resource-group-name>`, and `<workspace-name>` with your actual Azure values before running the script."
              }
            },
            {
              "type": "Markdown",
              "parameters": {
                "content": "This will remove the push connector instances. Historical data in your Log Analytics workspace will be retained."
              }
            }
          ]
        }
      ]
    }
  }
}