{
    "id": "MongoDB",
    "title": "[Deprecated] MongoDB Audit",
    "publisher": "MongoDB",
    "descriptionMarkdown": "MongoDB data connector provides the capability to ingest [MongoDBAudit](https://www.mongodb.com/) into Microsoft Sentinel. Refer to [MongoDB documentation](https://www.mongodb.com/docs/manual/tutorial/getting-started/) for more information.",
    "additionalRequirementBanner": "These queries are dependent on a parser based on a Kusto Function deployed as part of the solution.",
    "graphQueries": [
        {
            "metricName": "Total data received",
            "legend": "MongoDBAudit_CL",
            "baseQuery": "MongoDBAudit_CL"
        }
    ],
    "sampleQueries": [{
		"description": "MongoDBAudit - All Activities.",
		"query": "MongoDBAudit_CL\n | sort by TimeGenerated desc"
	}],
    "dataTypes": [
        {
            "name": "MongoDBAudit_CL",
            "lastDataReceivedQuery": "MongoDBAudit_CL\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
        }
    ],
    "connectivityCriterias": [
        {
            "type": "IsConnectedQuery",
            "value": [
                "MongoDBAudit_CL\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": {
                    "write": true,
                    "read": 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": "",
            "description": "**NOTE:** This data connector depends on a parser based on a Kusto Function to work as expected which is deployed as part of the solution. To view the function code in Log Analytics, open Log Analytics/Microsoft Sentinel Logs blade, click Functions and search for the alias MongoDBAudit and load the function code or click [here](https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/MongoDBAudit/Parsers/MongoDBAudit.txt) on the second line of the query, enter the hostname(s) of your MongoDBAudit device(s) and any other unique identifiers for the logstream. The function usually takes 10-15 minutes to activate after solution installation/update.",
            "instructions": [
            ]
        },
        {
            "title": "1. Install and onboard the agent for Linux or Windows",
            "description": "Install the agent on the Tomcat Server where the logs are generated.\n\n> Logs from MongoDB Enterprise Server deployed on Linux or Windows servers are collected by **Linux** or **Windows** agents.",
            "instructions": [
                {
                "parameters": {
                "title": "Choose where to install the Linux agent:",
    "instructionSteps": [
            {
            "title": "Install agent on Azure Linux Virtual Machine",
            "description": "Select the machine to install the agent on and then click **Connect**.",
            "instructions": [
                {
                "parameters": {
                "linkType": "InstallAgentOnLinuxVirtualMachine"
                },
                "type": "InstallAgent"
                }
            ]
        },
            {
            "title": "Install agent on a non-Azure Linux Machine",
            "description": "Download the agent on the relevant machine and follow the instructions.",
            "instructions": [
                {
                "parameters": {
                "linkType": "InstallAgentOnLinuxNonAzure"
                },
                "type": "InstallAgent"
                }
            ]
        }
    ]
        },
            "type": "InstructionStepsGroup"
            }
        ]
            },
            {
                "instructions": [
                    {
                    "parameters": {
                    "title": "Choose where to install the Windows agent:",
        "instructionSteps": [
                {
                "title": "Install agent on Azure Windows Virtual Machine",
                "description": "Select the machine to install the agent on and then click **Connect**.",
                "instructions": [
                    {
                    "parameters": {
                    "linkType": "InstallAgentOnVirtualMachine"
                    },
                    "type": "InstallAgent"
                    }
                ]
            },
                {
                "title": "Install agent on a non-Azure Windows Machine",
                "description": "Download the agent on the relevant machine and follow the instructions.",
                "instructions": [
                    {
                    "parameters": {
                    "linkType": "InstallAgentOnNonAzure"
                    },
                    "type": "InstallAgent"
                    }
                ]
            }
        ]
            },
                "type": "InstructionStepsGroup"
                }
            ]
                },
    {
                    "title": "2. Configure MongoDBAudit to write logs to files",
                    "description":"Edit mongod.conf file (for Linux) or mongod.cfg (for Windows) to write logs to files:\n\n>**dbPath**: data/db\n\n>**path**: data/db/auditLog.json\n\nSet the following parameters: **dbPath** and **path**. Refer to the [MongoDB documentation for more details](https://www.mongodb.com/docs/manual/tutorial/configure-auditing/)"
                },
    {
            "title": "3. Configure the logs to be collected",
            "description": "Configure the custom log directory to be collected" ,
            "instructions": [
                {
                    "parameters": {
                        "linkType": "OpenCustomLogsSettings"
                    },
                    "type": "InstallAgent"
                }
            ]
        },
    {
        "title": "",
        "description":"1. Select the link above to open your workspace advanced settings \n2. From the left pane, select **Settings**, select **Custom Logs** and click **+Add custom log**\n3. Click **Browse** to upload a sample of a MongoDBAudit log file. Then, click **Next >**\n4. Select **Timestamp** as the record delimiter and click **Next >**\n5. Select **Windows** or **Linux** and enter the path to MongoDBAudit logs based on your configuration \n6. After entering the path, click the '+' symbol to apply, then click **Next >** \n7. Add **MongoDBAudit** as the custom log Name (the '_CL' suffix will be added automatically) and click **Done**."
    },
    {
        "title": "Validate connectivity",
        "description":"It may take upwards of 20 minutes until your logs start to appear in Microsoft Sentinel."
    }
],
    "metadata": {
        "id": "Unique Identifier (GUID) used to identify dependencies and content from solutions or community.",
        "version": "1.0.0",
        "kind": "dataConnector",
        "source": {
            "kind": "community"
        },
        "author": {
            "name": "Microsoft"
        },
        "support": {
            "tier": "community",
            "name": "Microsoft",
            "link":"https://github.com/Azure/Azure-Sentinel/issues"
        }
    }
}