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

Update tier3.bicep Adding Defender configuration to Tier 3 #725

Merged
Merged
2 changes: 2 additions & 0 deletions src/bicep/add-ons/tier3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ resourcePrefix | mlz | A prefix, 3 to 10 characters in length, to append to reso
Optional Parameters | Default | Description
------------------- | ------- | -----------
virtualNetworkAddressPrefix | 10.0.125.0/26 | The address prefix for the network spoke vnet.
deployDefender | Output from mlz.bicep (false) | When set to "true", enables Microsoft Defender for Cloud for the subscriptions used in the deployment. It defaults to "false".
lisamurphy-msft marked this conversation as resolved.
Show resolved Hide resolved
emailSecurityContact | Output from mlz.bicep (empty '') | Email address of the contact, in the form of [email protected]
lisamurphy-msft marked this conversation as resolved.
Show resolved Hide resolved

### Generate MLZ Variable File

Expand Down
15 changes: 15 additions & 0 deletions src/bicep/add-ons/tier3/tier3.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ param logAnalyticsWorkspaceResourceId string = mlzDeploymentVariables.logAnalyti
param logAnalyticsWorkspaceName string = mlzDeploymentVariables.logAnalyticsWorkspaceName.Value
param firewallPrivateIPAddress string = mlzDeploymentVariables.firewallPrivateIPAddress.Value

@description('When set to "true", enables Microsoft Defender for Cloud for the subscriptions used in the deployment. It defaults to "false".')
param deployDefender bool = mlzDeploymentVariables.deployDefender.Value
@description('Email address of the contact, in the form of [email protected]')
param emailSecurityContact string = mlzDeploymentVariables.emailSecurityContact.Value


@description('The address prefix for the network spoke vnet.')
param virtualNetworkAddressPrefix string = '10.0.125.0/26'

Expand Down Expand Up @@ -190,6 +196,15 @@ module workloadSubscriptionActivityLogging '../../modules/central-logging.bicep'
]
}

module spokeDefender '../../modules/defender.bicep' = if (deployDefender) {
name: 'set-${workloadName}-sub-defender'
scope: subscription(workloadSubscriptionId)
params: {
logAnalyticsWorkspaceId: logAnalyticsWorkspaceResourceId
emailSecurityContact: emailSecurityContact
}
}

output resourceGroupName string = resourceGroup.outputs.name
output location string = resourceGroup.outputs.location
output tags object = resourceGroup.outputs.tags
Expand Down
4 changes: 4 additions & 0 deletions src/bicep/mlz.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,10 @@ output hub object = {
networkSecurityGroupResourceId: hubNetwork.outputs.networkSecurityGroupResourceId
}

output deployDefender bool = deployDefender

output emailSecurityContact string = emailSecurityContact

output logAnalyticsWorkspaceName string = logAnalyticsWorkspace.outputs.name

output logAnalyticsWorkspaceResourceId string = logAnalyticsWorkspace.outputs.id
Expand Down