Skip to content

Commit d4c58c8

Browse files
feat: update managed identity configurations and enhance web security (#2189)
Co-authored-by: Roopan-Microsoft <168007406+Roopan-Microsoft@users.noreply.github.com>
1 parent e53460a commit d4c58c8

4 files changed

Lines changed: 28 additions & 8 deletions

File tree

extensions/teams/infra/azure.bicep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ resource webApp 'Microsoft.Web/sites@2024-04-01' = {
4444
kind: 'app'
4545
location: location
4646
name: webAppName
47+
identity: {
48+
type: 'SystemAssigned'
49+
}
4750
properties: {
4851
serverFarmId: serverfarm.id
4952
httpsOnly: true

infra/modules/app/eventgrid.bicep

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,17 @@ module avmEventGridSystemTopic 'br/public:avm/res/event-grid/system-topic:0.6.4'
5353
eventSubscriptions: [
5454
{
5555
name: name
56-
destination: {
57-
endpointType: 'StorageQueue'
58-
properties: {
59-
queueName: queueName
60-
resourceId: storageAccountId
56+
deliveryWithResourceIdentity: {
57+
identity: {
58+
type: 'UserAssigned'
59+
userAssignedIdentity: userAssignedResourceId
60+
}
61+
destination: {
62+
endpointType: 'StorageQueue'
63+
properties: {
64+
queueName: queueName
65+
resourceId: storageAccountId
66+
}
6167
}
6268
}
6369
eventDeliverySchema: 'EventGridSchema'

infra/modules/core/host/appservice.bicep

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ param clientAffinityEnabled bool = true
3737
param appServiceEnvironmentResourceId string?
3838

3939
import { managedIdentityAllType } from 'br/public:avm/utl/types/avm-common-types:0.7.0'
40-
@description('Optional. The managed identity definition for this resource.')
41-
param managedIdentities managedIdentityAllType?
40+
@description('Optional. The managed identity definition for this resource. Defaults to system-assigned managed identity.')
41+
param managedIdentities managedIdentityAllType = {
42+
systemAssigned: true
43+
}
4244

4345
@description('Optional. The resource ID of the assigned identity to be used to access a key vault with.')
4446
param keyVaultAccessIdentityResourceId string?

infra/modules/core/host/web-sites.config.bicep

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,16 @@ var appInsightsValues = !empty(applicationInsightResourceId)
5858
}
5959
: {}
6060

61-
var expandedProperties = union(currentAppSettings, properties, azureWebJobsValues, appInsightsValues)
61+
// Ensure FTPS enforcement and other security settings for 'web' config
62+
var webConfigSecurityDefaults = name == 'web'
63+
? {
64+
ftpsState: 'FtpsOnly'
65+
minTlsVersion: '1.3'
66+
httpsOnly: true
67+
}
68+
: {}
69+
70+
var expandedProperties = union(currentAppSettings, properties, azureWebJobsValues, appInsightsValues, webConfigSecurityDefaults)
6271

6372
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = if (!empty(applicationInsightResourceId)) {
6473
name: last(split(applicationInsightResourceId!, '/'))

0 commit comments

Comments
 (0)