1+ {
2+ "$schema" : " https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#" ,
3+ "contentVersion" : " 1.0.0.0" ,
4+ "metadata" : {
5+ "comments" : " This playbook is intended to be run from an Microsoft Sentinel Incident. It will generate a Jira Service Management Alert." ,
6+ "author" : " Atlassian"
7+ },
8+ "parameters" : {
9+ "logicAppName" : {
10+ "type" : " string" ,
11+ "metadata" : {
12+ "description" : " The name of the logic app to create."
13+ }
14+ },
15+ "endpoint" : {
16+ "type" : " string" ,
17+ "metadata" : {
18+ "description" : " JSM operations endpoint"
19+ }
20+ }
21+ },
22+ "variables" : {
23+ "azuresentinel" : " [concat('azuresentinel-', parameters('logicAppName'))]"
24+ },
25+ "resources" : [
26+ {
27+ "type" : " Microsoft.Web/connections" ,
28+ "apiVersion" : " 2016-06-01" ,
29+ "name" : " [variables('azuresentinel')]" ,
30+ "location" : " [resourceGroup().location]" ,
31+ "properties" : {
32+ "displayName" : " [parameters('logicAppName')]" ,
33+ "customParameterValues" : {
34+ },
35+ "api" : {
36+ "id" : " [concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/azuresentinel')]"
37+ }
38+ }
39+ },
40+ {
41+ "type" : " Microsoft.Logic/workflows" ,
42+ "apiVersion" : " 2019-05-01" ,
43+ "name" : " [parameters('logicAppName')]" ,
44+ "location" : " [resourceGroup().location]" ,
45+ "dependsOn" : [
46+ " [resourceId('Microsoft.Web/connections', variables('azuresentinel'))]"
47+ ],
48+ "tags" : {
49+ "displayName" : " [parameters('logicAppName')]"
50+ },
51+ "properties" : {
52+ "state" : " Enabled" ,
53+ "definition" : {
54+ "$schema" : " https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#" ,
55+ "contentVersion" : " 1.0.0.0" ,
56+ "parameters" : {
57+ "endpoint" : {
58+ "type" : " string" ,
59+ "defaultValue" : " [parameters('endpoint')]"
60+ },
61+ "$connections" : {
62+ "defaultValue" : {},
63+ "type" : " Object"
64+ }
65+ },
66+ "triggers" : {
67+ "Microsoft_Sentinel_incident" : {
68+ "type" : " ApiConnectionWebhook" ,
69+ "inputs" : {
70+ "body" : {
71+ "callback_url" : " @{listCallbackUrl()}"
72+ },
73+ "host" : {
74+ "connection" : {
75+ "name" : " @parameters('$connections')['azuresentinel']['connectionId']"
76+ }
77+ },
78+ "path" : " /incident-creation"
79+ }
80+ }
81+ },
82+ "actions" : {
83+ "Create_Alert" : {
84+ "type" : " Http" ,
85+ "inputs" : {
86+ "body" : {
87+ "id" : " @triggerBody()?['object']?['name']" ,
88+ "description" : " @triggerBody()?['object']?['properties']?['description']" ,
89+ "title" : " @triggerBody()?['object']?['properties']?['title']" ,
90+ "severity" : " @triggerBody()?['object']?['properties']?['severity']" ,
91+ "status" : " @triggerBody()?['object']?['properties']?['status']" ,
92+ "incidentUrl" : " @triggerBody()?['object']?['properties']?['incidentUrl']" ,
93+ "labels" : " @triggerBody()?['object']?['properties']?['labels']" ,
94+ "resourceGroupName" : " @triggerBody()?['workspaceInfo']?['ResourceGroupName']" ,
95+ "workspaceName" : " @triggerBody()?['workspaceInfo']?['WorkspaceName']" ,
96+ "subscriptionId" : " @triggerBody()?['workspaceInfo']?['SubscriptionId']"
97+ },
98+ "headers" : {
99+ "Content-Type" : " application/json"
100+ },
101+ "method" : " POST" ,
102+ "uri" : " [parameters('endpoint')]"
103+ }
104+ }
105+ }
106+ },
107+ "parameters" : {
108+ "$connections" : {
109+ "value" : {
110+ "azuresentinel" : {
111+ "connectionId" : " [resourceId('Microsoft.Web/connections', variables('azuresentinel'))]" ,
112+ "connectionName" : " [variables('azuresentinel')]" ,
113+ "id" : " [concat('/subscriptions/', subscription().subscriptionId,'/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/azuresentinel')]"
114+ }
115+ }
116+ }
117+ }
118+ }
119+ }
120+ ],
121+ "outputs" : {
122+ "name" : {
123+ "type" : " string" ,
124+ "value" : " [parameters('logicAppName')]"
125+ },
126+ "resourceId" : {
127+ "type" : " string" ,
128+ "value" : " [resourceId('Microsoft.Logic/workflows', parameters('logicAppName'))]"
129+ },
130+ "resourceGroupName" : {
131+ "type" : " string" ,
132+ "value" : " [resourceGroup().name]"
133+ },
134+ "location" : {
135+ "type" : " string" ,
136+ "value" : " [resourceGroup().location]"
137+ }
138+ }
139+ }
0 commit comments