{
    "id": "ESI-Opt2ExchangeServersEventLogs",
    "title": "Microsoft Exchange Logs and Events",
    "publisher": "Microsoft",
    "descriptionMarkdown": "[Option 2] - Using Azure Monitor Agent - You can stream all Exchange Security & Application Event 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 Eventlogs",
            "baseQuery": "Event | where EventLog == 'Application'"
        }
    ],
    "sampleQueries": [
        {
            "description": "All Audit logs",
            "query": "Event | where EventLog == 'Application' | sort by TimeGenerated"
        }
    ],
    "dataTypes": [
        {
            "name": "Event",
            "lastDataReceivedQuery": "Event | where EventLog == 'Application'  | summarize Time = max(TimeGenerated) | where isnotempty(Time)"
        }
    ],
    "connectivityCriterias": [
        {
            "type": "IsConnectedQuery",
            "value": [
                "Event | where EventLog == 'Application'  | 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": [
            {
                "name": "Azure Log Analytics will be deprecated",
                "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 2** 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": "2. [Option 2] Security/Application/System logs of Exchange Servers",
            "description": "The Security/Application/System logs of Exchange Servers are collected using Data Collection Rules (DCR).",
            "instructions": [
                {
                    "parameters": {
                        "title": "Security Event log collection",
                        "instructionSteps": [
                            {
                                "title": "Data Collection Rules - Security Event logs",
                                "description": "**Enable data collection rule for Security Logs**\nSecurity Events logs are collected only from **Windows** agents.\n1. Add Exchange Servers on *Resources* tab.\n2. Select Security log level\n\n>  **Common level** is the minimum required. Please select 'Common' or 'All Security Events' on DCR definition.",
                                "instructions": [
                                    {
                                        "parameters": {
                                            "linkType": "OpenCreateDataCollectionRule",
                                            "dataCollectionRuleType": 0
                                        },
                                        "type": "InstallAgent"
                                    }
                                ]
                            }
                        ]
                    },
                    "type": "InstructionStepsGroup"
                },
                {
                    "parameters": {
                        "title": "Application and System Event log collection",
                        "instructionSteps": [
                            {
                                "title": "Enable data collection rule",
                                "description": ">  Application and System Events logs are collected only from **Windows** agents.",
                                "instructions": [
                                    {
                                        "parameters": {
                                            "instructionSteps": [
                                                {
                                                    "title": "Option 1 - Azure Resource Manager (ARM) Template (Prefered method)",
                                                    "description": "Use this method for automated deployment of the DCR.\n\n1. Click the **Deploy to Azure** button below. \n\n\t[![Deploy To Azure](https://aka.ms/deploytoazurebutton)](https://aka.ms/sentinel-ESI-DCROption2-azuredeploy)\n2. Select the preferred **Subscription**, **Resource Group** and **Location**. \n3. Enter the **Workspace Name** '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."
                                                },
                                                {
                                                    "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 DCR, Type Event 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. \n4. In the **Resources** tab, enter you Exchange Servers.\n5. In 'Collect and deliver', add a Data Source type 'Windows Event logs' and select 'Basic' option.\n6. For Application, select 'Critical', 'Error' and 'Warning'. For System, select Critical/Error/Warning/Information. \n7. '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": "22e0234b-278d-40f4-8be8-c2968faeaf91",
        "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"
        }
    }
}