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

Design authentication and authorization #15

Closed
christoferlof opened this issue Mar 10, 2021 · 11 comments
Closed

Design authentication and authorization #15

christoferlof opened this issue Mar 10, 2021 · 11 comments
Assignees
Labels
api Composition Service API design Figure out how we should do something size/M
Milestone

Comments

@christoferlof
Copy link
Contributor

christoferlof commented Mar 10, 2021

High level requirements

  • Access to each workspace is restricted to a group of users.
  • One user can have access to multiple workspaces.
  • Support Active Directory scenarios for Conditional Access and Privileged Identity.
  • Auditing of auth events on workspace level.
    • Check HIPAA requirements
  • A user can either have the role of an workspace owner of the workspace or a researcher of the workspace.
  • A user can be a TRE administrator to manage shared services and other aspects that spans workspaces.
  • The roles a user have in each workspace will depict what actions can be performed.
  • Users who need access to a workspace can originate from multiple organizations.

What we're not doing

  • User and group management - Managing roles/groups and users will initially be managed via Azure Active Directory
@christoferlof christoferlof added the design Figure out how we should do something label Mar 10, 2021
@christoferlof christoferlof added this to the March 2021.1 milestone Mar 10, 2021
@christoferlof christoferlof mentioned this issue Mar 10, 2021
8 tasks
@iankelly-github
Copy link

We need to be very clear and consistent using the 'labels' we create for roles. We should avoid using 'a user' references if we have defined roles.

@iankelly-github
Copy link

I question if we can actually specify a 'TRE Administrator' role, and if access to a workspace can be managed across organisations? It sounds like these are outside of our scope. I think our environment plugs in to the existing AAD, and there will typically be standard operating procedures and self-service tools in place to manage this.

@christoferlof
Copy link
Contributor Author

@iankelly-github , Yep, we will require an existing Azure AD and at this point we envision that cross organizational use will rely on AAD guest/b2b features where a researcher from another org needs to be invited to the AAD of the org owning the AzTRE instance. We are not planning to build any "user management" type of features at this moment.
Roles will most likely be implemented with AAD application level roles.

@christoferlof christoferlof removed this from the March 2021.1 milestone May 3, 2021
@christoferlof christoferlof added this to the Next milestone May 12, 2021
@christoferlof christoferlof modified the milestones: Next, June 2021.1 May 21, 2021
@christoferlof christoferlof added the api Composition Service API label May 21, 2021
@christoferlof
Copy link
Contributor Author

@marrobi @Lybecker @askew , I suggest we spend some time on this shortly to decide on the approach. Additional impl tasks moved to backlog until the high-level design is in place.

@marrobi
Copy link
Member

marrobi commented Jun 2, 2021

@christoferlof @Lybecker @askew based on #158 , putting some thoughts down.

Role Definitions

Key Value description
id A unique role id.
name Role Name.
permissions Granted permissions.

Permissions

Key Value description
WorkspaceWrite Permission to write a workspace.
WorkspaceRead Permission to read a workspace.
WorkspaceDelete Permission to delete a workspace.
WorkspaceCreateService Permission to create a service.
WorkspaceUserRead Permission to read workspace users.
WorkspaceUserManage Permission to manage workspace users.
ServiceRead Permission to read a service.
ServiceWrite Permission to write a service.
ServiceDelete Permission to delete a service.

Resource assignment

Key Value description
id A unique assignment id.
claim claim name
claimValue claim value
resourceId Resource id.
role Granted role

For Azure AD in the initial iteration we use, claim = group (or could even be claim =user)

It's then down to the UI implementation (or could do within TF) to add the appropriate values when creating a workspace.

Then if wanted to add another id provider down the line it shouldn't be too difficult.

@christoferlof christoferlof self-assigned this Jun 4, 2021
@christoferlof
Copy link
Contributor Author

As noted previously, for roles/groups from Idp we have 2 options with Azure AD:

  1. use approles - will require one app registration per workspace since role assignments are per workspace. Alternatively create some sort of naming convention on role to include workspace id also.
  2. use ad groups (can be translated into role claim).

The immediate challenge with requesting ad groups is the potential number of groups a user can be a member of. There's a limit and AD will not create tokens containing > 200 groups. In those cases, an hasgroups claim will be issued to indicate that the graph endpoint needs to be used to retrieve the groups for the user. I expect other idps/token servers to behave similarly why we should expect to have a way of handling token responses per idp type to allow for additional processing and queries to take place.

@Lybecker
Copy link
Member

Lybecker commented Jun 7, 2021

App Roles:

  • I've tested. We can modify an existing App Role registration and assign the new role to a user.
  • To be able to assign Security Groups to an App Role requires AAD Premium.

AD Groups:

  • To overcome the >200 groups in claims system can query Microsoft Graph. It is more work, but the way to overcome the challenge.

@marrobi
Copy link
Member

marrobi commented Jun 7, 2021

@Lybecker agree, the demo I use uses app roles, also worth noting, Azure AD can be configured to only returned groups associated with the roles reducing the group count. I've not tested to see at what point need to query the userinfo endpoint for groups not returned in the token.

Only the people needing to do the group assignments needs a premium license, so don't see it as a blocker.

@askew
Copy link
Contributor

askew commented Jun 8, 2021

I've modified the ADDA code to use standard Azure AD rather than Azure AD B2C and that allows it to use an App Role for the global role. With the B2C solution we needed a User Admin role, but with normal AAD we now only need a single Resource Admin role. I've also added a Member role as you might want to restrict access to the TRE rather then allow the entire domain.

These a are really simple to handle, you just get the names of the app roles in a Roles claim.

For all other permissions on specific resources (workspaces and services) the app needs to manages these with resource assignments in the database.

@christoferlof
Copy link
Contributor Author

Few related issues just created to reflect the current direction using Azure AD and app roles.
#95 , #96 , #208, #211, #220, #221,

@askew askew self-assigned this Jun 14, 2021
@christoferlof
Copy link
Contributor Author

We will use a multi-app-registration approach with Azure AD, giving the flexibility of enforcing roles and features such as conditional access on a per workspace basis. Clients will have to handle multiple tokens for TRE vs Workspace operations
image

Issue #236 to describe this in more detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Composition Service API design Figure out how we should do something size/M
Projects
None yet
Development

No branches or pull requests

5 participants