Skip to content

Commit 3e2369b

Browse files
authored
Use Group.Create instead of Group.ReadWrite.All for group creation (#4774)
1 parent cd31a1f commit 3e2369b

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
ENHANCEMENTS:
88
* Upgrade Guacamole to v1.6.0 with Java 17 and other security updates ([#4754](https://github.com/microsoft/AzureTRE/pull/4754))
99
* API: Replace HTTP_422_UNPROCESSABLE_ENTITY response with HTTP_422_UNPROCESSABLE_CONTENT as per RFC 9110 ([#4742](https://github.com/microsoft/AzureTRE/issues/4742))
10+
* Change Group.ReadWrite.All permission to Group.Create for AUTO_WORKSPACE_GROUP_CREATION ([#4772](https://github.com/microsoft/AzureTRE/issues/4772))
1011
* Make workspace shared storage quota updateable ([#4314](https://github.com/microsoft/AzureTRE/issues/4314))
1112

1213
BUG FIXES:

config.sample.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ authentication:
8080
# When this is true, create Workspaces will also create an AAD Application automatically.
8181
# When this is false, the AAD Application will need creating manually.
8282
auto_workspace_app_registration: true
83-
# Setting AUTO_WORKSPACE_GROUP_CREATION to true will create an identity with `Group.ReadWrite.All`
83+
# Setting AUTO_WORKSPACE_GROUP_CREATION to true will create an identity with `Group.Create`
8484
auto_workspace_group_creation: false
8585
# Setting this to true will remove the need for users to manually grant consent when creating new workspaces.
8686
# The identity will be granted Application.ReadWrite.All and DelegatedPermissionGrant.ReadWrite.All permissions.
@@ -101,7 +101,6 @@ ui_config:
101101
ui_site_name: "Azure TRE"
102102
# Footer text shown in the bottom left hand corner of the TRE portal
103103
ui_footer_text: "Azure Trusted Research Environment"
104-
105104
#developer_settings:
106105
# Locks will not be added to stateful resources so they can be easily removed
107106
# stateful_resources_locked: false

devops/scripts/create_aad_assets.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if [ "${AUTO_WORKSPACE_APP_REGISTRATION:-}" == true ]; then
3333
fi
3434

3535
if [ "${AUTO_WORKSPACE_GROUP_CREATION:-}" == true ]; then
36-
APPLICATION_PERMISSIONS+=("Group.ReadWrite.All")
36+
APPLICATION_PERMISSIONS+=("Group.Create")
3737
fi
3838

3939
if [ "${AUTO_GRANT_WORKSPACE_CONSENT:-}" == true ]; then

docs/tre-admins/environment-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
| `CUSTOM_DOMAIN` | Optional. Custom domain name to access the Azure TRE portal. See [Custom domain name](custom-domain.md). |
4949
| `ENABLE_CMK_ENCRYPTION` | Optional. Default is `false`, if set to `true` customer-managed key encryption will be enabled for all supported resources. |
5050
| `AUTO_WORKSPACE_APP_REGISTRATION`| Set to `false` by default. Setting this to `true` grants the `Application.ReadWrite.All` and `Directory.Read.All` permission to the *Application Admin* identity. This identity is used to manage other Microsoft Entra ID applications that it owns, e.g. Workspaces. If you do not set this, the identity will have `Application.ReadWrite.OwnedBy` permission. [Further information on Application Admin can be found here](./identities/application_admin.md). |
51-
| `AUTO_WORKSPACE_GROUP_CREATION`| Set to `false` by default. Setting this to `true` grants the `Group.ReadWrite.All` permission to the *Application Admin* identity. This identity can then create security groups aligned to each applciation role. Microsoft Entra ID licencing implications need to be considered as Group assignment is a premium feature. [You can read mode about Group Assignment here](https://docs.microsoft.com/en-us/azure/architecture/multitenant-identity/app-roles#roles-using-azure-ad-app-roles). |
51+
| `AUTO_WORKSPACE_GROUP_CREATION`| Set to `false` by default. Setting this to `true` grants the `Group.Create` permission to the *Application Admin* identity. This identity can then create security groups aligned to each application role. |
5252
| `AUTO_GRANT_WORKSPACE_CONSENT`| Default of `false`. Setting this to `true` will remove the need for users to manually grant consent when creating new workspaces. The identity will be granted `Application.ReadWrite.All` and `DelegatedPermissionGrant.ReadWrite.All` permissions. |
5353
| `USER_MANAGEMENT_ENABLED` | If set to `true`, TRE Admins will be able to assign and de-assign users to workspaces via the UI (Requires Entra ID groups to be enabled on the workspace and the workspace template version to be 2.2.0 or greater). |
5454
| `PRIVATE_AGENT_SUBNET_ID` | Optional. Vnet exception is enabled for the provided runner agent subnet id, enabling access to private resources like TRE key vault. |

docs/tre-admins/identities/application_admin.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ This application does not have any roles defined.
1313
| Application.ReadWrite.OwnedBy | Application | Yes | This user has `Application.ReadWrite.OwnedBy` as a minimum permission for it to function. If the tenant is managed by a customer administrator, then this user must be added to the **Owners** of every workspace that is created. This will allow TRE to manage the Microsoft Entra ID Application. This will be a manual process for the Tenant Admin. |
1414
| Application.ReadWrite.All | Application | Yes | This permission is required to create workspace applications and administer any applications in the tenant. This is needed if the Microsoft Entra ID Administrator has delegated Microsoft Entra ID administrative operations to the TRE. There will be no need for the Tenant Admin to manually create workspace applications in the Tenant. |
1515
| Directory.Read.All | Application | Yes | This permission is required to read User details from Microsoft Entra ID. This is needed if the Microsoft Entra ID Administrator has delegated Microsoft Entra ID administrative operations to the TRE. |
16-
| Group.ReadWrite.All | Application | Yes | This permission is required to create and update Microsoft Entra ID groups. This is requried if Microsoft Entra ID groups are to be created automatically by the TRE. |
17-
| DelegatedPermissionGrant.ReadWrite.All | Application | Yes | This permssion is required to remove the need for users to manually grant consent when creating new workspaces. |
16+
| Group.Create | Application | Yes | This permission is required to create and update Microsoft Entra ID groups. This is required if Microsoft Entra ID groups are to be created automatically by the TRE. |
17+
| DelegatedPermissionGrant.ReadWrite.All | Application | Yes | This permission is required to remove the need for users to manually grant consent when creating new workspaces. |
1818

1919
'*' See the difference between [delegated and application permission](https://docs.microsoft.com/graph/auth/auth-concepts#delegated-and-application-permissions) types. See [Microsoft Graph permissions reference](https://docs.microsoft.com/graph/permissions-reference) for more details.
2020

@@ -31,7 +31,7 @@ This user is currently only used from the Porter bundles hosted on the Resource
3131
| -------- | ----------- |
3232
| `--name` | This is used to put a friendly name to the Application that can be seen in the portal. It is typical to use the name of your TRE instance. |
3333
| `--admin-consent` | If you have the appropriate permission to grant admin consent, then pass in this argument. If you do not, you will have to ask an Microsoft Entra ID Admin to consent after you have created the identity. Consent is required for this permission. |
34-
| `--application-permission` | This is a comma seperated list of the permissions that need to be assigned. For exampler `Application.ReadWrite.All,Directory.Read.All,Group.ReadWrite.All` |
34+
| `--application-permission` | This is a comma separated list of the permissions that need to be assigned. For example `Application.ReadWrite.All,Directory.Read.All,Group.Create` |
3535
| `--reset-password` | Optional, default is 0. When run in a headless fashion, 1 is passed in to always reset the password. |
3636

3737
## Environment Variables

templates/workspaces/base/terraform/aad/aad.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,21 +143,21 @@ resource "azuread_app_role_assignment" "workspace_owner" {
143143
resource "azuread_group" "workspace_owners" {
144144
count = var.create_aad_groups ? 1 : 0
145145
display_name = "${var.workspace_resource_name_suffix} Workspace Owners"
146-
owners = [var.workspace_owner_object_id, data.azuread_service_principal.core_api.object_id]
146+
owners = [var.workspace_owner_object_id, data.azuread_service_principal.core_api.object_id, data.azuread_client_config.current.object_id]
147147
security_enabled = true
148148
}
149149

150150
resource "azuread_group" "workspace_researchers" {
151151
count = var.create_aad_groups ? 1 : 0
152152
display_name = "${var.workspace_resource_name_suffix} Workspace Researchers"
153-
owners = [var.workspace_owner_object_id, data.azuread_service_principal.core_api.object_id]
153+
owners = [var.workspace_owner_object_id, data.azuread_service_principal.core_api.object_id, data.azuread_client_config.current.object_id]
154154
security_enabled = true
155155
}
156156

157157
resource "azuread_group" "workspace_airlock_managers" {
158158
count = var.create_aad_groups ? 1 : 0
159159
display_name = "${var.workspace_resource_name_suffix} Airlock Managers"
160-
owners = [var.workspace_owner_object_id, data.azuread_service_principal.core_api.object_id]
160+
owners = [var.workspace_owner_object_id, data.azuread_service_principal.core_api.object_id, data.azuread_client_config.current.object_id]
161161
security_enabled = true
162162
}
163163

0 commit comments

Comments
 (0)