Detection rules › Kusto

Vulnerable Machines related to log4j CVE-2021-44228

Status
available
Severity
high
Time window
1d
Group by
Description, RecommendationName, RecommendationSubscriptionId, RemediationDescription, TenantId, VirtualMachine, VulnerabilityId
Source
github.com/Azure/Azure-Sentinel

'This query uses the Azure Defender Security Nested Recommendations data to find machines vulnerable to log4j CVE-2021-44228. Log4j is an open-source Apache logging library that is used in many Java-based applications. Security Nested Recommendations data is sent to Microsoft Sentinel using the continuous export feature of Azure Defender(refrence link below). Reference: https://msrc-blog.microsoft.com/2021/12/11/microsofts-response-to-cve-2021-44228-apache-log4j2/ Reference: https://docs.microsoft.com/azure/security-center/continuous-export?tabs=azure-portal Reference: https://techcommunity.microsoft.com/t5/microsoft-defender-for-cloud/how-defender-for-cloud-displays-machines-affected-by-log4j/ba-p/3037271'

MITRE ATT&CK coverage

Rule body kusto

id: 3d71fc38-f249-454e-8479-0a358382ef9a
name: Vulnerable Machines related to log4j CVE-2021-44228
description: |
  'This query uses the Azure Defender Security Nested Recommendations data to find machines vulnerable to log4j CVE-2021-44228.
  Log4j is an open-source Apache logging library that is used in many Java-based applications. Security Nested Recommendations data is sent to Microsoft Sentinel using the continuous export feature of Azure Defender(refrence link below).
   Reference: https://msrc-blog.microsoft.com/2021/12/11/microsofts-response-to-cve-2021-44228-apache-log4j2/
   Reference: https://docs.microsoft.com/azure/security-center/continuous-export?tabs=azure-portal
   Reference: https://techcommunity.microsoft.com/t5/microsoft-defender-for-cloud/how-defender-for-cloud-displays-machines-affected-by-log4j/ba-p/3037271'
severity: High
status: Available
requiredDataConnectors: []
queryFrequency: 1d
queryPeriod: 1d
triggerOperator: gt
triggerThreshold: 0
tactics:
  - InitialAccess
  - Execution
relevantTechniques:
  - T1190
  - T1203
tags:
  - Log4j
  - CVE-2021-44228
  - Log4shell
query: |
  SecurityNestedRecommendation
  | where RemediationDescription has 'CVE-2021-44228'
  | parse ResourceDetails with * 'virtualMachines/' VirtualMachine '"' *
  | summarize arg_min(TimeGenerated, *) by TenantId, RecommendationSubscriptionId, VirtualMachine, RecommendationName,Description,RemediationDescription, tostring(AdditionalData),VulnerabilityId
  | extend Timestamp = TimeGenerated
entityMappings:
  - entityType: Host
    fieldMappings:
      - identifier: HostName
        columnName: VirtualMachine
version: 1.0.3
kind: Scheduled

Stages and Predicates

Stage 1: source

SecurityNestedRecommendation

Stage 2: where

| where RemediationDescription has 'CVE-2021-44228'

Stage 3: parse

| parse ResourceDetails with * 'virtualMachines/' VirtualMachine '"' *

Stage 4: summarize

| summarize arg_min(TimeGenerated, *) by TenantId, RecommendationSubscriptionId, VirtualMachine, RecommendationName,Description,RemediationDescription, tostring(AdditionalData),VulnerabilityId

Stage 5: extend

| extend Timestamp = TimeGenerated

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
RemediationDescriptionmatch
  • CVE-2021-44228 transforms: term

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
Descriptionsummarize
RecommendationNamesummarize
RecommendationSubscriptionIdsummarize
RemediationDescriptionsummarize
TenantIdsummarize
VirtualMachinesummarize
VulnerabilityIdsummarize
Timestampextend