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

Update exemptions to fix policy assignments. #186

Merged
merged 3 commits into from
Dec 11, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,28 @@ locals {

locals {
management_group_resource_id_format = "/providers/Microsoft.Management/managementGroups/%s"
root_management_group_id = format(local.management_group_resource_id_format, "${var.default_prefix}${var.default_postfix}")
confidential_corp_management_group_id = format(local.management_group_resource_id_format, "${var.default_prefix}-landingzones-confidential-corp${var.default_postfix}")
confidential_online_management_group_id = format(local.management_group_resource_id_format, "${var.default_prefix}-landingzones-confidential-online${var.default_postfix}")

# Policy exemptions
default_policy_exemptions = {
"Confidential-Online-Location-Exemption" = {
name = "Confidential-Online-Location-Exemption"
display_name = "Confidential-Online-Location-Exemption"
description = "Exempt the confidential online management group from the FSI Global location policies. The confidential management groups have their own location restrictions and this may result in a conflict if both sets are included."
"Confidential-Online-Data-Residency-Exemption" = {
name = "Confidential-Online-Data-Residency-Exemption"
display_name = "Confidential-Online-Data-Residency-Exemption"
description = "Exempt the confidential online management group from the FSI data residency location policies. The confidential management groups have their own location restrictions and this may result in a conflict if both sets are included."
management_group_id = local.confidential_online_management_group_id
policy_assignment_id = "${local.confidential_online_management_group_id}/providers/microsoft.authorization/policyassignments/enforce-fsi-conf"
policy_definition_reference_ids = ["AllowedLocationsForResourceGroups", "AllowedLocations"]
policy_assignment_id = "${local.root_management_group_id}/providers/microsoft.authorization/policyassignments/so-01-data-residency"
policy_definition_reference_ids = ["Allowed locations for resource groups", "Allowed locations"]
exemption_category = "Waiver"
}
"Confidential-Corp-Location-Exemption" = {
name = "Confidential-Corp-Location-Exemption"
display_name = "Confidential-Corp-Location-Exemption"
description = "Exempt the confidential corp management group from the FSI Global Policies location policies. The confidential management groups have their own location restrictions and this may result in a conflict if both sets are included."
"Confidential-Corp-Data-Residency-Exemption" = {
name = "Confidential-Corp-Data-Residency-Exemption"
display_name = "Confidential-Corp-Data-Residency-Exemption"
description = "Exempt the confidential corp management group from the FSI data residency location policies. The confidential management groups have their own location restrictions and this may result in a conflict if both sets are included."
management_group_id = local.confidential_corp_management_group_id
policy_assignment_id = "${local.confidential_corp_management_group_id}/providers/microsoft.authorization/policyassignments/enforce-fsi-conf"
policy_definition_reference_ids = ["AllowedLocationsForResourceGroups", "AllowedLocations"]
policy_assignment_id = "${local.root_management_group_id}/providers/microsoft.authorization/policyassignments/so-01-data-residency"
policy_definition_reference_ids = ["Allowed locations for resource groups", "Allowed locations"]
exemption_category = "Waiver"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ locals {
tenant_id = data.azurerm_client_config.current.tenant_id
root_parent_management_group_id = var.root_parent_management_group_id == "" ? local.tenant_id : var.root_parent_management_group_id
management_group_resource_id_format = "/providers/Microsoft.Management/managementGroups/%s"
root_management_group_id = format(local.management_group_resource_id_format, "${var.default_prefix}${var.default_postfix}")
landingzones_management_group_id = module.slz_management_groups.management_group_resource_ids["${var.default_prefix}-landingzones${var.default_postfix}"]

management_management_group_id = "${var.default_prefix}-platform-management${var.default_postfix}"
Expand Down Expand Up @@ -326,21 +327,21 @@ locals {

locals {
default_policy_exemptions = {
"Confidential-Online-Location-Exemption" = {
name = "Confidential-Online-Location-Exemption"
display_name = "Confidential-Online-Location-Exemption"
"Confidential-Online-Global-Location-Exemption" = {
name = "Confidential-Online-Global-Location-Exemption"
display_name = "Confidential-Online-Global-Location-Exemption"
description = "Exempt the confidential online management group from the SLZ Global location policies. The confidential management groups have their own location restrictions and this may result in a conflict if both sets are included."
management_group_id = local.confidential_online_management_group_id
policy_assignment_id = "${local.confidential_online_management_group_id}/providers/microsoft.authorization/policyassignments/enforce-sovereign-conf"
policy_assignment_id = "${local.root_management_group_id}/providers/microsoft.authorization/policyassignments/enforce-sovereign-global"
policy_definition_reference_ids = ["AllowedLocationsForResourceGroups", "AllowedLocations"]
exemption_category = "Waiver"
}
"Confidential-Corp-Location-Exemption" = {
name = "Confidential-Corp-Location-Exemption"
display_name = "Confidential-Corp-Location-Exemption"
"Confidential-Corp-Global-Location-Exemption" = {
name = "Confidential-Corp-Global-Location-Exemption"
display_name = "Confidential-Corp-Global-Location-Exemption"
description = "Exempt the confidential corp management group from the SLZ Global Policies location policies. The confidential management groups have their own location restrictions and this may result in a conflict if both sets are included."
management_group_id = local.confidential_corp_management_group_id
policy_assignment_id = "${local.confidential_corp_management_group_id}/providers/microsoft.authorization/policyassignments/enforce-sovereign-conf"
policy_assignment_id = "${local.root_management_group_id}/providers/microsoft.authorization/policyassignments/enforce-sovereign-global"
policy_definition_reference_ids = ["AllowedLocationsForResourceGroups", "AllowedLocations"]
exemption_category = "Waiver"
}
Expand Down
Loading