Need better understanding of principal group membership in Verified Permissions

0

I am working on a project using Verified Permissions along side AzureAD. AzureAD is connected to our enterprise Active Directory, and replicates AD group membership back to AzureAD. Our application gets the group membership list as an array.

We want to pass the group membership array and user Id to Verified Permissions IsAuthorized, and have policies that check for membership in a particular group and optionally override group permissions with a user ID. (For testing, we wish to simulate a user is in a different group.. it takes way too long to get IT to remap someone's group membership for testing purposes). I see mentions of using groups in the documentation, but not enough context to understand how it is suggested to be working or if I need a different approach: https://docs.aws.amazon.com/verifiedpermissions/latest/userguide/policies_examples-group-entities.html

What is the best way to setup the principal in the schema and write a policy for the following? We basically want to do (in english, not cedar): Apply Policy X for Principal Where Member Of "GroupA" Or UserId = "MyUserForTesting"

1 Answer
1
Accepted Answer

I would suggest having two entity types:

  • User (memberOfTypes: Group)
  • Group

Then you would have two policies granting the same access:

  • permit(principal == User::"MyUserForTesting", ...)
  • permit(principal in Group::"A", ...)

You could try to consolidate it into a single policy by adding 'groups' and 'userId' attribute on user but I think it will hurt policy readability.

Maxim
answered 4 months ago
profile pictureAWS
EXPERT
reviewed 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions