Back
Idd3c4e5f6-3456-7890-12ab-cdef12345003
RulenameTailscale: User role elevated to admin or owner
DescriptionIdentifies when a user’s tailnet role changes from a lower-privilege role to admin, network-admin, or owner between consecutive snapshots. Privilege escalation is a high-value attacker objective and warrants prompt review.
SeverityHigh
TacticsPrivilegeEscalation
Persistence
TechniquesT1078
T1098
Required data connectorsTailscaleCCF
KindScheduled
Query frequency1h
Query period2d
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Tailscale%20%28CCF%29/Analytic%20Rules/TailscaleUserRoleElevated.yaml
Version1.0.0
Arm templated3c4e5f6-3456-7890-12ab-cdef12345003.json
Deploy To Azure
let elevated = dynamic(["admin", "network-admin", "owner"]);
let recent =
    Tailscale_Users_CL
    | where TimeGenerated > ago(1h)
    | summarize arg_max(TimeGenerated, *) by UserId
    | where Role in (elevated)
    | project UserId, LoginName, RoleNow = Role;
let prior =
    Tailscale_Users_CL
    | where TimeGenerated between (ago(2d) .. ago(1h))
    | summarize arg_max(TimeGenerated, *) by UserId
    | project UserId, RolePrior = Role;
recent
| join kind=inner prior on UserId
| where RoleNow != RolePrior
| where RolePrior !in (elevated)
| project TimeGenerated = now(), UserId, LoginName, RolePrior, RoleNow
incidentConfiguration:
  createIncident: true
  groupingConfiguration:
    lookbackDuration: P1D
    reopenClosedIncident: false
    enabled: true
    matchingMethod: AllEntities
entityMappings:
- entityType: Account
  fieldMappings:
  - columnName: LoginName
    identifier: FullName
query: |
  let elevated = dynamic(["admin", "network-admin", "owner"]);
  let recent =
      Tailscale_Users_CL
      | where TimeGenerated > ago(1h)
      | summarize arg_max(TimeGenerated, *) by UserId
      | where Role in (elevated)
      | project UserId, LoginName, RoleNow = Role;
  let prior =
      Tailscale_Users_CL
      | where TimeGenerated between (ago(2d) .. ago(1h))
      | summarize arg_max(TimeGenerated, *) by UserId
      | project UserId, RolePrior = Role;
  recent
  | join kind=inner prior on UserId
  | where RoleNow != RolePrior
  | where RolePrior !in (elevated)
  | project TimeGenerated = now(), UserId, LoginName, RolePrior, RoleNow
id: d3c4e5f6-3456-7890-12ab-cdef12345003
queryFrequency: 1h
status: Available
version: 1.0.0
severity: High
relevantTechniques:
- T1078
- T1098
name: 'Tailscale: User role elevated to admin or owner'
kind: Scheduled
tactics:
- PrivilegeEscalation
- Persistence
requiredDataConnectors:
- dataTypes:
  - Tailscale_Users_CL
  connectorId: TailscaleCCF
description: |
  Identifies when a user's tailnet role changes from a lower-privilege role to admin, network-admin, or owner between consecutive snapshots. Privilege escalation is a high-value attacker objective and warrants prompt review.
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Tailscale%20%28CCF%29/Analytic%20Rules/TailscaleUserRoleElevated.yaml
triggerOperator: gt
triggerThreshold: 0
queryPeriod: 2d
{
  "$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/d3c4e5f6-3456-7890-12ab-cdef12345003')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/d3c4e5f6-3456-7890-12ab-cdef12345003')]",
      "properties": {
        "alertRuleTemplateName": "d3c4e5f6-3456-7890-12ab-cdef12345003",
        "customDetails": null,
        "description": "Identifies when a user's tailnet role changes from a lower-privilege role to admin, network-admin, or owner between consecutive snapshots. Privilege escalation is a high-value attacker objective and warrants prompt review.\n",
        "displayName": "Tailscale: User role elevated to admin or owner",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "LoginName",
                "identifier": "FullName"
              }
            ]
          }
        ],
        "incidentConfiguration": {
          "createIncident": true,
          "groupingConfiguration": {
            "enabled": true,
            "lookbackDuration": "P1D",
            "matchingMethod": "AllEntities",
            "reopenClosedIncident": false
          }
        },
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Tailscale%20%28CCF%29/Analytic%20Rules/TailscaleUserRoleElevated.yaml",
        "query": "let elevated = dynamic([\"admin\", \"network-admin\", \"owner\"]);\nlet recent =\n    Tailscale_Users_CL\n    | where TimeGenerated > ago(1h)\n    | summarize arg_max(TimeGenerated, *) by UserId\n    | where Role in (elevated)\n    | project UserId, LoginName, RoleNow = Role;\nlet prior =\n    Tailscale_Users_CL\n    | where TimeGenerated between (ago(2d) .. ago(1h))\n    | summarize arg_max(TimeGenerated, *) by UserId\n    | project UserId, RolePrior = Role;\nrecent\n| join kind=inner prior on UserId\n| where RoleNow != RolePrior\n| where RolePrior !in (elevated)\n| project TimeGenerated = now(), UserId, LoginName, RolePrior, RoleNow\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "P2D",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "Persistence",
          "PrivilegeEscalation"
        ],
        "techniques": [
          "T1078",
          "T1098"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}