-
Notifications
You must be signed in to change notification settings - Fork 978
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
17,108 additions
and
9,785 deletions.
There are no files selected for viewing
131 changes: 95 additions & 36 deletions
131
docs/reference/adventureworks/armTemplates/auxiliary/diagnosticsAndSecurity.json
Large diffs are not rendered by default.
Oops, something went wrong.
132 changes: 132 additions & 0 deletions
132
docs/reference/adventureworks/armTemplates/auxiliary/identity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/tenantDeploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"topLevelManagementGroupPrefix": { | ||
"type": "string", | ||
"maxLength": 5 | ||
}, | ||
"denyRdpForIdentity": { | ||
"type": "string", | ||
"defaultValue": "No", | ||
"allowedValues": [ | ||
"Yes", | ||
"No" | ||
] | ||
}, | ||
"denySubnetWithoutNsgForIdentity": { | ||
"type": "string", | ||
"allowedValues": [ | ||
"Yes", | ||
"No" | ||
], | ||
"defaultValue": "No" | ||
}, | ||
"denyPipForIdentity": { | ||
"type": "string", | ||
"allowedValues": [ | ||
"Yes", | ||
"No" | ||
], | ||
"defaultValue": "No" | ||
}, | ||
"enableVmBackupForIdentity": { | ||
"type": "string", | ||
"allowedValues": [ | ||
"Yes", | ||
"No" | ||
], | ||
"defaultValue": "No" | ||
} | ||
}, | ||
"variables": { | ||
"scope": "[concat('/providers/Microsoft.Management/managementGroups/', parameters('topLevelManagementGroupPrefix'), '-identity')]", | ||
"policyDefinitions": { | ||
"denySubnetWithoutNsg": "[concat('/providers/Microsoft.Management/managementGroups/', parameters('topLevelManagementGroupPrefix'), '/providers/Microsoft.Authorization/policyDefinitions/Deny-Subnet-Without-Nsg')]", | ||
"denyPip": "[concat('/providers/Microsoft.Management/managementGroups/', parameters('topLevelManagementGroupPrefix'), '/providers/Microsoft.Authorization/policyDefinitions/Deny-PublicIP')]", | ||
"denyRdp": "/providers/Microsoft.Authorization/policyDefinitions/e372f825-a257-4fb8-9175-797a8a8627d6", | ||
"deployVmBackup": "[concat('/providers/Microsoft.Management/managementGroups/', parameters('topLevelManagementGroupPrefix'), '/providers/Microsoft.Authorization/policyDefinitions/Deploy-AzureBackup-on-VM')]" | ||
}, | ||
"policyAssignmentNames": { | ||
"denySubnetWithoutNsg": "Deny-Subnet-Without-Nsg", | ||
"denyRdp": "Deny-RDP-from-internet", | ||
"denyPip": "Deny-Public-IP", | ||
"deployVmBackup": "Deploy-VM-Backup" | ||
}, | ||
"rbacOwner": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635", | ||
"roleAssignmentNames": { | ||
"deployVmBackup": "[guid(concat(parameters('toplevelManagementGroupPrefix'), 'identity', variables('policyAssignmentNames').deployVmBackup))]" | ||
} | ||
//"blankTemplateEscaped": "{\"$schema\":\"https://schema.management.azure.com/schemas/2019-08-01/tenantDeploymentTemplate.json#\",\"contentVersion\":\"1.0.0.0\",\"parameters\":{},\"variables\":{},\"resources\":[],\"outputs\":{}}" | ||
}, | ||
"resources": [ | ||
{ | ||
"condition": "[equals(parameters('enableVmBackupForIdentity'), 'Yes')]", | ||
"type": "Microsoft.Authorization/policyAssignments", | ||
"apiVersion": "2018-05-01", | ||
"name": "[variables('policyAssignmentNames').deployVmBackup]", | ||
"location": "[deployment().location]", | ||
"identity": { | ||
"type": "SystemAssigned" | ||
}, | ||
"properties": { | ||
"description": "Deploy-VM-Backup", | ||
"displayName": "Deploy-VM-Backup", | ||
"policyDefinitionId": "[variables('policyDefinitions').deployVmBackup]", | ||
"scope": "[variables('scope')]", | ||
"parameters": {} | ||
} | ||
}, | ||
{ | ||
"condition": "[equals(parameters('enableVmBackupForIdentity'), 'Yes')]", | ||
"type": "Microsoft.Authorization/roleAssignments", | ||
"apiVersion": "2019-04-01-preview", | ||
"name": "[variables('roleAssignmentNames').deployVmBackup]", | ||
"dependsOn": [ | ||
"[variables('policyAssignmentNames').deployVmBackup]" | ||
], | ||
"properties": { | ||
"principalType": "ServicePrincipal", | ||
"roleDefinitionId": "[concat('/providers/Microsoft.Authorization/roleDefinitions/', variables('rbacOwner'))]", | ||
"principalId": "[if(equals(parameters('enableVmBackupForIdentity'), 'Yes'), toLower(reference(concat('/providers/Microsoft.Authorization/policyAssignments/', variables('policyAssignmentNames').deployVmBackup), '2018-05-01', 'Full' ).identity.principalId), 'na')]" | ||
} | ||
}, | ||
{ | ||
"condition": "[equals(parameters('denyPipForIdentity'), 'Yes')]", | ||
"type": "Microsoft.Authorization/policyAssignments", | ||
"apiVersion": "2018-05-01", | ||
"name": "[variables('policyAssignmentNames').denyPip]", | ||
"properties": { | ||
"description": "Deny-Public-IP", | ||
"displayName": "Deny-Public-IP", | ||
"policyDefinitionId": "[variables('policyDefinitions').denyPip]", | ||
"scope": "[variables('scope')]" | ||
} | ||
}, | ||
{ | ||
"condition": "[equals(parameters('denyRdpForIdentity'), 'Yes')]", | ||
"type": "Microsoft.Authorization/policyAssignments", | ||
"apiVersion": "2018-05-01", | ||
"name": "[variables('policyAssignmentNames').denyRdp]", | ||
"properties": { | ||
"description": "Deny-RDP-from-Internet", | ||
"displayName": "Deny-RDP-from-Internet", | ||
"policyDefinitionId": "[variables('policyDefinitions').denyRdp]", | ||
"scope": "[variables('scope')]" | ||
} | ||
}, | ||
{ | ||
"condition": "[equals(parameters('denySubnetWithoutNsgForIdentity'), 'Yes')]", | ||
"type": "Microsoft.Authorization/policyAssignments", | ||
"apiVersion": "2018-05-01", | ||
"name": "[variables('policyAssignmentNames').denySubnetWithoutNsg]", | ||
"properties": { | ||
"description": "Deny-Subnet-Without-Nsg", | ||
"displayName": "Deny-Subnet-Without-Nsg", | ||
"policyDefinitionId": "[variables('policyDefinitions').denySubnetWithoutNsg]", | ||
"scope": "[variables('scope')]" | ||
} | ||
} | ||
], | ||
"outputs": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.