Back
Ide7dbcbc3-b18f-4635-b27c-718195c369f1
RulenameClaroty - Login to uncommon location
DescriptionDetects user login to uncommon location.
SeverityMedium
TacticsInitialAccess
TechniquesT1190
T1133
Required data connectorsCefAma
KindScheduled
Query frequency1h
Query period14d
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Claroty/Analytic%20Rules/ClarotyLoginToUncommonSite.yaml
Version1.0.4
Arm templatee7dbcbc3-b18f-4635-b27c-718195c369f1.json
Deploy To Azure
let usr_sites = ClarotyEvent
| where TimeGenerated > ago(14d)
| where EventType has 'Login to SRA succeeded'
| extend Site = column_ifexists("site_name","")
| where isnotempty(Site)
| extend SrcUsername = extract(@'User\s(.*?)\slogged', 1, EventMessage)
| where isnotempty(SrcUsername)
| summarize all_loc = make_set(tostring(Site)) by SrcUsername;
ClarotyEvent
| where TimeGenerated > ago(14d)
| where EventType has 'Login to SRA succeeded'
| extend Site = column_ifexists("site_name","")
| where isnotempty(Site)
| extend SrcUsername = extract(@'User\s(.*?)\slogged', 1, EventMessage)
| where isnotempty(SrcUsername)
| join kind=leftouter (usr_sites) on SrcUsername
| where isempty(all_loc) or not(set_has_element(all_loc, tostring(Site)))
| extend SrcIpAddr
| summarize StartTime=min(TimeGenerated), EndTime=max(TimeGenerated), EventCount=count(), Sites=make_set(Site, 100), KnownSites=any(all_loc) by SrcUsername, SrcIpAddr, Site, EventType, EventMessage
| extend UncommonSiteCount = array_length(Sites)
| project StartTime, EndTime, SrcUsername, SrcIpAddr, Site, EventType, EventMessage, EventCount, UncommonSiteCount, KnownSites
entityMappings:
- entityType: IP
  fieldMappings:
  - identifier: Address
    columnName: SrcIpAddr
name: Claroty - Login to uncommon location
kind: Scheduled
triggerOperator: gt
status: Available
queryPeriod: 14d
requiredDataConnectors:
- connectorId: CefAma
  dataTypes:
  - CommonSecurityLog
tactics:
- InitialAccess
query: |
  let usr_sites = ClarotyEvent
  | where TimeGenerated > ago(14d)
  | where EventType has 'Login to SRA succeeded'
  | extend Site = column_ifexists("site_name","")
  | where isnotempty(Site)
  | extend SrcUsername = extract(@'User\s(.*?)\slogged', 1, EventMessage)
  | where isnotempty(SrcUsername)
  | summarize all_loc = make_set(tostring(Site)) by SrcUsername;
  ClarotyEvent
  | where TimeGenerated > ago(14d)
  | where EventType has 'Login to SRA succeeded'
  | extend Site = column_ifexists("site_name","")
  | where isnotempty(Site)
  | extend SrcUsername = extract(@'User\s(.*?)\slogged', 1, EventMessage)
  | where isnotempty(SrcUsername)
  | join kind=leftouter (usr_sites) on SrcUsername
  | where isempty(all_loc) or not(set_has_element(all_loc, tostring(Site)))
  | extend SrcIpAddr
  | summarize StartTime=min(TimeGenerated), EndTime=max(TimeGenerated), EventCount=count(), Sites=make_set(Site, 100), KnownSites=any(all_loc) by SrcUsername, SrcIpAddr, Site, EventType, EventMessage
  | extend UncommonSiteCount = array_length(Sites)
  | project StartTime, EndTime, SrcUsername, SrcIpAddr, Site, EventType, EventMessage, EventCount, UncommonSiteCount, KnownSites
description: Detects user login to uncommon location.
severity: Medium
id: e7dbcbc3-b18f-4635-b27c-718195c369f1
triggerThreshold: 0
queryFrequency: 1h
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Claroty/Analytic%20Rules/ClarotyLoginToUncommonSite.yaml
version: 1.0.4
relevantTechniques:
- T1190
- T1133
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "apiVersion": "2024-01-01-preview",
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/e7dbcbc3-b18f-4635-b27c-718195c369f1')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/e7dbcbc3-b18f-4635-b27c-718195c369f1')]",
      "properties": {
        "alertRuleTemplateName": "e7dbcbc3-b18f-4635-b27c-718195c369f1",
        "customDetails": null,
        "description": "Detects user login to uncommon location.",
        "displayName": "Claroty - Login to uncommon location",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "SrcIpAddr",
                "identifier": "Address"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Claroty/Analytic%20Rules/ClarotyLoginToUncommonSite.yaml",
        "query": "let usr_sites = ClarotyEvent\n| where TimeGenerated > ago(14d)\n| where EventType has 'Login to SRA succeeded'\n| extend Site = column_ifexists(\"site_name\",\"\")\n| where isnotempty(Site)\n| extend SrcUsername = extract(@'User\\s(.*?)\\slogged', 1, EventMessage)\n| where isnotempty(SrcUsername)\n| summarize all_loc = make_set(tostring(Site)) by SrcUsername;\nClarotyEvent\n| where TimeGenerated > ago(14d)\n| where EventType has 'Login to SRA succeeded'\n| extend Site = column_ifexists(\"site_name\",\"\")\n| where isnotempty(Site)\n| extend SrcUsername = extract(@'User\\s(.*?)\\slogged', 1, EventMessage)\n| where isnotempty(SrcUsername)\n| join kind=leftouter (usr_sites) on SrcUsername\n| where isempty(all_loc) or not(set_has_element(all_loc, tostring(Site)))\n| extend SrcIpAddr\n| summarize StartTime=min(TimeGenerated), EndTime=max(TimeGenerated), EventCount=count(), Sites=make_set(Site, 100), KnownSites=any(all_loc) by SrcUsername, SrcIpAddr, Site, EventType, EventMessage\n| extend UncommonSiteCount = array_length(Sites)\n| project StartTime, EndTime, SrcUsername, SrcIpAddr, Site, EventType, EventMessage, EventCount, UncommonSiteCount, KnownSites\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "P14D",
        "severity": "Medium",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "InitialAccess"
        ],
        "techniques": [
          "T1133",
          "T1190"
        ],
        "templateVersion": "1.0.4",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}