{
  "name": "MulesoftCloudhubConnector",
  "apiVersion": "2025-07-01-preview",
  "type": "Microsoft.SecurityInsights/dataConnectorDefinitions",
  "location": "{{location}}",
  "kind": "Customizable",
  "properties": {
    "connectorUiConfig": {
      "id": "MulesoftCloudhubConnector",
      "title": "Mulesoft CloudHub Alerts Connector (via Codeless Connector Framework)",
      "publisher": "Microsoft",
      "descriptionMarkdown": "The Mulesoft CloudHub data connector enables you to ingest alerts from Mulesoft CloudHub into Microsoft Sentinel through the CloudHub REST API v2. This connector supports configurable endpoints to accommodate different Mulesoft regions and deployment environments including US Commercial Cloud, EU Cloud, Government Cloud, and on-premises deployments. It uses multi-stream support so you can connect to multiple Mulesoft environments simultaneously. Configure the connector with your Anypoint Platform credentials, environment ID, and optional application name filter to begin collecting data. Use the `MuleSoftCloudhub` parser to query ingested alerts. Refer to [Mulesoft CloudHub API documentation](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/) for more information about the CloudHub APIs.",
      "graphQueriesTableName": "MulesoftCloudhubAlerts_CL",
      "graphQueries": [
        {
          "metricName": "Total alerts received",
          "legend": "Mulesoft CloudHub Alerts",
          "baseQuery": "{{graphQueriesTableName}}"
        },
        {
          "metricName": "Critical alerts",
          "legend": "Critical Alerts",
          "baseQuery": "{{graphQueriesTableName}} | where Severity == 'CRITICAL'"
        },
        {
          "metricName": "Error alerts",
          "legend": "Error Alerts",
          "baseQuery": "{{graphQueriesTableName}} | where Severity == 'ERROR'"
        },
        {
          "metricName": "System alerts",
          "legend": "System Alerts",
          "baseQuery": "{{graphQueriesTableName}} | where IsSystem == true"
        }
      ],
      "sampleQueries": [
        {
          "description": "All Mulesoft CloudHub alerts",
          "query": "MuleSoftCloudhub\n| sort by TimeGenerated desc"
        },
        {
          "description": "Get sample of 20 alert records",
          "query": "MuleSoftCloudhub\n| take 20"
        },
        {
          "description": "Summary by alert severity level",
          "query": "MuleSoftCloudhub\n| summarize count() by EventSeverity"
        },
        {
          "description": "Summary by alert name",
          "query": "MuleSoftCloudhub\n| summarize count() by EventResult"
        }
      ],
      "dataTypes": [
        {
          "name": "MulesoftCloudhubAlerts_CL",
          "lastDataReceivedQuery": "MulesoftCloudhubAlerts_CL\n| where TimeGenerated > ago(6h)\n| summarize Time = max(TimeGenerated)\n| where isnotempty(Time)"
        }
      ],
      "connectivityCriteria": [
        {
          "type": "HasDataConnectors"
        },
        {
          "type": "IsConnectedQuery",
          "value": [
            "MulesoftCloudhubAlerts_CL | where TimeGenerated > ago(1h) | take 1"
          ]
        }
      ],
      "availability": {
        "isPreview": false,
        "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": "Mulesoft CloudHub API access",
            "description": "**Mulesoft CloudHub API** access with read permissions is required."
          }
        ]
      },
      "instructionSteps": [
        {
          "title": "1. Mulesoft CloudHub Connections",
          "description": "Manage connections to your Mulesoft CloudHub environments",
          "instructions": [
            {
              "type": "Markdown",
              "parameters": {
                "content": "## Prerequisites\r\n\r\nBefore configuring this connector, ensure you have:\r\n\r\n1. **Mulesoft Anypoint Platform Account** with appropriate permissions\r\n2. **Environment Access** to the CloudHub environment you want to monitor\r\n3. **API Access Credentials** (username and password)\r\n4. **Environment ID** from your Mulesoft CloudHub console\r\n\r\n### Finding Your Environment ID\r\n\r\n1. Log in to [Anypoint Platform](https://anypoint.mulesoft.com/)\r\n2. Navigate to **Access Management** > **Environments**\r\n3. Select your target environment\r\n4. Copy the Environment ID from the URL or environment details"
              }
            },
            {
              "type": "InfoMessage",
              "parameters": {
                "text": "This connector requires read access to the CloudHub API. Contact your Mulesoft administrator if you don't have the necessary permissions.",
                "visible": true,
                "inline": false
              }
            },
            {
              "type": "DataConnectorsGrid",
              "parameters": {
                "mapping": [
                  {
                    "columnName": "Connection Alias",
                    "columnValue": "properties.addOnAttributes.connectionAlias"
                  },
                  {
                    "columnName": "Stream Type",
                    "columnValue": "properties.addOnAttributes.streamType"
                  },
                  {
                    "columnName": "Base URL",
                    "columnValue": "properties.addOnAttributes.mulesoftBaseUrl"
                  }
                ],
                "menuItems": [
                  "DeleteConnector"
                ]
              }
            },
            {
              "type": "ContextPane",
              "parameters": {
                "label": "Add Connection",
                "title": "Add Mulesoft CloudHub Connection",
                "subtitle": "Configure a connection to a Mulesoft CloudHub environment",
                "contextPaneType": "DataConnectorsContextPane",
                "instructionSteps": [
                  {
                    "title": "Base Configuration",
                    "description": "Configure your Mulesoft CloudHub API connection",
                    "instructions": [
                      {
                        "type": "Markdown",
                        "parameters": {
                          "content": "### Connection Settings"
                        }
                      },
                      {
                        "type": "Textbox",
                        "parameters": {
                          "label": "Connection Alias",
                          "placeholder": "e.g., US-Production",
                          "type": "text",
                          "name": "connectionAlias",
                          "validations": {
                            "required": true
                          }
                        }
                      },
                      {
                        "type": "InfoMessage",
                        "parameters": {
                          "text": "Enter a unique alias to identify this connection. Use descriptive names like 'US-Production', 'EU-Staging', etc.",
                          "visible": true,
                          "inline": true
                        }
                      },
                      {
                        "type": "Textbox",
                        "parameters": {
                          "label": "Mulesoft API Base URL",
                          "placeholder": "https://anypoint.mulesoft.com",
                          "type": "url",
                          "name": "mulesoftBaseUrl",
                          "validations": {
                            "required": true
                          }
                        }
                      },
                      {
                        "type": "InfoMessage",
                        "parameters": {
                          "text": "**Regional Endpoints**:\n- **US**: https://anypoint.mulesoft.com\n- **EU**: https://eu1.anypoint.mulesoft.com\n- **Government**: https://gov.anypoint.mulesoft.com",
                          "visible": true,
                          "inline": true
                        }
                      }
                    ]
                  },
                  {
                    "title": "Credentials",
                    "description": "Provide your Anypoint Platform credentials",
                    "instructions": [
                      {
                        "type": "Markdown",
                        "parameters": {
                          "content": "### Authentication"
                        }
                      },
                      {
                        "type": "Textbox",
                        "parameters": {
                          "label": "Username",
                          "placeholder": "Your Mulesoft Anypoint Platform username",
                          "type": "text",
                          "name": "username",
                          "validations": {
                            "required": true
                          }
                        }
                      },
                      {
                        "type": "Textbox",
                        "parameters": {
                          "label": "Password",
                          "placeholder": "Your Mulesoft Anypoint Platform password",
                          "type": "password",
                          "name": "password",
                          "validations": {
                            "required": true
                          }
                        }
                      }
                    ]
                  },
                  {
                    "title": "Environment Configuration",
                    "description": "Configure the CloudHub environment to monitor",
                    "instructions": [
                      {
                        "type": "Markdown",
                        "parameters": {
                          "content": "### Environment Settings"
                        }
                      },
                      {
                        "type": "Textbox",
                        "parameters": {
                          "label": "Environment ID",
                          "placeholder": "CloudHub Environment ID (found in Anypoint Platform)",
                          "type": "text",
                          "name": "environmentId",
                          "validations": {
                            "required": true
                          }
                        }
                      },
                      {
                        "type": "Textbox",
                        "parameters": {
                          "label": "Application Name Filter",
                          "placeholder": "Optional: Filter alerts for a specific application",
                          "type": "text",
                          "name": "applicationName"
                        }
                      },
                      {
                        "type": "InfoMessage",
                        "parameters": {
                          "text": "Leave the application name filter empty to collect alerts for all applications in the environment.",
                          "visible": true,
                          "inline": true
                        }
                      }
                    ]
                  }
                ]
              }
            }
          ]
        },
        {
          "title": "2. Monitor and Validate",
          "description": "Monitor data ingestion and validate connectivity",
          "instructions": [
            {
              "type": "Markdown",
              "parameters": {
                "content": "### Post-Connection Steps\r\n\r\n1. **Monitor Connection Status**: Check the connector status in the Data connectors page\r\n2. **Validate Data Flow**: Use the sample queries provided to verify data is being collected\r\n3. **Review Logs**: Check Azure Monitor logs for any connection or authentication issues\r\n\r\n### Data Collection Schedule\r\n- **Alerts**: Polled every 5 minutes from `/v2/alerts` endpoint\r\n\r\n### Expected Timeline\r\n- **Initial Data**: Allow 10-15 minutes for initial data to appear\r\n- **Alerts Data**: Available in the `MuleSoftCloudhub` table\r\n\r\n### Troubleshooting\r\n- **Authentication errors**: Verify credentials and environment access\r\n- **No data**: Ensure alerts exist in the specified environment\r\n- **Partial data**: Check environment ID and application filter settings"
              }
            },
            {
              "type": "InfoMessage",
              "parameters": {
                "text": "**Sample Query**: `MuleSoftCloudhub | where TimeGenerated > ago(24h) | summarize count() by EventSeverity`",
                "visible": true,
                "inline": true
              }
            }
          ]
        }
      ]
    }
  }
}