Microsoft Sentinel Analytic Rules
cloudbrothers.infoAzure Sentinel RepoToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

GWorkspace - Unexpected OS update

Back
Idc02b0c8e-5da6-11ec-bf63-0242ac130002
RulenameGWorkspace - Unexpected OS update
DescriptionDetects unexpected OS update.
SeverityMedium
TacticsDefenseEvasion
Persistence
TechniquesT1036
T1554
Required data connectorsGoogleWorkspaceReportsAPI
KindScheduled
Query frequency1h
Query period1h
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/GoogleWorkspaceReports/Analytic Rules/GWorkspaceUnexpectedOSUpdate.yaml
Version1.0.2
Arm templatec02b0c8e-5da6-11ec-bf63-0242ac130002.json
Deploy To Azure
GWorkspaceActivityReports
| where EventMessage has "os_updated"
| where isnotempty(NeqValue) and isnotempty(OldValue)
| extend NewVersion1 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 1, NeqValue)
| extend NewVersion2 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 2, NeqValue)
| extend NewVersion3 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 3, NeqValue)
| extend OldVersion1 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 1, OldValue)
| extend OldVersion2 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 2, OldValue)
| extend OldVersion3 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 3, OldValue)
| extend NewVersion3Comparision = iff(isempty(NewVersion3), 0, tolong(NewVersion3))
| extend OldVersion3Comparision = iff(isempty(OldVersion3), 0, tolong(OldVersion3))
| extend Comparision1 = iff(tolong(NewVersion3Comparision) > tolong(OldVersion3Comparision), 'Expected version', 'Unexpected version')
| extend Comparision2 = iff(tolong(NewVersion2) > tolong(OldVersion2), 'Expected version', Comparision1)
| extend VersionCheck = iff(tolong(NewVersion1) > tolong(OldVersion1), 'Expected version', Comparision2)
| project-away NewVersion1, NewVersion2, NewVersion3, NewVersion3Comparision, OldVersion1, OldVersion2, OldVersion3, OldVersion3Comparision, Comparision1, Comparision2
| extend AccountCustomEntity = ActorEmail
name: GWorkspace - Unexpected OS update
version: 1.0.2
severity: Medium
queryFrequency: 1h
triggerOperator: gt
relevantTechniques:
- T1036
- T1554
status: Available
description: |
    'Detects unexpected OS update.'
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/GoogleWorkspaceReports/Analytic Rules/GWorkspaceUnexpectedOSUpdate.yaml
requiredDataConnectors:
- connectorId: GoogleWorkspaceReportsAPI
  dataTypes:
  - GWorkspaceActivityReports
entityMappings:
- fieldMappings:
  - identifier: Name
    columnName: AccountCustomEntity
  entityType: Account
tactics:
- DefenseEvasion
- Persistence
queryPeriod: 1h
query: |
  GWorkspaceActivityReports
  | where EventMessage has "os_updated"
  | where isnotempty(NeqValue) and isnotempty(OldValue)
  | extend NewVersion1 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 1, NeqValue)
  | extend NewVersion2 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 2, NeqValue)
  | extend NewVersion3 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 3, NeqValue)
  | extend OldVersion1 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 1, OldValue)
  | extend OldVersion2 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 2, OldValue)
  | extend OldVersion3 = extract(@'([0-9]+)\.([0-9]+)\.?([0-9])?', 3, OldValue)
  | extend NewVersion3Comparision = iff(isempty(NewVersion3), 0, tolong(NewVersion3))
  | extend OldVersion3Comparision = iff(isempty(OldVersion3), 0, tolong(OldVersion3))
  | extend Comparision1 = iff(tolong(NewVersion3Comparision) > tolong(OldVersion3Comparision), 'Expected version', 'Unexpected version')
  | extend Comparision2 = iff(tolong(NewVersion2) > tolong(OldVersion2), 'Expected version', Comparision1)
  | extend VersionCheck = iff(tolong(NewVersion1) > tolong(OldVersion1), 'Expected version', Comparision2)
  | project-away NewVersion1, NewVersion2, NewVersion3, NewVersion3Comparision, OldVersion1, OldVersion2, OldVersion3, OldVersion3Comparision, Comparision1, Comparision2
  | extend AccountCustomEntity = ActorEmail  
kind: Scheduled
triggerThreshold: 0
id: c02b0c8e-5da6-11ec-bf63-0242ac130002
{
  "$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/c02b0c8e-5da6-11ec-bf63-0242ac130002')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/c02b0c8e-5da6-11ec-bf63-0242ac130002')]",
      "properties": {
        "alertRuleTemplateName": "c02b0c8e-5da6-11ec-bf63-0242ac130002",
        "customDetails": null,
        "description": "'Detects unexpected OS update.'\n",
        "displayName": "GWorkspace - Unexpected OS update",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "AccountCustomEntity",
                "identifier": "Name"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/GoogleWorkspaceReports/Analytic Rules/GWorkspaceUnexpectedOSUpdate.yaml",
        "query": "GWorkspaceActivityReports\n| where EventMessage has \"os_updated\"\n| where isnotempty(NeqValue) and isnotempty(OldValue)\n| extend NewVersion1 = extract(@'([0-9]+)\\.([0-9]+)\\.?([0-9])?', 1, NeqValue)\n| extend NewVersion2 = extract(@'([0-9]+)\\.([0-9]+)\\.?([0-9])?', 2, NeqValue)\n| extend NewVersion3 = extract(@'([0-9]+)\\.([0-9]+)\\.?([0-9])?', 3, NeqValue)\n| extend OldVersion1 = extract(@'([0-9]+)\\.([0-9]+)\\.?([0-9])?', 1, OldValue)\n| extend OldVersion2 = extract(@'([0-9]+)\\.([0-9]+)\\.?([0-9])?', 2, OldValue)\n| extend OldVersion3 = extract(@'([0-9]+)\\.([0-9]+)\\.?([0-9])?', 3, OldValue)\n| extend NewVersion3Comparision = iff(isempty(NewVersion3), 0, tolong(NewVersion3))\n| extend OldVersion3Comparision = iff(isempty(OldVersion3), 0, tolong(OldVersion3))\n| extend Comparision1 = iff(tolong(NewVersion3Comparision) > tolong(OldVersion3Comparision), 'Expected version', 'Unexpected version')\n| extend Comparision2 = iff(tolong(NewVersion2) > tolong(OldVersion2), 'Expected version', Comparision1)\n| extend VersionCheck = iff(tolong(NewVersion1) > tolong(OldVersion1), 'Expected version', Comparision2)\n| project-away NewVersion1, NewVersion2, NewVersion3, NewVersion3Comparision, OldVersion1, OldVersion2, OldVersion3, OldVersion3Comparision, Comparision1, Comparision2\n| extend AccountCustomEntity = ActorEmail\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "severity": "Medium",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "DefenseEvasion",
          "Persistence"
        ],
        "techniques": [
          "T1036",
          "T1554"
        ],
        "templateVersion": "1.0.2",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}