CiscoSEGEvent
| where NetworkDirection =~ 'Incoming'
| where tostring(AdditionalFields) has 'ESAAttachmentDetails'
| extend attachment = replace_string(tostring(extract(@'"ESAAttachmentDetails":"{(.*?):', 1, tostring(AdditionalFields))), "'", "")
| where attachment endswith '.ps1' or attachment endswith '.lnk' or attachment endswith '.exe'
| extend AccountCustomEntity = DstUserName
entityMappings:
- entityType: Account
fieldMappings:
- identifier: Name
columnName: AccountCustomEntity
queryFrequency: 1h
name: Cisco SEG - Unexpected attachment
kind: Scheduled
tactics:
- InitialAccess
triggerThreshold: 0
query: |
CiscoSEGEvent
| where NetworkDirection =~ 'Incoming'
| where tostring(AdditionalFields) has 'ESAAttachmentDetails'
| extend attachment = replace_string(tostring(extract(@'"ESAAttachmentDetails":"{(.*?):', 1, tostring(AdditionalFields))), "'", "")
| where attachment endswith '.ps1' or attachment endswith '.lnk' or attachment endswith '.exe'
| extend AccountCustomEntity = DstUserName
relevantTechniques:
- T1566
triggerOperator: gt
queryPeriod: 1h
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/CiscoSEG/Analytic Rules/CiscoSEGUnexpextedAttachment.yaml
severity: High
status: Available
id: f8ba18c4-81e3-4db0-8f85-4989f2ed2ade
requiredDataConnectors:
- connectorId: CefAma
dataTypes:
- CommonSecurityLog
version: 1.0.3
description: |
'Detects possibly malicious attachments.'
{
"$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/f8ba18c4-81e3-4db0-8f85-4989f2ed2ade')]",
"kind": "Scheduled",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/f8ba18c4-81e3-4db0-8f85-4989f2ed2ade')]",
"properties": {
"alertRuleTemplateName": "f8ba18c4-81e3-4db0-8f85-4989f2ed2ade",
"customDetails": null,
"description": "'Detects possibly malicious attachments.'\n",
"displayName": "Cisco SEG - Unexpected attachment",
"enabled": true,
"entityMappings": [
{
"entityType": "Account",
"fieldMappings": [
{
"columnName": "AccountCustomEntity",
"identifier": "Name"
}
]
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/CiscoSEG/Analytic Rules/CiscoSEGUnexpextedAttachment.yaml",
"query": "CiscoSEGEvent\n| where NetworkDirection =~ 'Incoming'\n| where tostring(AdditionalFields) has 'ESAAttachmentDetails'\n| extend attachment = replace_string(tostring(extract(@'\"ESAAttachmentDetails\":\"{(.*?):', 1, tostring(AdditionalFields))), \"'\", \"\")\n| where attachment endswith '.ps1' or attachment endswith '.lnk' or attachment endswith '.exe'\n| extend AccountCustomEntity = DstUserName\n",
"queryFrequency": "PT1H",
"queryPeriod": "PT1H",
"severity": "High",
"status": "Available",
"subTechniques": [],
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"InitialAccess"
],
"techniques": [
"T1566"
],
"templateVersion": "1.0.3",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0
},
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
}
]
}