Skip to content

Commit

Permalink
Merge pull request #11013 from pemontto/sentinel-all-in-one-v2
Browse files Browse the repository at this point in the history
Sentinel all in one v2
  • Loading branch information
v-atulyadav authored Aug 26, 2024
2 parents 1de7410 + d99ebea commit 5fea7a9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@
},
"roleGuid": {
"type": "string",
"defaultValue": "[newGuid()]"
"defaultValue": "[guid(resourceGroup().id, 'b24988ac-6180-42a0-ab88-20f7382dd24c')]"
}
},
"functions": [],
"variables": {
"identityName": "[concat('userIdentity',uniqueString(resourceGroup().id))]",
"roleGuidId": "[if(empty(parameters('roleGuid')), guid(resourceGroup().id, 'userIdentity', 'b24988ac-6180-42a0-ab88-20f7382dd24c'), parameters('roleGuid'))]",
"solutions": "[replace(concat(parameters('enableSolutions1P'),if(and(not(empty(parameters('enableSolutions1P'))),not(empty(parameters('enableSolutionsEssentials')))),concat(',',parameters('enableSolutionsEssentials')),parameters('enableSolutionsEssentials')),if(or(not(empty(parameters('enableSolutionsEssentials'))),not(empty(parameters('enableSolutions1P')))),concat(',',parameters('enableSolutionsTraining')),parameters('enableSolutionsTraining'))),'\"','\\\"')]",
"severities": "[if(empty(parameters('severityLevels')),'None',parameters('severityLevels'))]"
},
Expand All @@ -61,7 +62,9 @@
"location": "[resourceGroup().location]"
},
{
"dependsOn": ["[concat('Microsoft.ManagedIdentity/userAssignedIdentities/', variables('identityName'))]"],
"dependsOn": [
"[concat('Microsoft.ManagedIdentity/userAssignedIdentities/', variables('identityName'))]"
],
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2020-10-01",
"name": "sleep",
Expand All @@ -81,7 +84,7 @@
{
"apiVersion": "2017-09-01",
"type": "Microsoft.Authorization/roleAssignments",
"name": "[parameters('roleGuid')]",
"name": "[variables('roleGuidId')]",
"properties": {
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]",
"principalId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('identityName')), '2018-11-30', 'Full').properties.principalId]",
Expand All @@ -92,7 +95,9 @@
]
},
{
"dependsOn": ["[concat('Microsoft.Authorization/roleAssignments/', parameters('roleGuid'))]"],
"dependsOn": [
"[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('identityName'))]"
],
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2020-10-01",
"name": "deployRules",
Expand All @@ -107,8 +112,8 @@
"properties": {
"forceUpdateTag": "1",
"azPowerShellVersion": "3.0",
"arguments": "[concat('-Workspace ', parameters('workspaceName'), ' -ResourceGroup ', resourceGroup().name, ' -Solutions ', variables('solutions'), ' -SeveritiesToInclude ', string(variables('severities')), ' -Region ', parameters('location'), ' -IsGov $false')]",
"primaryScriptUri": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main/Scripts/Create-NewSolutionAndRulesFromList.ps1",
"arguments": "[concat('-Workspace ', parameters('workspaceName'), ' -ResourceGroup ', resourceGroup().name, ' -Solutions ', variables('solutions'), ' -SeveritiesToInclude ', string(variables('severities')), ' -Region ', parameters('location'), ' -IsGov $false')]",
"primaryScriptUri": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Tools/Sentinel-All-In-One/v2/Scripts/Create-NewSolutionAndRulesFromList.ps1",
"supportingScriptUris": [],
"timeout": "PT30M",
"cleanupPreference": "OnExpiration",
Expand All @@ -117,4 +122,4 @@
}
],
"outputs": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@
},
"roleGuid": {
"type": "string",
"defaultValue": "[newGuid()]"
"defaultValue": "[guid(resourceGroup().id, 'b24988ac-6180-42a0-ab88-20f7382dd24c')]"
}
},
"functions": [],
"variables": {
"identityName": "[concat('userIdentity',uniqueString(resourceGroup().id))]",
"roleGuidId": "[if(empty(parameters('roleGuid')), guid(resourceGroup().id, 'userIdentity', 'b24988ac-6180-42a0-ab88-20f7382dd24c'), parameters('roleGuid'))]",
"solutions": "[replace(concat(parameters('enableSolutions1P'),if(and(not(empty(parameters('enableSolutions1P'))),not(empty(parameters('enableSolutionsEssentials')))),concat(',',parameters('enableSolutionsEssentials')),parameters('enableSolutionsEssentials')),if(or(not(empty(parameters('enableSolutionsEssentials'))),not(empty(parameters('enableSolutions1P')))),concat(',',parameters('enableSolutionsTraining')),parameters('enableSolutionsTraining'))),'\"','\\\"')]",
"severities": "[if(empty(parameters('severityLevels')),'None',parameters('severityLevels'))]"
},
Expand All @@ -61,7 +62,9 @@
"location": "[resourceGroup().location]"
},
{
"dependsOn": [ "[concat('Microsoft.ManagedIdentity/userAssignedIdentities/', variables('identityName'))]" ],
"dependsOn": [
"[concat('Microsoft.ManagedIdentity/userAssignedIdentities/', variables('identityName'))]"
],
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2020-10-01",
"name": "sleep",
Expand All @@ -81,7 +84,7 @@
{
"apiVersion": "2017-09-01",
"type": "Microsoft.Authorization/roleAssignments",
"name": "[parameters('roleGuid')]",
"name": "[variables('roleGuidId')]",
"properties": {
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]",
"principalId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('identityName')), '2018-11-30', 'Full').properties.principalId]",
Expand All @@ -92,7 +95,9 @@
]
},
{
"dependsOn": [ "[concat('Microsoft.Authorization/roleAssignments/', parameters('roleGuid'))]" ],
"dependsOn": [
"[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('identityName'))]"
],
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2020-10-01",
"name": "deployRules",
Expand All @@ -108,7 +113,7 @@
"forceUpdateTag": "1",
"azPowerShellVersion": "3.0",
"arguments": "[concat('-Workspace ', parameters('workspaceName'), ' -ResourceGroup ', resourceGroup().name, ' -Solutions ', variables('solutions'), ' -SeveritiesToInclude ', string(variables('severities')), ' -Region ', parameters('location'), ' -IsGov $true')]",
"primaryScriptUri": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main/Scripts/Create-NewSolutionAndRulesFromList.ps1",
"primaryScriptUri": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Tools/Sentinel-All-In-One/v2/Scripts/Create-NewSolutionAndRulesFromList.ps1",
"supportingScriptUris": [],
"timeout": "PT30M",
"cleanupPreference": "OnExpiration",
Expand All @@ -117,4 +122,4 @@
}
],
"outputs": {}
}
}
11 changes: 5 additions & 6 deletions Tools/Sentinel-All-In-One/v2/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@
"defaultValue": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main"
}
},
"variables": {
},
"variables": {},
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
Expand All @@ -172,7 +171,7 @@
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main/LinkedTemplates/workspace.json",
"uri": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Tools/Sentinel-All-In-One/v2/LinkedTemplates/workspace.json",
"contentVersion": "1.0.0.0"
},
"parameters": {
Expand Down Expand Up @@ -211,7 +210,7 @@
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main/LinkedTemplates/settings.json",
"uri": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Tools/Sentinel-All-In-One/v2/LinkedTemplates/settings.json",
"contentVersion": "1.0.0.0"
},
"parameters": {
Expand Down Expand Up @@ -243,7 +242,7 @@
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main/LinkedTemplates/dataConnectors.json",
"uri": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Tools/Sentinel-All-In-One/v2/LinkedTemplates/dataConnectors.json",
"contentVersion": "1.0.0.0"
},
"parameters": {
Expand Down Expand Up @@ -281,7 +280,7 @@
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main/LinkedTemplates/solutionsAndAlerts.json",
"uri": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Tools/Sentinel-All-In-One/v2/LinkedTemplates/solutionsAndAlerts.json",
"contentVersion": "1.0.0.0"
},
"parameters": {
Expand Down
10 changes: 5 additions & 5 deletions Tools/Sentinel-All-In-One/v2/azuredeployGov.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"metadata": {
"description": "The location of resources"
},
"defaultValue": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main"
"defaultValue": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Tools/Sentinel-All-In-One/v2"
}
},
"variables": {
Expand All @@ -172,7 +172,7 @@
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main/LinkedTemplates/workspace.json",
"uri": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Tools/Sentinel-All-In-One/v2/LinkedTemplates/workspace.json",
"contentVersion": "1.0.0.0"
},
"parameters": {
Expand Down Expand Up @@ -211,7 +211,7 @@
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main/LinkedTemplates/settings.json",
"uri": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Tools/Sentinel-All-In-One/v2/LinkedTemplates/settings.json",
"contentVersion": "1.0.0.0"
},
"parameters": {
Expand Down Expand Up @@ -243,7 +243,7 @@
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main/LinkedTemplates/dataConnectorsGov.json",
"uri": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Tools/Sentinel-All-In-One/v2/LinkedTemplates/dataConnectorsGov.json",
"contentVersion": "1.0.0.0"
},
"parameters": {
Expand Down Expand Up @@ -281,7 +281,7 @@
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/garybushey/AllInOneGov/main/LinkedTemplates/solutionsAndAlertsGov.json",
"uri": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Tools/Sentinel-All-In-One/v2/LinkedTemplates/solutionsAndAlertsGov.json",
"contentVersion": "1.0.0.0"
},
"parameters": {
Expand Down

0 comments on commit 5fea7a9

Please sign in to comment.