Back
Idcee6bbae-e1ee-4b65-9782-6afce5c330e6
RulenameUniqkey - Departing employee credential export
DescriptionCorrelates the archival, deletion or detachment of a Uniqkey employee account with data exports performed by that same employee during the preceding 14 days. An employee who exports credentials shortly before losing access is a classic insider-risk scenario, and organization credentials touched by the export should be considered for rotation. The action filter matches the offboarding action identifiers from the Uniqkey audit-log catalog, with a name-based fallback for future action variants.
SeverityHigh
TacticsCredentialAccess
Exfiltration
TechniquesT1555
Required data connectorsUniqkeyEventsConnector
KindScheduled
Query frequency1h
Query period14d
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Uniqkey/Analytic%20Rules/Uniqkey%20-%20Departing%20employee%20credential%20export.yaml
Version1.0.0
Arm templatecee6bbae-e1ee-4b65-9782-6afce5c330e6.json
Deploy To Azure
let lookback = 14d;
let frequency = 1h;
let exports =
    UniqkeyEvents_CL
    | where TimeGenerated > ago(lookback)
    | where Category == "data_export"
    | project ExportTime = TimeGenerated, ActorId, ActorEmail, ExportAction = Action, ExportedTargetType = TargetType, ExportedTargetName = TargetName, SrcIpAddr;
let removalActionIds = dynamic([
    "a2e18fcb-4d28-4f53-b2e3-24f03d0e188e", // Archive employee account
    "319c8a05-abd5-4b13-b51f-d6198578e61c", // Archive bulk employee
    "f1ed588f-975b-4bbe-83e9-e7a5c23e647f", // Hard delete employee
    "f8b81b6c-0082-4ed8-916e-83350f932e89", // Permanent delete employee account
    "4361dd86-0f70-47e0-91de-071a81d49834"  // Detach bulk employee account
]);
UniqkeyEvents_CL
| where TimeGenerated > ago(frequency)
| where Category == "account_management"
| where tolower(ActionId) in (removalActionIds) or Action has_any ("archive", "delete", "detach")
| where TargetType == "employee"
| project RemovalTime = TimeGenerated, RemovalAction = Action, RemovedEmployeeId = TargetId, RemovedEmployeeName = TargetName, RemovalActor = ActorEmail
| join kind=inner exports on $left.RemovedEmployeeId == $right.ActorId
| project RemovalTime, RemovalAction, RemovedEmployeeName, RemovalActor, ExportTime, ExportAction, ExportedTargetType, ExportedTargetName, ActorEmail, SrcIpAddr
tactics:
- CredentialAccess
- Exfiltration
name: Uniqkey - Departing employee credential export
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Uniqkey/Analytic%20Rules/Uniqkey%20-%20Departing%20employee%20credential%20export.yaml
version: 1.0.0
queryFrequency: 1h
requiredDataConnectors:
- connectorId: UniqkeyEventsConnector
  dataTypes:
  - UniqkeyEvents_CL
id: cee6bbae-e1ee-4b65-9782-6afce5c330e6
triggerThreshold: 0
entityMappings:
- fieldMappings:
  - identifier: FullName
    columnName: ActorEmail
  entityType: Account
- fieldMappings:
  - identifier: Address
    columnName: SrcIpAddr
  entityType: IP
queryPeriod: 14d
severity: High
relevantTechniques:
- T1555
eventGroupingSettings:
  aggregationKind: AlertPerResult
suppressionEnabled: false
description: Correlates the archival, deletion or detachment of a Uniqkey employee account with data exports performed by that same employee during the preceding 14 days. An employee who exports credentials shortly before losing access is a classic insider-risk scenario, and organization credentials touched by the export should be considered for rotation. The action filter matches the offboarding action identifiers from the Uniqkey audit-log catalog, with a name-based fallback for future action variants.
triggerOperator: gt
suppressionDuration: 5h
incidentConfiguration:
  createIncident: true
  groupingConfiguration:
    reopenClosedIncident: false
    enabled: true
    matchingMethod: AllEntities
    lookbackDuration: 5h
