{
    "title": "Azure Key Vault",
    "connectivityCriterias": [
        {
            "type": "IsConnectedQuery",
            "value": [
                "AzureDiagnostics | where ResourceProvider == \"MICROSOFT.KEYVAULT\"\n            | summarize LastLogReceived = max(TimeGenerated)\n            | project IsConnected = LastLogReceived > ago(7d)"
            ]
        }
    ],
    "id": "AzureKeyVault",
    "publisher": "Microsoft",
    "logo": "AzureKeyVault.svg",
    "lastDataReceivedInfoBalloon": "If no new data has been received in the last 14 days, the connector will display as being \"not connected.\" When the connector will recive data , the \"connected\" status will return.",
    "descriptionMarkdown": "Azure Key Vault is a cloud service for securely storing and accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, or cryptographic keys.   This connector lets you stream your Azure Key Vault diagnostics logs into Microsoft Sentinel, allowing you to continuously monitor activity in all your instances. For more information, see the [Microsoft Sentinel documentation](https://go.microsoft.com/fwlink/p/?linkid=2220125&wt.mc_id=sentinel_dataconnectordocs_content_cnl_csasci).",
    "graphQueries": [
        {
            "metricName": "Total data received",
            "legend": "AzureDiagnostics",
            "baseQuery": "AzureDiagnostics | where ResourceProvider == \"MICROSOFT.KEYVAULT\""
        }
    ],
    "sampleQueries": [
        {
            "description": "All logs",
            "query": "AzureDiagnostics | where ResourceProvider == \"MICROSOFT.KEYVAULT\"\n            | summarize count() by CallerIPAddress"
        },
        {
            "description": "All logs",
            "query": "AzureDiagnostics | where ResourceProvider == \"MICROSOFT.KEYVAULT\"\n            | where OperationName == \"VaultPut\" or OperationName == \"VaultPatch\"\n            | sort by TimeGenerated"
        },
        {
            "description": "All logs",
            "query": "AzureDiagnostics | where ResourceProvider == \"MICROSOFT.KEYVAULT\"\n            | where ResourceProvider == \"MICROSOFT.KEYVAULT\" \n                                                                              and parse_json(properties_s).DataErrorType in \n                                                                              (\"InputDeserializerError.InvalidData\", \"InputDeserializerError.TypeConversionError\", \n                                                                              \"InputDeserializerError.MissingColumns\", \"InputDeserializerError.InvalidHeader\",\n                                                                              \"InputDeserializerError.InvalidCompressionType\")\n                                                                              | project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId"
        }
    ],
    "dataTypes": [
        {
            "name": "KeyVaultData",
            "lastDataReceivedQuery": "AzureDiagnostics | where ResourceProvider == \"MICROSOFT.KEYVAULT\"\n            | summarize Time = max(TimeGenerated)\n            | where isnotempty(Time)"
        }
    ],
    "instructionSteps": [
        {
            "title": "Connect your Azure Key Vault diagnostics logs into Sentinel.",
            "description": "This connector uses Azure Policy to apply a single Azure Key Vault  log-streaming configuration to a collection of instances, defined as a scope.   \nFollow the instructions below to create and apply a policy to all current and future instances. **Note**, you may already have an active policy for this resource type.",
            "instructions": [
                {
                    "parameters": {
                        "noFxPadding": true,
                        "expanded": true,
                        "instructionSteps": [
                            {
                                "title": "Stream diagnostics logs from your Azure Key Vault at scale",
                                "description": null,
                                "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 resources assignment scope.\n        >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 and metric types you want to ingest.\n        >3. To apply the policy on your existing resources, select the **Remediation tab** and mark the **Create a remediation task** checkbox.",
                                        "instructions": [
                                            {
                                                "parameters": {
                                                    "linkType": "OpenPolicyAssignment",
                                                    "policyDefinitionGuid": "951af2fa-529b-416e-ab6e-066fd85ac459",
                                                    "assignMode": 1
                                                },
                                                "type": "InstallAgent"
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    },
                    "type": "InstructionStepsGroup"
                }
            ]
        }
    ],
    "permissions": {
        "resourceProvider": [
            {
                "provider": "Microsoft.OperationalInsights/workspaces",
                "permissionsDisplayText": "read and write permissions.",
                "providerDisplayName": "Workspace",
                "scope": "Workspace",
                "requiredPermissions": {
                    "read": true,
                    "write": true,
                    "delete": true
                }
            }
        ],
        "customs": [
            {
                "name": "Policy​",
                "description": "owner role assigned for each policy assignment scope.​"
            }
        ]
    },
    "availability": {
        "status": 2,
        "isPreview": false,
        "featureFlag": {
            "feature": "AzureKeyVaultFeature",
            "featureStates": {
                "1": 2,
                "2": 2,
                "3": 2,
                "4": 2,
                "5": 2,
                "6": 1,
                "7": 1,
                "8": 2
            }
        }
    },
    "ascAssessment": {
        "assessmentKey": "b1af52e4-e968-4e2b-b6d0-6736c9651f0a",
        "assessmentLinkText": "Enable Microsoft Defender for Key-Vaults now",
        "assessmentDescriptions": "Microsoft Defender for Key-Vaults provides real-time protection for your Azure Key-Vaults Services. Enable Microsoft Defender for Key-Vaults,connect it into Sentinel, and use Key-Vaults diagnostic logs in order to investigate Microsoft Defender alerts into a root cause in Sentinel.",
        "assessmentSectionTitleText": "Enable Microsoft Defender for Key-Vaults - Recommended!"
    }
}
