Skip to content

Commit

Permalink
Fixed Linter warnings & build errors (#354)
Browse files Browse the repository at this point in the history
* Fixed BCP321 Linter warning in networking files

* Fixed Role Definition Id References to use the ResourceId function

* changed the pOlicyScopedId var to be set by using the MGResourceID Function

* fixed BCP321 warning

* fixed the remaining linter warnings

* fixed the remaining linter errors in the policy definitions

* updated the linter rules

* Fixed Bug on policy defnition

* Fixed the AKS policy deployment

* Commit 95556ddd: changed the extensionResourceId function to tenantResourceId for all built-in polify definitions

* fixed linter warnings in policy files

* changed the invalid dummy service alert phone number to a valid phone number

* changed the servcie health number prefix to 604

* updated AKS version in the Data Archetypes

* Changed hte AKS version to only have the Major.Minor

* Added the patch version to the AKS versions in the Data Archetypes
  • Loading branch information
tredell authored Feb 24, 2023
1 parent 0fa01e8 commit 5337654
Show file tree
Hide file tree
Showing 118 changed files with 482 additions and 408 deletions.
2 changes: 1 addition & 1 deletion azresources/containers/aks/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var virtualNetworkName = subnetIdSplit[8]
var privateDnsZoneIdSplit = split(privateDNSZoneId, '/')
var privateDnsZoneSubscriptionId = privateDnsZoneIdSplit[2]
var privateZoneDnsResourceGroupName = privateDnsZoneIdSplit[4]
var privateZoneResourceName = last(privateDnsZoneIdSplit)
var privateZoneResourceName = last(privateDnsZoneIdSplit)!

module identity '../../iam/user-assigned-identity.bicep' = {
name: 'deploy-aks-identity'
Expand Down
4 changes: 2 additions & 2 deletions azresources/data/sqldb/sqldb-with-cmk.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ resource sqlserver 'Microsoft.Sql/servers@2021-02-01-preview' = {
}

resource sqlserver_va 'Microsoft.Sql/servers/vulnerabilityAssessments@2020-11-01-preview' = {
name: '${sqlServerName}/default'
parent: sqlserver
name: 'default'
dependsOn: [
sqlserver
roleAssignSQLToSALogging
]
properties: {
Expand Down
4 changes: 2 additions & 2 deletions azresources/data/sqldb/sqldb-without-cmk.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ resource sqlserver 'Microsoft.Sql/servers@2021-02-01-preview' = {
}

resource sqlserver_va 'Microsoft.Sql/servers/vulnerabilityAssessments@2020-11-01-preview' = {
name: '${sqlServerName}/default'
parent: sqlserver
name: 'default'
dependsOn: [
sqlserver
roleAssignSQLToSALogging
]
properties: {
Expand Down
4 changes: 2 additions & 2 deletions azresources/data/sqlmi/sqlmi-with-cmk.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ resource sqlmi 'Microsoft.Sql/managedInstances@2020-11-01-preview' = {
}

resource sqlmi_va 'Microsoft.Sql/managedInstances/vulnerabilityAssessments@2020-11-01-preview' = {
name: '${name}/default'
parent: sqlmi
name: 'default'
dependsOn: [
sqlmi
roleAssignSQLMIToSALogging
]
properties: {
Expand Down
4 changes: 2 additions & 2 deletions azresources/data/sqlmi/sqlmi-without-cmk.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ resource sqlmi 'Microsoft.Sql/managedInstances@2020-11-01-preview' = {
}

resource sqlmi_va 'Microsoft.Sql/managedInstances/vulnerabilityAssessments@2020-11-01-preview' = {
name: '${name}/default'
parent: sqlmi
name: 'default'
dependsOn: [
sqlmi
roleAssignSQLMIToSALogging
]
properties: {
Expand Down
2 changes: 1 addition & 1 deletion azresources/security/key-vault-key-rsa2048.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ resource akvKey 'Microsoft.KeyVault/vaults/keys@2020-04-01-preview' = {
// Outputs
output keyName string = keyName
output keyId string = akvKey.id
output keyVersion string = last(split(akvKey.properties.keyUriWithVersion, '/'))
output keyVersion string = last(split(akvKey.properties.keyUriWithVersion, '/'))!
output keyUri string = akvKey.properties.keyUri
output keyUriWithVersion string = akvKey.properties.keyUriWithVersion
4 changes: 2 additions & 2 deletions azresources/service-health/service-health-caller-params.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"receivers": {
"app": [ "[email protected]" ],
"email": [ "[email protected]" ],
"sms": [ { "countryCode": "1", "phoneNumber": "5555555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "5555555555" } ]
"sms": [ { "countryCode": "1", "phoneNumber": "6045555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "6045555555" } ]
},
"actionGroupName": "ALZ action group",
"actionGroupShortName": "alz-alert",
Expand Down
120 changes: 87 additions & 33 deletions bicepconfig.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,94 @@
{
"analyzers": {
"core": {
"verbose": false,
"enabled": true,
"rules": {
"adminusername-should-not-be-literal": {
"level": "error"
},
"no-hardcoded-env-urls": {
"level": "error"
},
"no-unnecessary-dependson": {
"level": "error"
},
"no-unused-params": {
"level": "error"
},
"no-unused-vars": {
"level": "error"
},
"prefer-interpolation": {
"level": "error"
},
"secure-parameter-default": {
"level": "error"
},
"simplify-interpolation": {
"level": "error"
},
"no-loc-expr-outside-params": {
"level": "error"
},
"explicit-values-for-loc-params": {
"level": "error"
}
"verbose": false,
"enabled": true,
"rules": {
"adminusername-should-not-be-literal": {
"level": "error"
},
"artifacts-parameters": {
"level": "warning"
},
"decompiler-cleanup": {
"level": "warning"
},
"explicit-values-for-loc-params": {
"level": "error"
},
"max-outputs": {
"level": "warning"
},
"max-params": {
"level": "warning"
},
"max-resources": {
"level": "warning"
},
"max-variables": {
"level": "warning"
},
"no-hardcoded-env-urls": {
"level": "warning"
},
"no-hardcoded-location": {
"level": "error"
},
"no-loc-expr-outside-params": {
"level": "error"
},
"no-unnecessary-dependson": {
"level": "error"
},
"no-unused-existing-resources": {
"level": "warning"
},
"no-unused-params": {
"level": "error"
},
"no-unused-vars": {
"level": "error"
},
"outputs-should-not-contain-secrets": {
"level": "warning"
},
"prefer-interpolation": {
"level": "error"
},
"prefer-unquoted-property-names": {
"level": "warning"
},
"protect-commandtoexecute-secrets": {
"level": "warning"
},
"secure-parameter-default": {
"level": "error"
},
"secure-params-in-nested-deploy": {
"level": "warning"
},
"secure-secrets-in-params": {
"level": "warning"
},
"simplify-interpolation": {
"level": "error"
},
"use-parent-property": {
"level": "warning"
},
"use-recent-api-versions": {
"level": "off"
},
"use-resource-id-functions": {
"level": "warning"
},
"use-stable-resource-identifiers": {
"level": "warning"
},
"use-stable-vm-image": {
"level": "warning"
}
}
}
}
}
6 changes: 3 additions & 3 deletions config/logging/CanadaESLZ-main/logging.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"receivers": {
"app": [ "[email protected]" ],
"email": [ "[email protected]" ],
"sms": [ { "countryCode": "1", "phoneNumber": "5555555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "5555555555" } ]
"sms": [ { "countryCode": "1", "phoneNumber": "6045555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "6045555555" } ]
},
"actionGroupName": "Service health action group",
"actionGroupShortName": "health-alert",
Expand All @@ -22,7 +22,7 @@
"securityCenter": {
"value": {
"email": "[email protected]",
"phone": "5555555555"
"phone": "6045555555"
}
},
"subscriptionRoleAssignments": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"receivers": {
"app": [ "[email protected]" ],
"email": [ "[email protected]" ],
"sms": [ { "countryCode": "1", "phoneNumber": "5555555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "5555555555" } ]
"sms": [ { "countryCode": "1", "phoneNumber": "6045555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "6045555555" } ]
},
"actionGroupName": "Service health action group",
"actionGroupShortName": "health-alert",
Expand All @@ -22,7 +22,7 @@
"securityCenter": {
"value": {
"email": "[email protected]",
"phone": "5555555555"
"phone": "6045555555"
}
},
"subscriptionRoleAssignments": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"receivers": {
"app": [ "[email protected]" ],
"email": [ "[email protected]" ],
"sms": [ { "countryCode": "1", "phoneNumber": "5555555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "5555555555" } ]
"sms": [ { "countryCode": "1", "phoneNumber": "6045555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "6045555555" } ]
},
"actionGroupName": "Service health action group",
"actionGroupShortName": "health-alert",
Expand All @@ -22,7 +22,7 @@
"securityCenter": {
"value": {
"email": "[email protected]",
"phone": "5555555555"
"phone": "6045555555"
}
},
"subscriptionRoleAssignments": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"receivers": {
"app": [ "[email protected]" ],
"email": [ "[email protected]" ],
"sms": [ { "countryCode": "1", "phoneNumber": "5555555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "5555555555" } ]
"sms": [ { "countryCode": "1", "phoneNumber": "6045555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "6045555555" } ]
},
"actionGroupName": "Service health action group",
"actionGroupShortName": "health-alert",
Expand All @@ -25,7 +25,7 @@
"securityCenter": {
"value": {
"email": "[email protected]",
"phone": "5555555555"
"phone": "6045555555"
}
},
"subscriptionRoleAssignments": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"receivers": {
"app": [ "[email protected]" ],
"email": [ "[email protected]" ],
"sms": [ { "countryCode": "1", "phoneNumber": "5555555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "5555555555" } ]
"sms": [ { "countryCode": "1", "phoneNumber": "6045555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "6045555555" } ]
},
"actionGroupName": "Service health action group",
"actionGroupShortName": "health-alert",
Expand All @@ -22,7 +22,7 @@
"securityCenter": {
"value": {
"email": "[email protected]",
"phone": "5555555555"
"phone": "6045555555"
}
},
"subscriptionRoleAssignments": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"receivers": {
"app": [ "[email protected]" ],
"email": [ "[email protected]" ],
"sms": [ { "countryCode": "1", "phoneNumber": "5555555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "5555555555" } ]
"sms": [ { "countryCode": "1", "phoneNumber": "6045555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "6045555555" } ]
},
"actionGroupName": "Service health action group",
"actionGroupShortName": "health-alert",
Expand All @@ -22,7 +22,7 @@
"securityCenter": {
"value": {
"email": "[email protected]",
"phone": "5555555555"
"phone": "6045555555"
}
},
"subscriptionRoleAssignments": {
Expand Down Expand Up @@ -82,7 +82,7 @@
},
"aks": {
"value": {
"version": "1.22.6",
"version": "1.25.5",
"enabled": true,
"networkPlugin": "kubenet",
"networkPolicy": "calico",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"receivers": {
"app": [ "[email protected]" ],
"email": [ "[email protected]" ],
"sms": [ { "countryCode": "1", "phoneNumber": "5555555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "5555555555" } ]
"sms": [ { "countryCode": "1", "phoneNumber": "6045555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "6045555555" } ]
},
"actionGroupName": "Service health action group",
"actionGroupShortName": "health-alert",
Expand All @@ -22,7 +22,7 @@
"securityCenter": {
"value": {
"email": "[email protected]",
"phone": "5555555555"
"phone": "6045555555"
}
},
"subscriptionRoleAssignments": {
Expand Down Expand Up @@ -89,7 +89,7 @@
},
"aks": {
"value": {
"version": "1.22.6",
"version": "1.25.5",
"enabled": true,
"networkPlugin": "kubenet",
"networkPolicy": "calico",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"receivers": {
"app": [ "[email protected]" ],
"email": [ "[email protected]" ],
"sms": [ { "countryCode": "1", "phoneNumber": "5555555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "5555555555" } ]
"sms": [ { "countryCode": "1", "phoneNumber": "6045555555" } ],
"voice": [ { "countryCode": "1", "phoneNumber": "6045555555" } ]
},
"actionGroupName": "Service health action group",
"actionGroupShortName": "health-alert",
Expand All @@ -22,7 +22,7 @@
"securityCenter": {
"value": {
"email": "[email protected]",
"phone": "5555555555"
"phone": "6045555555"
}
},
"subscriptionRoleAssignments": {
Expand Down Expand Up @@ -89,7 +89,7 @@
},
"aks": {
"value": {
"version": "1.22.6",
"version": "1.25.5",
"enabled": true,
"networkPlugin": "kubenet",
"networkPolicy": "calico",
Expand Down
Loading

0 comments on commit 5337654

Please sign in to comment.