{
  "id": "AzureStorageAccount",
  "title": "Azure Storage Account",
  "publisher": "Microsoft",
  "descriptionMarkdown": "Azure Storage account is a cloud solution for modern data storage scenarios. It contains all your data objects: blobs, files, queues, tables, and disks. This connector lets you stream Azure Storage accounts diagnostics logs into your Microsoft Sentinel workspace, allowing you to continuously monitor activity in all your instances, and detect malicious activity in your organization. For more information, see the [Microsoft Sentinel documentation](https://go.microsoft.com/fwlink/p/?linkid=2220068&wt.mc_id=sentinel_dataconnectordocs_content_cnl_csasci).",
  "graphQueries": [
    {
      "metricName": "Total data received",
      "legend": "AzureStorageAccount",
      "baseQuery": "AzureMetrics| where ResourceProvider == \"MICROSOFT.STORAGE\""
    },
    {
      "metricName": "Total data received",
      "legend": "StorageBlobLogs",
      "baseQuery": "StorageBlobLogs"
    },
    {
      "metricName": "Total data received",
      "legend": "StorageQueueLogs",
      "baseQuery": "StorageQueueLogs"
    },
    {
      "metricName": "Total data received",
      "legend": "StorageTableLogs",
      "baseQuery": "StorageTableLogs"
    },
    {
      "metricName": "Total data received",
      "legend": "StorageFileLogs",
      "baseQuery": "StorageFileLogs"
    }
  ],
  "sampleQueries": [
    {
      "description": "All logs",
      "query": "StorageBlobLogs\n | where TimeGenerated > ago(3d) \n | project TimeGenerated, OperationName, StatusCode, StatusText, _ResourceId\n | sort by TimeGenerated"
    }
  ],
  "connectivityCriterias": [
    {
      "type": "IsConnectedQuery",
      "value": [
        "AzureMetrics| where ResourceProvider == \"MICROSOFT.STORAGE\"\n            | summarize LastLogReceived = max(TimeGenerated)\n            | project IsConnected = LastLogReceived > ago(7d)",
        "StorageBlobLogs\n            | summarize LastLogReceived = max(TimeGenerated)\n            | project IsConnected = LastLogReceived > ago(7d)",
        "StorageQueueLogs\n            | summarize LastLogReceived = max(TimeGenerated)\n            | project IsConnected = LastLogReceived > ago(7d)",
        "StorageTableLogs\n            | summarize LastLogReceived = max(TimeGenerated)\n            | project IsConnected = LastLogReceived > ago(7d)",
        "StorageFileLogs\n            | summarize LastLogReceived = max(TimeGenerated)\n            | project IsConnected = LastLogReceived > ago(7d)"
      ]
    }
  ],
  "dataTypes": [
    {
      "name": "AzureMetrics (Azure Storage)",
      "lastDataReceivedQuery": "AzureMetrics| where ResourceProvider == \"MICROSOFT.STORAGE\"\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
    },
    {
      "name": "StorageBlobLogs",
      "lastDataReceivedQuery": "StorageBlobLogs\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
    },
    {
      "name": "StorageQueueLogs",
      "lastDataReceivedQuery": "StorageQueueLogs\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
    },
    {
      "name": "StorageTableLogs",
      "lastDataReceivedQuery": "StorageTableLogs\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
    },
    {
      "name": "StorageFileLogs",
      "lastDataReceivedQuery": "StorageFileLogs\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
    }
  ],
  "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
        }
      }
    ],
    "customs": [
      {
        "name": "Policy",
        "description": "owner role assigned for each policy assignment scope"
      }
    ]
  },
  "instructionSteps": [
    {
      "title": "Connect your Azure Storage Account diagnostics logs into Sentinel.",
      "description": "This connector uses a set of Azure Policies to apply a log-streaming configuration to a collection of instances, defined as a scope. Follow the instructions below to create and apply policies to all current and future instances. To get most out of the Storage Account Diagnostic logging from the Azure Storage Account, we recommend that you enable Diagnostic logging from all services within the Azure Storage Account - Blob, Queue, Table and File. Note, you may already have an active policy for this resource type.",
      "instructions": [
        {
          "parameters": {
            "noFxPadding": "1",
            "expanded": "1",
            "instructionSteps": [
              {
                "title": "Stream diagnostics logs from your Azure Storage Account at scale",
                "innerSteps": [
                  {
                    "title": "Launch the Azure Policy Assignment wizard and follow the steps. ",
                    "description": ">    1. In the **Basics** tab, click the button with the three dots under **Scope** to select your subscription.<br />2. In the **Parameters** tab, choose your Microsoft Sentinel workspace from the **Log Analytics workspace** drop-down list, and leave marked as \"True\" all the log categories you want to ingest.<br />3. To apply the policy on your existing resources, mark the **Create a remediation task** check box in the **Remediation** tab.</value>",
                    "instructions": [
                      {
                        "parameters": {
                          "policyDefinitionGuid": "59759c62-9a22-4cdf-ae64-074495983fef"
                        },
                        "type": "PolicyAssignment"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          "type": "InstructionStepsGroup"
        },
        {
          "parameters": {
            "noFxPadding": "1",
            "expanded": "1",
            "instructionSteps": [
              {
                "title": "Stream diagnostics logs from your Azure Storage Blob service at scale",
                "innerSteps": [
                  {
                    "title": "Launch the Azure Policy Assignment wizard and follow the steps. ",
                    "description": ">    1. In the **Basics** tab, click the button with the three dots under **Scope** to select your subscription.<br />2. In the **Parameters** tab, choose your Microsoft Sentinel workspace from the **Log Analytics workspace** drop-down list, and leave marked as \"True\" all the log categories you want to ingest.<br />3. To apply the policy on your existing resources, mark the **Create a remediation task** check box in the **Remediation** tab.</value>",
                    "instructions": [
                      {
                        "parameters": {
                          "policyDefinitionGuid": "b4fe1a3b-0715-4c6c-a5ea-ffc33cf823cb"
                        },
                        "type": "PolicyAssignment"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          "type": "InstructionStepsGroup"
        },
        {
          "parameters": {
            "noFxPadding": "1",
            "expanded": "1",
            "instructionSteps": [
              {
                "title": "Stream diagnostics logs from your Azure Storage Queue service at scale",
                "innerSteps": [
                  {
                    "title": "Launch the Azure Policy Assignment wizard and follow the steps. ",
                    "description": ">    1. In the **Basics** tab, click the button with the three dots under **Scope** to select your subscription.<br />2. In the **Parameters** tab, choose your Microsoft Sentinel workspace from the **Log Analytics workspace** drop-down list, and leave marked as \"True\" all the log categories you want to ingest.<br />3. To apply the policy on your existing resources, mark the **Create a remediation task** check box in the **Remediation** tab.</value>",
                    "instructions": [
                      {
                        "parameters": {
                          "policyDefinitionGuid": "7bd000e3-37c7-4928-9f31-86c4b77c5c45"
                        },
                        "type": "PolicyAssignment"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          "type": "InstructionStepsGroup"
        },
        {
          "parameters": {
            "noFxPadding": "1",
            "expanded": "1",
            "instructionSteps": [
              {
                "title": "Stream diagnostics logs from your Azure Storage Table service at scale",
                "innerSteps": [
                  {
                    "title": "Launch the Azure Policy Assignment wizard and follow the steps. ",
                    "description": ">    1. In the **Basics** tab, click the button with the three dots under **Scope** to select your subscription.<br />2. In the **Parameters** tab, choose your Microsoft Sentinel workspace from the **Log Analytics workspace** drop-down list, and leave marked as \"True\" all the log categories you want to ingest.<br />3. To apply the policy on your existing resources, mark the **Create a remediation task** check box in the **Remediation** tab.</value>",
                    "instructions": [
                      {
                        "parameters": {
                          "policyDefinitionGuid": "2fb86bf3-d221-43d1-96d1-2434af34eaa0"
                        },
                        "type": "PolicyAssignment"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          "type": "InstructionStepsGroup"
        },
        {
          "parameters": {
            "noFxPadding": "1",
            "expanded": "1",
            "instructionSteps": [
              {
                "title": "Stream diagnostics logs from your Azure Storage File service at scale",
                "innerSteps": [
                  {
                    "title": "Launch the Azure Policy Assignment wizard and follow the steps. ",
                    "description": ">    1. In the **Basics** tab, click the button with the three dots under **Scope** to select your subscription.<br />2. In the **Parameters** tab, choose your Microsoft Sentinel workspace from the **Log Analytics workspace** drop-down list, and leave marked as \"True\" all the log categories you want to ingest.<br />3. To apply the policy on your existing resources, mark the **Create a remediation task** check box in the **Remediation** tab.</value>",
                    "instructions": [
                      {
                        "parameters": {
                          "policyDefinitionGuid": "25a70cc8-2bd4-47f1-90b6-1478e4662c96"
                        },
                        "type": "PolicyAssignment"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          "type": "InstructionStepsGroup"
        }
      ]
    }
  ]
}
