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

[Modules] Minimum TLS version for SQL server #1618

Merged
merged 3 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions modules/Microsoft.Sql/servers/.parameters/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"location": {
"value": "westeurope"
},
"minimalTlsVersion": {
"value": "1.2"
},
"roleAssignments": {
"value": [
{
Expand Down
9 changes: 9 additions & 0 deletions modules/Microsoft.Sql/servers/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ param securityAlertPolicies array = []
@description('Conditional. The Azure Active Directory (AAD) administrator authentication. Required if no `administratorLogin` & `administratorLoginPassword` is provided.')
param administrators object = {}

@allowed([
'1.0'
'1.1'
'1.2'
])
@description('Optional. Minimal TLS version allowed.')
param minimalTlsVersion string = '1.2'

@description('Optional. Configuration Details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible.')
param privateEndpoints array = []

Expand Down Expand Up @@ -90,6 +98,7 @@ resource server 'Microsoft.Sql/servers@2021-05-01-preview' = {
tenantId: administrators.tenantId
} : null
version: '12.0'
minimalTlsVersion: minimalTlsVersion
}
}

Expand Down
5 changes: 5 additions & 0 deletions modules/Microsoft.Sql/servers/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ This module deploys a SQL server.
| `firewallRules` | _[firewallRules](firewallRules/readme.md)_ array | `[]` | | The firewall rules to create in the server. |
| `location` | string | `[resourceGroup().location]` | | Location for all resources. |
| `lock` | string | `''` | `[, CanNotDelete, ReadOnly]` | Specify the type of lock. |
| `minimalTlsVersion` | string | `'1.2'` | `[1.0, 1.1, 1.2]` | Minimal TLS version allowed. |
| `privateEndpoints` | array | `[]` | | Configuration Details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible. |
| `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
| `securityAlertPolicies` | _[securityAlertPolicies](securityAlertPolicies/readme.md)_ array | `[]` | | The security alert policies to create in the server. |
Expand Down Expand Up @@ -405,6 +406,9 @@ module servers './Microsoft.Sql/servers/deploy.bicep' = {
"location": {
"value": "westeurope"
},
"minimalTlsVersion": {
"value": "1.2"
},
"roleAssignments": {
"value": [
{
Expand Down Expand Up @@ -504,6 +508,7 @@ module servers './Microsoft.Sql/servers/deploy.bicep' = {
administratorLogin: kv1.getSecret('administratorLogin')
administratorLoginPassword: kv1.getSecret('administratorLoginPassword')
location: 'westeurope'
minimalTlsVersion: '1.2'
roleAssignments: [
{
roleDefinitionIdOrName: 'Reader'
Expand Down