Search code examples
hashicorp-vaultvault

How to add vault (Hashicorp) entity to an existing group via CLI


I have several entities (users) in vault implementation. These entities have alphanumeric ids. I also have a group called ops. This group also has an alphanumeric id.

I have looked at the Hashicorp's documentation here:

https://learn.hashicorp.com/tutorials/vault/identity

However, it doesn't cover this particular use case.

Any help is greatly appreciated.


Solution

  • You have to update the target group’s entities (the ops group in your case)

    In a few steps

    • 1: Read the group data: read the current state of the group
    • 2: update the identity entity IDs list to add the entities you want to add to this group
    • 3: post the group update with this member_entity_ids list

    https://www.vaultproject.io/api-docs/secret/identity/group#update-group-by-id