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

Identity Engine - Patch Group Member Ids #330

Open
jeffwecan opened this issue Nov 1, 2018 · 2 comments
Open

Identity Engine - Patch Group Member Ids #330

jeffwecan opened this issue Nov 1, 2018 · 2 comments
Labels
enhancement a new feature or addition identity Identity secrets engine; identity management solution for Vault secrets engines generally related to a Vault secrets engine

Comments

@jeffwecan
Copy link
Member

Would be handy to add / remove member (entity) IDs to an Identity group without having to perform all the read and update calls explicitly. Consider this an analog to the patch() method in the KvV2 class...

@jeffwecan jeffwecan added enhancement a new feature or addition secrets engines generally related to a Vault secrets engine identity Identity secrets engine; identity management solution for Vault labels Nov 1, 2018
@jeffwecan jeffwecan added this to the 0.7.1 milestone Nov 1, 2018
@jeffwecan jeffwecan modified the milestones: 0.7.1, 0.7.2 Dec 19, 2018
@jeffwecan jeffwecan modified the milestones: 0.7.2, 0.7.3 Jan 1, 2019
@viralpoetry
Copy link
Contributor

I am doing something similar when appending multiple entities to the identity group:

def __update_group_entities(self, entity_ids, group_name):
      """
      Append list of users to an existing safe group.
      """
      logging.debug(
      'Assigning entities %s to a group within the identity backend', entity_ids)
      # check if the group name already exists
      read_response = self.admin.secrets.identity.read_group_by_name(
          name=group_name,
      )
      # recycle existing members and policies
      l_policies = read_response['data']['policies']
      create_response = self.admin.secrets.identity.create_or_update_group_by_name(
          name=group_name,
          member_entity_ids=",".join(entity_ids),
          policies=",".join(l_policies),
      )

I believe some set intersection, or other efficient operation in this patch operation will be great to have in hvac itself!

@jeffwecan
Copy link
Member Author

jeffwecan commented Jan 18, 2019

Neat, thanks for that feedback and example @viralpoetry! For my own professional hvac use-case, I believe I landed on a similar solution. So it's good to see we have a bit of consensus there ☺.

To provide a bit more context here: personally, I've been hesitant to implement this issue for a bit to allow some more time to ruminate on the problem of colissions with concurrent (or close enough to be effectively concurrent) updates. E.g., with the KV v2 "patch" functionality within this module, we're able to leverage that secrets engine's "check and set" bit to ensure sequential requests don't stomp on each other's changes. Probably not as much of a concern within the context of this issue, but still something still worth thinking through. Ultimately I don't think that matter is a solvable problem without going upstream to Vault. So I'll try to get something along these lines implemented by the next release of this module (though if a contributor beats me to it, all the better 😉), and perhaps see if Vault itself has / needs its own issue to document this use case...

@jeffwecan jeffwecan modified the milestones: 0.8.0, 0.8.1 Mar 29, 2019
@jeffwecan jeffwecan modified the milestones: 0.8.3, 0.8.4 May 18, 2019
@jeffwecan jeffwecan modified the milestones: 0.9.1, 0.9.2 May 25, 2019
@jeffwecan jeffwecan removed this from the 0.9.2 milestone Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a new feature or addition identity Identity secrets engine; identity management solution for Vault secrets engines generally related to a Vault secrets engine
Projects
None yet
Development

No branches or pull requests

2 participants