GitHubAuditData
| where Action == "pull_request.create"
| project Actor, Action
| extend AccountName = tostring(split(Actor, "@")[0]), AccountUPNSuffix = tostring(split(Actor, "@")[1])
kind: Scheduled
query: |
GitHubAuditData
| where Action == "pull_request.create"
| project Actor, Action
| extend AccountName = tostring(split(Actor, "@")[0]), AccountUPNSuffix = tostring(split(Actor, "@")[1])
relevantTechniques:
- T1078
entityMappings:
- entityType: Account
fieldMappings:
- columnName: Actor
identifier: FullName
- columnName: AccountName
identifier: Name
- columnName: AccountUPNSuffix
identifier: UPNSuffix
triggerOperator: gt
triggerThreshold: 0
queryPeriod: 7d
tactics:
- InitialAccess
id: 0b85a077-8ba5-4cb5-90f7-1e882afe10c7
requiredDataConnectors: []
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/GitHub/Analytic Rules/(Preview) GitHub - pull request was created.yaml
description: |
'Detect activities when a pull request was created. This query runs every day and its severity is Medium.'
queryFrequency: 1d
name: (Preview) GitHub - pull request was created
severity: Medium
version: 1.0.1
status: Available
{
"$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/0b85a077-8ba5-4cb5-90f7-1e882afe10c7')]",
"kind": "Scheduled",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/0b85a077-8ba5-4cb5-90f7-1e882afe10c7')]",
"properties": {
"alertRuleTemplateName": "0b85a077-8ba5-4cb5-90f7-1e882afe10c7",
"customDetails": null,
"description": "'Detect activities when a pull request was created. This query runs every day and its severity is Medium.'\n",
"displayName": "(Preview) GitHub - pull request was created",
"enabled": true,
"entityMappings": [
{
"entityType": "Account",
"fieldMappings": [
{
"columnName": "Actor",
"identifier": "FullName"
},
{
"columnName": "AccountName",
"identifier": "Name"
},
{
"columnName": "AccountUPNSuffix",
"identifier": "UPNSuffix"
}
]
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/GitHub/Analytic Rules/(Preview) GitHub - pull request was created.yaml",
"query": "GitHubAuditData \n| where Action == \"pull_request.create\"\n| project Actor, Action\n| extend AccountName = tostring(split(Actor, \"@\")[0]), AccountUPNSuffix = tostring(split(Actor, \"@\")[1])\n",
"queryFrequency": "P1D",
"queryPeriod": "P7D",
"severity": "Medium",
"status": "Available",
"subTechniques": [],
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"InitialAccess"
],
"techniques": [
"T1078"
],
"templateVersion": "1.0.1",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0
},
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
}
]
}