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

[CES-584] Give access to common IO KeyVaults to new AD groups #1382

Merged

Conversation

Krusty93
Copy link
Contributor

Motivation and Context

General AD groups are going to be dismissed very soon, so each IO domain AD group needs to get access to common KeyVaults

Major Changes

Add access policies to allow AD groups to access common IO KeyVaults

Dependencies

Testing

Documentation

Other Considerations

@Krusty93 Krusty93 requested a review from a team as a code owner January 16, 2025 16:20
@github-actions github-actions bot added the core label Jan 16, 2025
Copy link

📖 Terraform Plan ('src/core/prod') - success

Terraform Plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_adgroup_auth_admins will be created
  + resource "azurerm_key_vault_access_policy" "kv_adgroup_auth_admins" {
      + certificate_permissions = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + id                      = (known after apply)
      + key_permissions         = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
        ]
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg/providers/Microsoft.KeyVault/vaults/io-p-kv"
      + object_id               = "0bd8a47e-3188-45c9-9c74-23f22fca2497"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_adgroup_auth_devs will be created
  + resource "azurerm_key_vault_access_policy" "kv_adgroup_auth_devs" {
      + certificate_permissions = []
      + id                      = (known after apply)
      + key_permissions         = []
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg/providers/Microsoft.KeyVault/vaults/io-p-kv"
      + object_id               = "0bd8a47e-3188-45c9-9c74-23f22fca2497"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_adgroup_bonus_admins will be created
  + resource "azurerm_key_vault_access_policy" "kv_adgroup_bonus_admins" {
      + certificate_permissions = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + id                      = (known after apply)
      + key_permissions         = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
        ]
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg/providers/Microsoft.KeyVault/vaults/io-p-kv"
      + object_id               = "831e5214-2f68-4a13-b25f-7bec962c7e1b"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_adgroup_bonus_devs will be created
  + resource "azurerm_key_vault_access_policy" "kv_adgroup_bonus_devs" {
      + certificate_permissions = []
      + id                      = (known after apply)
      + key_permissions         = []
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg/providers/Microsoft.KeyVault/vaults/io-p-kv"
      + object_id               = "861e7fd4-6463-4f69-b473-1e6aaaa4520e"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_adgroup_com_admins will be created
  + resource "azurerm_key_vault_access_policy" "kv_adgroup_com_admins" {
      + certificate_permissions = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + id                      = (known after apply)
      + key_permissions         = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
        ]
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg/providers/Microsoft.KeyVault/vaults/io-p-kv"
      + object_id               = "12a48460-7d95-4d91-ab0a-1d19008aac2c"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_adgroup_com_devs will be created
  + resource "azurerm_key_vault_access_policy" "kv_adgroup_com_devs" {
      + certificate_permissions = []
      + id                      = (known after apply)
      + key_permissions         = []
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg/providers/Microsoft.KeyVault/vaults/io-p-kv"
      + object_id               = "7b78851b-c40d-497d-ae7f-596b8f92ecf2"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_adgroup_svc_admins will be created
  + resource "azurerm_key_vault_access_policy" "kv_adgroup_svc_admins" {
      + certificate_permissions = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + id                      = (known after apply)
      + key_permissions         = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
        ]
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg/providers/Microsoft.KeyVault/vaults/io-p-kv"
      + object_id               = "100cb2bb-92d5-40ad-bfa9-1d3c676f13e1"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_adgroup_svc_devs will be created
  + resource "azurerm_key_vault_access_policy" "kv_adgroup_svc_devs" {
      + certificate_permissions = []
      + id                      = (known after apply)
      + key_permissions         = []
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg/providers/Microsoft.KeyVault/vaults/io-p-kv"
      + object_id               = "300ea154-9984-4712-85e9-3abcb3e42960"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_adgroup_wallet_admins will be created
  + resource "azurerm_key_vault_access_policy" "kv_adgroup_wallet_admins" {
      + certificate_permissions = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + id                      = (known after apply)
      + key_permissions         = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
        ]
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg/providers/Microsoft.KeyVault/vaults/io-p-kv"
      + object_id               = "d38daf6e-4e65-46d2-a11a-6e016b29fcbc"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_adgroup_wallet_devs will be created
  + resource "azurerm_key_vault_access_policy" "kv_adgroup_wallet_devs" {
      + certificate_permissions = []
      + id                      = (known after apply)
      + key_permissions         = []
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg/providers/Microsoft.KeyVault/vaults/io-p-kv"
      + object_id               = "b2ca23d9-ace5-416d-8132-01d9b002db12"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_common_adgroup_auth_admins will be created
  + resource "azurerm_key_vault_access_policy" "kv_common_adgroup_auth_admins" {
      + certificate_permissions = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + id                      = (known after apply)
      + key_permissions         = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
        ]
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.KeyVault/vaults/io-p-kv-common"
      + object_id               = "0bd8a47e-3188-45c9-9c74-23f22fca2497"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_common_adgroup_auth_devs will be created
  + resource "azurerm_key_vault_access_policy" "kv_common_adgroup_auth_devs" {
      + certificate_permissions = []
      + id                      = (known after apply)
      + key_permissions         = []
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.KeyVault/vaults/io-p-kv-common"
      + object_id               = "0bd8a47e-3188-45c9-9c74-23f22fca2497"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_common_adgroup_bonus_admins will be created
  + resource "azurerm_key_vault_access_policy" "kv_common_adgroup_bonus_admins" {
      + certificate_permissions = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + id                      = (known after apply)
      + key_permissions         = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
        ]
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.KeyVault/vaults/io-p-kv-common"
      + object_id               = "831e5214-2f68-4a13-b25f-7bec962c7e1b"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_common_adgroup_bonus_devs will be created
  + resource "azurerm_key_vault_access_policy" "kv_common_adgroup_bonus_devs" {
      + certificate_permissions = []
      + id                      = (known after apply)
      + key_permissions         = []
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.KeyVault/vaults/io-p-kv-common"
      + object_id               = "861e7fd4-6463-4f69-b473-1e6aaaa4520e"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_common_adgroup_com_admins will be created
  + resource "azurerm_key_vault_access_policy" "kv_common_adgroup_com_admins" {
      + certificate_permissions = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + id                      = (known after apply)
      + key_permissions         = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
        ]
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.KeyVault/vaults/io-p-kv-common"
      + object_id               = "12a48460-7d95-4d91-ab0a-1d19008aac2c"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_common_adgroup_com_devs will be created
  + resource "azurerm_key_vault_access_policy" "kv_common_adgroup_com_devs" {
      + certificate_permissions = []
      + id                      = (known after apply)
      + key_permissions         = []
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.KeyVault/vaults/io-p-kv-common"
      + object_id               = "7b78851b-c40d-497d-ae7f-596b8f92ecf2"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_common_adgroup_svc_admins will be created
  + resource "azurerm_key_vault_access_policy" "kv_common_adgroup_svc_admins" {
      + certificate_permissions = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + id                      = (known after apply)
      + key_permissions         = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
        ]
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.KeyVault/vaults/io-p-kv-common"
      + object_id               = "100cb2bb-92d5-40ad-bfa9-1d3c676f13e1"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_common_adgroup_svc_devs will be created
  + resource "azurerm_key_vault_access_policy" "kv_common_adgroup_svc_devs" {
      + certificate_permissions = []
      + id                      = (known after apply)
      + key_permissions         = []
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.KeyVault/vaults/io-p-kv-common"
      + object_id               = "300ea154-9984-4712-85e9-3abcb3e42960"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_common_adgroup_wallet_admins will be created
  + resource "azurerm_key_vault_access_policy" "kv_common_adgroup_wallet_admins" {
      + certificate_permissions = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + id                      = (known after apply)
      + key_permissions         = [
          + "Get",
          + "List",
          + "Update",
          + "Create",
          + "Import",
          + "Delete",
        ]
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.KeyVault/vaults/io-p-kv-common"
      + object_id               = "d38daf6e-4e65-46d2-a11a-6e016b29fcbc"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
          + "Restore",
          + "Recover",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

  # module.key_vault_weu.azurerm_key_vault_access_policy.kv_common_adgroup_wallet_devs will be created
  + resource "azurerm_key_vault_access_policy" "kv_common_adgroup_wallet_devs" {
      + certificate_permissions = []
      + id                      = (known after apply)
      + key_permissions         = []
      + key_vault_id            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.KeyVault/vaults/io-p-kv-common"
      + object_id               = "b2ca23d9-ace5-416d-8132-01d9b002db12"
      + secret_permissions      = [
          + "Get",
          + "List",
          + "Set",
          + "Delete",
        ]
      + storage_permissions     = []
      + tenant_id               = "7788edaf-0346-4068-9d79-c868aed15b3d"
    }

Plan: 20 to add, 0 to change, 0 to destroy.

Warning: Deprecated attribute

  on ../_modules/vpn/main.tf line 22, in module "vpn":
  22:       aad_audience          = data.azuread_application.vpn_app.application_id

The attribute "application_id" is deprecated. Refer to the provider
documentation for details.

(and one more similar warning elsewhere)

Warning: Argument is deprecated

  with module.azdoa_weu.module.azdoa_snet.azurerm_subnet.this,
  on .terraform/modules/azdoa_weu.azdoa_snet/subnet/main.tf line 23, in resource "azurerm_subnet" "this":
  23:   private_endpoint_network_policies_enabled     = var.private_endpoint_network_policies_enabled

`private_endpoint_network_policies_enabled` will be removed in favour of the
property `private_endpoint_network_policies` in version 4.0 of the AzureRM
Provider

(and 11 more similar warnings elsewhere)

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

@Krusty93 Krusty93 enabled auto-merge January 16, 2025 16:32
@Krusty93 Krusty93 added this pull request to the merge queue Jan 16, 2025
Merged via the queue into main with commit 9f2787c Jan 16, 2025
6 checks passed
@Krusty93 Krusty93 deleted the CES-584-allineamento-permessi-gruppi-entra-id-io-con-as-is branch January 16, 2025 16:35
Krusty93 added a commit that referenced this pull request Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants