{
    "id": "ESI-Opt5ExchangeIISLogs",
    "title": "IIS Logs of Microsoft Exchange Servers",
    "publisher": "Microsoft",
    "descriptionMarkdown": "[Option 5] - Using Azure Monitor Agent - You can stream all IIS Logs from the Windows machines connected to your Microsoft Sentinel workspace using the Windows agent. This connection enables you to create custom alerts, and improve investigation.",
    "graphQueries": [
        {
            "metricName": "Total data received",
            "legend": "Exchange IIS logs",
            "baseQuery": "W3CIISLog"
        }
    ],
    "sampleQueries": [
        {
            "description": "All Audit logs",
            "query": "W3CIISLog | sort by TimeGenerated"
        }
    ],
    "dataTypes": [
        {
            "name": "W3CIISLog",
            "lastDataReceivedQuery": "W3CIISLog  | summarize Time = max(TimeGenerated) | where isnotempty(Time)"
        }
    ],
    "connectivityCriterias": [
        {
            "type": "IsConnectedQuery",
            "value": [
                "W3CIISLog  | summarize LastLogReceived = max(TimeGenerated) | project IsConnected = LastLogReceived > ago(7h)"
            ]
        }
    ],
    "availability": {
        "status": 1,
        "isPreview": false
    },
    "permissions": {
        "resourceProvider": [
            {
                "provider": "Microsoft.OperationalInsights/workspaces",
                "permissionsDisplayText": "read and write permissions.",
                "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
                }
            }
        ],
        "customs": [
            {
                "description": "Azure Log Analytics will be deprecated, to collect data from non-Azure VMs, Azure Arc is recommended. [Learn more](https://docs.microsoft.com/azure/azure-monitor/agents/azure-monitor-agent-install?tabs=ARMAgentPowerShell,PowerShellWindows,PowerShellWindowsArc,CLIWindows,CLIWindowsArc)"
            },
            {
                "name": "Detailled documentation",
                "description": ">**NOTE:** Detailled documentation on Installation procedure and usage can be found [here](https://aka.ms/MicrosoftExchangeSecurityGithub)"
            }     
        ]
    },
    "instructionSteps": [
        {
            "description": ">**NOTE:** This solution is based on options. This allows you to choose which data will be ingest as some options can generate a very high volume of data. Depending on what you want to collect, track in your Workbooks, Analytics Rules, Hunting capabilities you will choose the option(s) you will deploy. Each options are independant for one from the other. To learn more about each option: ['Microsoft Exchange Security' wiki](https://aka.ms/ESI_DataConnectorOptions)\n\n>This Data Connector is the **option 5** of the wiki."
        },
        {
            "title": "1.  Download and install the agents needed to collect logs for Microsoft Sentinel",
            "description": "Type of servers (Exchange Servers, Domain Controllers linked to Exchange Servers or all Domain Controllers) depends on the option you want to deploy.",
            "instructions": [
                {
                    "parameters": {
                        "instructionSteps": [
                            {
                                "title": "Deploy Monitor Agents",
                                "description": "This step is required only if it's the first time you onboard your Exchange Servers/Domain Controllers\n**Deploy the Azure Arc Agent**\n> [Learn more](https://docs.microsoft.com/azure/azure-monitor/agents/azure-monitor-agent-install?tabs=ARMAgentPowerShell,PowerShellWindows,PowerShellWindowsArc,CLIWindows,CLIWindowsArc)"
                            }
                        ]
                    },
                    "type": "InstructionStepsGroup"
                }
            ]
        },
        {
            "title": "[Option 5] IIS logs of Exchange Servers",
            "description": "Select how to stream IIS logs of Exchange Servers",
            "instructions": [
                {
                    "parameters": {
                        "instructionSteps": [
                            {
                                "title": "Enable data collection rule",
                                "description": "> IIS logs are collected only from **Windows** agents.",
                                "instructions": [
                                    {
                                        "type": "AdminAuditEvents"
                                    },
                                    {
                                        "parameters": {
                                            "instructionSteps": [
                                                {
                                                    "title": "Option 1 - Azure Resource Manager (ARM) Template (Preferred Method)",
                                                    "description": "Use this method for automated deployment of the DCE and DCR.",
                                                    "instructions": [
                                                        {
                                                            "parameters": {
                                                                "instructionSteps": [
                                                                    {
                                                                        "title": "A. Create DCE (If not already created for Exchange Servers)",
                                                                        "description": "1. Click the **Deploy to Azure** button below. \n\n\t[![Deploy To Azure](https://aka.ms/deploytoazurebutton)](https://aka.ms/sentinel-ESI-DCEExchangeServers)\n2. Select the preferred **Subscription**, **Resource Group** and **Location**. \n3. You can change the proposed name of the DCE.\n5.  Click **Create** to deploy."
                                                                    },
                                                                    {
                                                                        "title": "B. Deploy Data Connection Rule",
                                                                        "description": "1. Click the **Deploy to Azure** button below. \n\n\t[![Deploy To Azure](https://aka.ms/deploytoazurebutton)](https://aka.ms/sentinel-ESI-DCROption5-azuredeploy)\n2. Select the preferred **Subscription**, **Resource Group** and **Location**. \n3. Enter the **Workspace ID** 'and/or Other required fields'.\n>4.  Mark the checkbox labeled **I agree to the terms and conditions stated above**. \n5.  Click **Purchase** to deploy."
                                                                    }
                                                                ]
                                                            },
                                                            "type": "InstructionStepsGroup"
                                                        }
                                                    ]
                                                },
                                                {
                                                    "title": "Option 2 - Manual Deployment of Azure Automation",
                                                    "description": "Use the following step-by-step instructions to deploy manually a Data Collection Rule.",
                                                    "instructions": [
                                                        {
                                                            "parameters": {
                                                                "instructionSteps": [
                                                                    {
                                                                        "title": "A. Create DCE (If not already created for Exchange Servers)",
                                                                        "description": "1.  From the Azure Portal, navigate to [Azure Data collection Endpoint](https://portal.azure.com/#view/Microsoft_Azure_Monitoring/AzureMonitoringBrowseBlade/~/dataCollectionEndpoints).\n2. Click **+ Create** at the top.\n3. In the **Basics** tab, fill the required fields and give a name to the DCE. \n3. 'Make other preferable configuration changes', if needed, then click **Create**."
                                                                    },
                                                                    {
                                                                        "title": "B. Create DCR, Type IIS log",
                                                                        "description": "1.  From the Azure Portal, navigate to [Azure Data collection rules](https://portal.azure.com/#view/Microsoft_Azure_Monitoring/AzureMonitoringBrowseBlade/~/dataCollectionRules).\n2. Click **+ Create** at the top.\n3. In the **Basics** tab, fill the required fields, Select Windows as platform type and give a name to the DCR. Select the created DCE. \n4. In the **Resources** tab, enter you Exchange Servers.\n5. In 'Collect and deliver', add a Data Source type 'IIS logs' (Do not enter a path if IIS Logs path is configured by default). Click on 'Add data source'\n6. 'Make other preferable configuration changes', if needed, then click **Create**."
                                                                    }
                                                                ]
                                                            },
                                                            "type": "InstructionStepsGroup"
                                                        }
                                                    ]
                                                },
                                                {
                                                    "title": "Assign the DCR to all Exchange Servers",
                                                    "description": "Add all your Exchange Servers to the DCR"
                                                }
                                            ]
                                        },
                                        "type": "InstructionStepsGroup"
                                    }
                                ]
                            }
                        ]
                    },
                    "type": "InstructionStepsGroup"
                }
            ]
        }
    ],
    "metadata": {
        "id": "4b1075ed-80f5-4930-bfe1-877e86b48dc1",
        "version": "1.0.0",
        "kind": "dataConnector",
        "source": {
            "kind": "solution",
            "name": "Microsoft Exchange Security - Exchange On-Premises"
        },
        "support": {
            "name": "Community",
            "tier": "Community",
            "link": "https://github.com/Azure/Azure-Sentinel/issues"
        },
        "author": {
            "name": "Microsoft"
        }
    }
}