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"

已提问 4 个月前193 查看次数
1 回答
1
已接受的回答

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
已回答 4 个月前
profile pictureAWS
专家
已审核 4 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容