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

Patch ESLZ ARM #727

Merged
merged 6 commits into from
Aug 11, 2021
Merged
Changes from 3 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
Original file line number Diff line number Diff line change
@@ -20173,7 +20173,7 @@
"Disabled"
],
"metadata": {
"displayName": "Cognitive Services accounts should enable data encryption with a customer-managed key(CMK)",
"displayName": "Cognitive Services accounts should enable data encryption with a customer-managed key (CMK)",
"description": "Customer-managed keys (CMK) are commonly required to meet regulatory compliance standards. CMKs enable the data stored in Cognitive Services to be encrypted with an Azure Key Vault key created and owned by you. You have full control and responsibility for the key lifecycle, including rotation and management. Learn more about CMK encryption at https://aka.ms/cosmosdb-cmk."
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are no longer using this template.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any harm in this fix?

},
Original file line number Diff line number Diff line change
@@ -20173,7 +20173,7 @@
"Disabled"
],
"metadata": {
"displayName": "Cognitive Services accounts should enable data encryption with a customer-managed key(CMK)",
"displayName": "Cognitive Services accounts should enable data encryption with a customer-managed key (CMK)",
"description": "Customer-managed keys (CMK) are commonly required to meet regulatory compliance standards. CMKs enable the data stored in Cognitive Services to be encrypted with an Azure Key Vault key created and owned by you. You have full control and responsibility for the key lifecycle, including rotation and management. Learn more about CMK encryption at https://aka.ms/cosmosdb-cmk."
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are no longer using this template.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any harm in this fix?

},
Original file line number Diff line number Diff line change
@@ -20173,7 +20173,7 @@
"Disabled"
],
"metadata": {
"displayName": "Cognitive Services accounts should enable data encryption with a customer-managed key(CMK)",
"displayName": "Cognitive Services accounts should enable data encryption with a customer-managed key (CMK)",
"description": "Customer-managed keys (CMK) are commonly required to meet regulatory compliance standards. CMKs enable the data stored in Cognitive Services to be encrypted with an Azure Key Vault key created and owned by you. You have full control and responsibility for the key lifecycle, including rotation and management. Learn more about CMK encryption at https://aka.ms/cosmosdb-cmk."
}
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are no longer using this template.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any harm in this fix?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No harm, but we are planning to delete these files so I don't see any reason to why we need to update them

Original file line number Diff line number Diff line change
@@ -20173,7 +20173,7 @@
"Disabled"
],
"metadata": {
"displayName": "Cognitive Services accounts should enable data encryption with a customer-managed key(CMK)",
"displayName": "Cognitive Services accounts should enable data encryption with a customer-managed key (CMK)",
"description": "Customer-managed keys (CMK) are commonly required to meet regulatory compliance standards. CMKs enable the data stored in Cognitive Services to be encrypted with an Azure Key Vault key created and owned by you. You have full control and responsibility for the key lifecycle, including rotation and management. Learn more about CMK encryption at https://aka.ms/cosmosdb-cmk."
}
},
39 changes: 19 additions & 20 deletions eslzArm/eslzArm.json
Original file line number Diff line number Diff line change
@@ -581,7 +581,7 @@
"managementManagementGroup": "[tenantResourceId('Microsoft.Management/managementGroups/', variables('mgmtGroups').management)]",
"connectivityManagementGroup": "[tenantResourceId('Microsoft.Management/managementGroups/', variables('mgmtGroups').connectivity)]",
"identityManagementGroup": "[tenantResourceId('Microsoft.Management/managementGroups/', variables('mgmtGroups').identity)]",
"lzsManaegmentGroup": "[tenantResourceId('Microsoft.Management/managementGroups/', variables('mgmtGroups').lzs)]",
"lzsManagementGroup": "[tenantResourceId('Microsoft.Management/managementGroups/', variables('mgmtGroups').lzs)]",
"corpManagementGroup": "[tenantResourceId('Microsoft.Management/managementGroups/', variables('mgmtGroups').corp)]",
"onlineManagementGroup": "[tenantResourceId('Microsoft.Management/managementGroups/', variables('mgmtGroups').online)]"
},
@@ -607,8 +607,7 @@
"ascConfigPolicyInitiative": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DINE-ASCConfigPolicyAssignment.json')]",
"azVmMonitorPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DINE-VMMonitoringPolicyAssignment.json')]",
"azVmssMonitorPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DINE-VMSSMonitoringPolicyAssignment.json')]",
"azBackupLzPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DINE-VMBackupPolicyAssignment.json')]",
"azBackupIdentityPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DINE-VMBackupPolicyAssignment.json')]",
"azVmBackupPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DINE-VMBackupPolicyAssignment.json')]",
"azPolicyForAksPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DINE-AksPolicyPolicyAssignment.json')]",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If identity subscription is enabled, we also recommend to assign VM Backup policy to the identity management group, hence we need a deterministic guid for the subsequent role assignment for that policy, so we need both these variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As azBackupIdentityPolicyAssignment isn't referenced anywhere else in the repository and the values are the same, how does this make a difference when an identity subscription is enabled?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is it's own (optional) deployment name, and we cannot have duplicated resource name in the same ARM template.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just my 2 cents here 😃

I have tested a deployment from @krowlandson's branch for this PR and it works 👍
image

Including the Backup policies involved also:
image

From my initial review, and re-review today, the ARM deployment names are unchanged just the reference to the deployment template URI and a de-duplication of a variable that holds this (which from looking at the current templates, it looks like the azBackupIdentityPolicyAssignment variable is not referenced anywhere as the azBackupLzPolicyAssignment is used for all nested deployments which do the assignments. Also as the conditionals are not based on these and other parameters/variables from the portal UX experience then I think this is all good 👍

"aksPrivEscalationPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DENY-AksPrivEscalationPolicyAssignment.json')]",
"aksPrivilegedPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DENY-AksPrivilegedPolicyAssignment.json')]",
@@ -624,7 +623,7 @@
"storageHttpsPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DENY-StorageWithoutHttpsPolicyAssignment.json')]",
"subnetNsgPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DENY-SubnetWithoutNsgPolicyAssignment.json')]",
"sqlAuditPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DINE-SQLAuditingPolicyAssignment.json')]",
"sqlEncryptionPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DINE-SQLAuditingPolicyAssignment.json')]",
"sqlEncryptionPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/DINE-SQLEncryptionPolicyAssignment.json')]",
"ddosPolicyAssignment": "[uri(deployment().properties.templateLink.uri, 'managementGroupTemplates/policyAssignments/MODIFY-DDoSPolicyAssignment.json')]",
"corpVnetPeering": "[uri(deployment().properties.templateLink.uri, 'subscriptionTemplates/vnetPeering.json')]",
"corpVwanPeering": "[uri(deployment().properties.templateLink.uri, 'subscriptionTemplates/vnetPeeringVwan.json')]",
@@ -1919,7 +1918,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').azBackupLzPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]"
@@ -1928,7 +1927,7 @@
"mode": "Incremental",
"templateLink": {
"contentVersion": "1.0.0.0",
"uri": "[variables('deploymentUris').azBackupLzPolicyAssignment]"
"uri": "[variables('deploymentUris').azVmBackupPolicyAssignment]"
},
"parameters": {
"topLevelManagementGroupPrefix": {
@@ -1946,7 +1945,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').ddosLzPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').ddosDeploymentName)]"
@@ -1976,7 +1975,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').azPolicyForAksPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]"
@@ -2003,7 +2002,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').aksPrivEscalationPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]"
@@ -2027,7 +2026,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').aksPrivilegedPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]"
@@ -2051,7 +2050,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').aksHttpsPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]"
@@ -2075,7 +2074,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').tlsSslPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]",
@@ -2103,7 +2102,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').ipFwPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]",
@@ -2156,7 +2155,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').rdpFromInternetPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]",
@@ -2184,7 +2183,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').storageHttpsPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]",
@@ -2209,7 +2208,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').subnetNsgPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]",
@@ -2237,7 +2236,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').sqlAuditPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]"
@@ -2264,7 +2263,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"name": "[variables('deploymentNames').sqlEncryptionPolicyDeploymentName]",
"scope": "[variables('scopes').lzsManaegmentGroup]",
"scope": "[variables('scopes').lzsManagementGroup]",
"location": "[deployment().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('deploymentNames').policyDeploymentName)]"
@@ -2303,7 +2302,7 @@
"mode": "Incremental",
"templateLink": {
"contentVersion": "1.0.0.0",
"uri": "[variables('deploymentUris').azBackupLzPolicyAssignment]"
"uri": "[variables('deploymentUris').azVmBackupPolicyAssignment]"
},
"parameters": {
"topLevelManagementGroupPrefix": {
@@ -3320,7 +3319,7 @@
"mode": "Incremental",
"templateLink": {
"contentVersion": "1.0.0.0",
"uri": "[variables('deploymentUris').azBackupLzPolicyAssignment]"
"uri": "[variables('deploymentUris').azVmBackupPolicyAssignment]"
},
"parameters": {
"topLevelManagementGroupPrefix": {
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"denyAksNoPrivEsc": "/providers/Microsoft.Authorization/policyDefinitions/1c6e92c9-99f0-4e55-9cf2-0c234dc48f99"
},
"policyAssignmentNames": {
"denyAksNoPrivEsc": "Deny-Priv-Esc-AKS",
"denyAksNoPrivEsc": "Deny-Priv-Escalation-AKS",
"description": "Do not allow containers to run with privilege escalation to root in a Kubernetes cluster. This recommendation is part of CIS 5.2.5 which is intended to improve the security of your Kubernetes environments. This policy is generally available for Kubernetes Service (AKS), and preview for AKS Engine and Azure Arc enabled Kubernetes. For more information, see https://aka.ms/kubepolicydoc.",
"displayName": "Kubernetes clusters should not allow container privilege escalation"
}
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"denyAksPriv": "/providers/Microsoft.Authorization/policyDefinitions/95edb821-ddaf-4404-9732-666045e056b4"
},
"policyAssignmentNames": {
"denyAksPriv": "Deny-Privileged-AKS",
"denyAksPriv": "Deny-Priv-Containers-AKS",
"description": "Do not allow privileged containers creation in a Kubernetes cluster. This recommendation is part of CIS 5.2.1 which is intended to improve the security of your Kubernetes environments. This policy is generally available for Kubernetes Service (AKS), and preview for AKS Engine and Azure Arc enabled Kubernetes. For more information, see https://aka.ms/kubepolicydoc.",
"displayName": "Kubernetes cluster should not allow privileged containers"
}
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
},
"policyAssignmentNames": {
"denySubnetWithoutNsg": "Deny-Subnet-Without-Nsg",
"description": "This policy denies the creation of a subsnet with out an Network Security Group. NSG help to protect traffic across subnet-level.",
"description": "This policy denies the creation of a subnet without a Network Security Group to protect traffic across subnets.",
"displayName": "Subnets should have a Network Security Group"
}
},
Original file line number Diff line number Diff line change
@@ -16281,7 +16281,7 @@
"Disabled"
],
"metadata": {
"displayName": "Cognitive Services accounts should enable data encryption with a customer-managed key(CMK)",
"displayName": "Cognitive Services accounts should enable data encryption with a customer-managed key (CMK)",
"description": "Customer-managed keys (CMK) are commonly required to meet regulatory compliance standards. CMKs enable the data stored in Cognitive Services to be encrypted with an Azure Key Vault key created and owned by you. You have full control and responsibility for the key lifecycle, including rotation and management. Learn more about CMK encryption at https://aka.ms/cosmosdb-cmk."
}
},