kind: Scheduled
query: |-
  let lookback = 14d;
  let frequency = 1h;
  let exports =
      UniqkeyEvents_CL
      | where TimeGenerated > ago(lookback)
      | where Category == "data_export"
      | project ExportTime = TimeGenerated, ActorId, ActorEmail, ExportAction = Action, ExportedTargetType = TargetType, ExportedTargetName = TargetName, SrcIpAddr;
  let removalActionIds = dynamic([
      "a2e18fcb-4d28-4f53-b2e3-24f03d0e188e", // Archive employee account
      "319c8a05-abd5-4b13-b51f-d6198578e61c", // Archive bulk employee
      "f1ed588f-975b-4bbe-83e9-e7a5c23e647f", // Hard delete employee
      "f8b81b6c-0082-4ed8-916e-83350f932e89", // Permanent delete employee account
      "4361dd86-0f70-47e0-91de-071a81d49834"  // Detach bulk employee account
  ]);
  UniqkeyEvents_CL
  | where TimeGenerated > ago(frequency)
  | where Category == "account_management"
  | where tolower(ActionId) in (removalActionIds) or Action has_any ("archive", "delete", "detach")
  | where TargetType == "employee"
  | project RemovalTime = TimeGenerated, RemovalAction = Action, RemovedEmployeeId = TargetId, RemovedEmployeeName = TargetName, RemovalActor = ActorEmail
  | join kind=inner exports on $left.RemovedEmployeeId == $right.ActorId
  | project RemovalTime, RemovalAction, RemovedEmployeeName, RemovalActor, ExportTime, ExportAction, ExportedTargetType, ExportedTargetName, ActorEmail, SrcIpAddr
{
  "$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/cee6bbae-e1ee-4b65-9782-6afce5c330e6')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/cee6bbae-e1ee-4b65-9782-6afce5c330e6')]",
      "properties": {
        "alertRuleTemplateName": "cee6bbae-e1ee-4b65-9782-6afce5c330e6",
        "customDetails": null,
        "description": "Correlates the archival, deletion or detachment of a Uniqkey employee account with data exports performed by that same employee during the preceding 14 days. An employee who exports credentials shortly before losing access is a classic insider-risk scenario, and organization credentials touched by the export should be considered for rotation. The action filter matches the offboarding action identifiers from the Uniqkey audit-log catalog, with a name-based fallback for future action variants.",
        "displayName": "Uniqkey - Departing employee credential export",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "ActorEmail",
                "identifier": "FullName"
              }
            ]
          },
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "SrcIpAddr",
                "identifier": "Address"
              }
            ]
          }
        ],
        "eventGroupingSettings": {
          "aggregationKind": "AlertPerResult"
        },
        "incidentConfiguration": {
          "createIncident": true,
          "groupingConfiguration": {
            "enabled": true,
            "lookbackDuration": "PT5H",
            "matchingMethod": "AllEntities",
            "reopenClosedIncident": false
          }
        },
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Uniqkey/Analytic%20Rules/Uniqkey%20-%20Departing%20employee%20credential%20export.yaml",
        "query": "let lookback = 14d;\nlet frequency = 1h;\nlet exports =\n    UniqkeyEvents_CL\n    | where TimeGenerated > ago(lookback)\n    | where Category == \"data_export\"\n    | project ExportTime = TimeGenerated, ActorId, ActorEmail, ExportAction = Action, ExportedTargetType = TargetType, ExportedTargetName = TargetName, SrcIpAddr;\nlet removalActionIds = dynamic([\n    \"a2e18fcb-4d28-4f53-b2e3-24f03d0e188e\", // Archive employee account\n    \"319c8a05-abd5-4b13-b51f-d6198578e61c\", // Archive bulk employee\n    \"f1ed588f-975b-4bbe-83e9-e7a5c23e647f\", // Hard delete employee\n    \"f8b81b6c-0082-4ed8-916e-83350f932e89\", // Permanent delete employee account\n    \"4361dd86-0f70-47e0-91de-071a81d49834\"  // Detach bulk employee account\n]);\nUniqkeyEvents_CL\n| where TimeGenerated > ago(frequency)\n| where Category == \"account_management\"\n| where tolower(ActionId) in (removalActionIds) or Action has_any (\"archive\", \"delete\", \"detach\")\n| where TargetType == \"employee\"\n| project RemovalTime = TimeGenerated, RemovalAction = Action, RemovedEmployeeId = TargetId, RemovedEmployeeName = TargetName, RemovalActor = ActorEmail\n| join kind=inner exports on $left.RemovedEmployeeId == $right.ActorId\n| project RemovalTime, RemovalAction, RemovedEmployeeName, RemovalActor, ExportTime, ExportAction, ExportedTargetType, ExportedTargetName, ActorEmail, SrcIpAddr",
        "queryFrequency": "PT1H",
        "queryPeriod": "P14D",
        "severity": "High",
        "subTechniques": [],
        "suppressionDuration": "PT5H",
        "suppressionEnabled": false,
        "tactics": [
          "CredentialAccess",
          "Exfiltration"
        ],
        "techniques": [
          "T1555"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}