May 06 2022 01:07 AM
Hi,
As for the analytics rule synced from Github to Sentinel, we could just simply export the rules and import it to github. However, I am not able to export the automation rules to json file and could not find the guide for the sync.
Could you provide some guidance on it? Thanks
May 06 2022 04:27 AM
@Steven_Su It does not look like the MS Sentinel PowerShell (https://www.powershellgallery.com/packages/Az.SecurityInsights/1.1.0) has added the functionality for automation yet so you would need to use the REST API. You can go to azure-rest-api-specs/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/prev... to get the information on how to make the calls.
I would think you would need to make a call to LIST all the automation rules and then either break apart the returned JSON to save each one individually or just use it to get the individual rule's ID. Then you can make a call to GET each individual rule and save it.
May 06 2022 04:49 AM
May 09 2022 05:19 AM
SolutionMay 11 2022 01:09 AM
May 11 2022 04:23 AM
May 12 2022 07:34 PM
@Gary Bushey Hi, this is the format i used to sync from Github repo to Sentinel.
ps. I masked some information with xxxx/yyyy/zzzz/wwww
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.1",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/AutomationRules/yyyyyyyyyy')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/yyyyyyyyyy')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/automationRules",
"apiVersion": "2021-10-01-preview",
"properties": {
"displayName": "testing _jira_0511_0336",
"order": 1,
"triggeringLogic": {
"isEnabled": true,
"triggersOn": "Incidents",
"triggersWhen": "Created",
"conditions": [
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentRelatedAnalyticRuleIds",
"operator": "Contains",
"propertyValues": [
"/subscriptions/xxxxxxxxxxxxxx/resourceGroups/endpoint_log_testing/providers/Microsoft.OperationalInsights/workspaces/endpoint-log-testing/providers/Microsoft.SecurityInsights/alertRules/zzzzzzzzzz"
]
}
},
{
"conditionType": "Property",
"conditionProperties": {
"propertyName": "IncidentStatus",
"operator": "Equals",
"propertyValues": [
"New"
]
}
}
]
},
"actions": [
{
"order": 1,
"actionType": "RunPlaybook",
"actionConfiguration": {
"logicAppResourceId": "/subscriptions/xxxxxxxxxxxxxx/resourceGroups/endpoint_log_testing/providers/Microsoft.Logic/workflows/CreateJiraIssue",
"tenantId": "wwwwwwwwww"
}
}
]
}
}
]
}