{
    "id": "FortinetAma",
    "title": "[Deprecated] Fortinet via AMA",
    "publisher": "Fortinet",
    "logo": "FortinetLogo.svg",
    "descriptionMarkdown": "The Fortinet firewall connector allows you to easily connect your Fortinet logs with Microsoft Sentinel, to view dashboards, create custom alerts, and improve investigation. This gives you more insight into your organization's network and improves your security operation capabilities.",
    "graphQueries": [
        {
            "metricName": "Total data received",
            "legend": "Fortinet",
            "baseQuery": "CommonSecurityLog\n |where DeviceVendor =~ 'Fortinet'\n |where DeviceProduct =~ 'Fortigate'\n  |extend sent_by_ama = column_ifexists('CollectorHostName','')\n |where isnotempty(sent_by_ama)"
        }
    ],
    "sampleQueries": [
        {
            "description": "All logs",
            "query": "\nCommonSecurityLog\n| where DeviceVendor == \"Fortinet\"\n| where DeviceProduct startswith \"Fortigate\"\n\n            | sort by TimeGenerated"
        },
        {
            "description": "Summarize by destination IP and port",
            "query": "\nCommonSecurityLog\n| where DeviceVendor == \"Fortinet\"\n| where DeviceProduct startswith \"Fortigate\"\n\n            | summarize count() by DestinationIP, DestinationPort, TimeGenerated​\n            | sort by TimeGenerated"
        }
    ],
    "connectivityCriterias": [
        {
            "type": "IsConnectedQuery",
            "value": [
                "CommonSecurityLog\n |where DeviceVendor =~ 'Fortinet'\n |where DeviceProduct =~ 'Fortigate'\n   |extend sent_by_ama = column_ifexists('CollectorHostName','')\n |where isnotempty(sent_by_ama)\n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(30d)"
            ]
        }
    ],
    "dataTypes": [
        {
            "name": "CommonSecurityLog (Fortinet)",
            "lastDataReceivedQuery": "CommonSecurityLog\n |where DeviceVendor =~ 'Fortinet'\n |where DeviceProduct =~ 'Fortigate'\n |extend sent_by_ama = column_ifexists('CollectorHostName','')\n |where isnotempty(sent_by_ama)\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
        }
    ],
    "availability": {
        "status": 1,
		"isPreview": true,
        "featureFlag": {
            "feature": "FortinetConnector",
            "featureStates": {
                "1": 2,
                "2": 2,
                "3": 2,
                "4": 2,
                "5": 2,
                "6": 1,
                "7": 1
            }
        }
    },
    "permissions": {
        "resourceProvider": [
            {
                "provider": "Microsoft.OperationalInsights/workspaces",
                "permissionsDisplayText": "read and write permissions are required.",
                "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": "To collect data from non-Azure VMs, they must have Azure Arc installed and enabled. [Learn more](https://docs.microsoft.com/azure/azure-monitor/agents/azure-monitor-agent-install?tabs=ARMAgentPowerShell,PowerShellWindows,PowerShellWindowsArc,CLIWindows,CLIWindowsArc)"
      },
      {
        "description": "Common Event Format (CEF) via AMA and Syslog via AMA data connectors must be installed [Learn more](https://learn.microsoft.com/azure/sentinel/connect-cef-ama#open-the-connector-page-and-create-the-dcr)"
      }	  
    ]
    },
    "instructionSteps": [
       { 
            "title": "", 
            "description": "",
            "instructions": [ 
			      {
                    "parameters": {
                        "title": "1. Kindly follow the steps to configure the data connector",
                        "instructionSteps": [
                            {
                                "title": "Step A. Configure the Common Event Format (CEF) via AMA data connector",
                                "description": "_Note:- CEF logs are collected only from Linux Agents_\n\n1. Navigate to Microsoft Sentinel workspace ---> configuration ---> Data connector blade .\n\n2. Search for 'Common Event Format (CEF) via AMA' data connector and open it.\n\n3. Check If there is no existing DCR configured to collect required facility of logs, Create a new DCR (Data Collection Rule)\n\n\t_Note:- It is recommended to install minimum 1.27 version of AMA agent [Learn more](https://learn.microsoft.com/azure/azure-monitor/agents/azure-monitor-agent-manage?tabs=azure-portal ) and ensure there is no duplicate DCR as it can cause log duplicacy_\n\n4. Run the command provided in the CEF via AMA data connector page to configure the CEF collector on the machine"
                            },
                            {
                                "title": "Step B. Forward Fortinet logs to Syslog agent",
                               "description": "Set your Fortinet to send Syslog messages in CEF format to the proxy machine. Make sure you to send the logs to port 514 TCP on the machine’s IP address.\n\n\nCopy the CLI commands below and:\n-   Replace \"server &lt;ip address&gt;\" with the Syslog agent's IP address.\n-   Set the \"&lt;facility_name&gt;\" to use the facility you configured in the Syslog agent (by default, the agent sets this to local4).\n-   Set the Syslog port to 514, the port your agent uses.\n-   To enable CEF format in early FortiOS versions, you may need to run the command \"set csv disable\".\n\nFor more information, go to the  [Fortinet Document Library](https://aka.ms/asi-syslog-fortinet-fortinetdocumentlibrary), choose your version, and use the \"Handbook\" and \"Log Message Reference\" PDFs.\n\n[Learn more >](https://aka.ms/CEF-Fortinet)",
                               "instructions": [
                               {
                                "parameters": {
                                 "label": "Set up the connection using the CLI to run the following commands:",
                                  "value": "config log syslogd setting\n    set status enable\nset format cef\nset port 514\nset server <ip_address_of_Receiver>\nend",
                                  "rows": 8
                    },
                    "type": "CopyableLabel"
                }
            ]
                            },
							{
								"title": "Step C. Validate connection",
								"description": "Follow the instructions to validate your connectivity:\n\nOpen Log Analytics to check if the logs are received using the CommonSecurityLog schema.\n\nIt may take about 20 minutes until the connection streams data to your workspace.\n\nIf the logs are not received, run the following connectivity validation script:\n\n 1. Make sure that you have Python on your machine using the following command: python -version\n\n2. You must have elevated permissions (sudo) on your machine",
								"instructions": [
									{
										"parameters": {
										"label": "Run the following command to validate your connectivity:",
										"value": "sudo wget -O Sentinel_AMA_troubleshoot.py https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/DataConnectors/Syslog/Sentinel_AMA_troubleshoot.py&&sudo python Sentinel_AMA_troubleshoot.py --cef"
										},
										"type": "CopyableLabel"
									}
								]
							}							
                        ]
                    },
                    "type": "InstructionStepsGroup"
                }
            ]    
        },
        
        {
            "title": "2. Secure your machine ",
            "description": "Make sure to configure the machine's security according to your organization's security policy\n\n\n[Learn more >](https://aka.ms/SecureCEF)"
        }
    ],
    "metadata": {
        "id": "19ecaeff-8959-4cb8-a11e-a150ecd5a494",
        "version": "1.0.0",
        "kind": "dataConnector",
        "source": {
            "kind": "community"
        },
        "author": {
            "name": "Fortinet"
        },
        "support": {
            "name": "Fortinet",
            "link": "https://www.fortinet.com/support/contact",
            "tier": "developer"
        }
    }
}