Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a Bicep Azure Sentinel module #385

Merged
merged 7 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/bicep/mlz.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ module logAnalyticsWorkspace './modules/logAnalyticsWorkspace.bicep' = {
}

//// hub and spoke

module hub './modules/hubNetwork.bicep' = {
name: 'deploy-hub-${nowUtc}'
scope: resourceGroup(hubSubscriptionId, hubResourceGroupName)
Expand Down
11 changes: 11 additions & 0 deletions src/bicep/modules/logAnalyticsWorkspace.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ param tags object = {}
param retentionInDays int = 30
param skuName string = 'PerGB2018'
param workspaceCappingDailyQuotaGb int = -1
param deploySentinel bool = false

resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-06-01' = {
name: name
Expand All @@ -20,5 +21,15 @@ resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-06
}
}

//// sentinel
module sentinelSolution './sentinelSolution.bicep' = if (deploySentinel) {
name: 'sentinelSolution'
params: {
workspaceName: logAnalyticsWorkspace.name
workspaceLocation: location
tags: tags
}
}

output id string = logAnalyticsWorkspace.id
output name string = logAnalyticsWorkspace.name
25 changes: 25 additions & 0 deletions src/bicep/modules/sentinelSolution.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
param workspaceName string
param workspaceLocation string
param tags object = {}

resource workspace 'Microsoft.OperationalInsights/workspaces@2020-08-01' existing = {
name: workspaceName
}

resource sentinelSolution 'Microsoft.OperationsManagement/solutions@2015-11-01-preview'= {
name: 'SecurityInsights(${workspaceName})'
location: workspaceLocation
tags:tags
dependsOn:[
workspace
]
properties: {
workspaceResourceId: workspace.id
}
plan: {
name: 'SecurityInsights(${workspaceName})'
publisher: 'Microsoft'
product: 'OMSGallery/SecurityInsights'
promotionCode: ''
}
}
vidyambala marked this conversation as resolved.
Show resolved Hide resolved