Detection rules › Kusto
Tailscale: New API access token or OAuth client created
Identifies when a new API access token or OAuth client is created in the tailnet. These grant programmatic access - verify the actor and intent.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rule body
id: 668b43fd-cf28-961a-85af-957850df5027
name: "Tailscale: New API access token or OAuth client created"
description: |
Identifies when a new API access token or OAuth client is created in the tailnet. These grant programmatic access - verify the actor and intent.
severity: Medium
status: Available
requiredDataConnectors:
- connectorId: TailscaleCCF
dataTypes:
- Tailscale_Audit_CL
queryFrequency: 15m
queryPeriod: 15m
triggerOperator: gt
triggerThreshold: 0
tactics:
- Persistence
- CredentialAccess
relevantTechniques:
- T1098
- T1136
query: |
Tailscale_Audit_CL
| where Action == "CREATE"
| where tostring(Target.type) in ("API_KEY", "OAUTH_CLIENT")
| extend ActorLogin = tostring(Actor.loginName)
| extend TargetName = tostring(Target.name)
| extend TargetId = tostring(Target.id)
| project TimeGenerated, ActorLogin, Action, TargetName, TargetId, Origin, New
entityMappings:
- entityType: Account
fieldMappings:
- identifier: FullName
columnName: ActorLogin
incidentConfiguration:
createIncident: true
groupingConfiguration:
enabled: true
reopenClosedIncident: false
lookbackDuration: PT5H
matchingMethod: AllEntities
kind: Scheduled
version: 1.0.0
Stages and Predicates
Stage 1: source
Tailscale_Audit_CL
Stage 2: where
| where Action == "CREATE"
Stage 3: where
| where tostring(Target.type) in ("API_KEY", "OAUTH_CLIENT")
Stage 4: extend (3 consecutive steps)
| extend ActorLogin = tostring(Actor.loginName)
| extend TargetName = tostring(Target.name)
| extend TargetId = tostring(Target.id)
Stage 5: project
| project TimeGenerated, ActorLogin, Action, TargetName, TargetId, Origin, New
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
Action | eq |
| field:"Action" kind:eq value:"CREATE" |
type | in |
| field:"type" kind:in |
Output fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
Action | project |
ActorLogin | project |
New | project |
Origin | project |
TargetId | project |
TargetName | project |
TimeGenerated | project |