I am working on the integration between GitLab + JWT + HashiCorp Vault and AD. My environment is on-premise and both has AD integration for authentication:
GitLab: 14.10.0-ee ( Premium)
Vault: 1.2.3 (OpenSource)
Currently: It is working when I specify a list of users in the bound_claims, like:
My goal: Instead of using a list of users I would like to use a list of AD groups, in order to
validate if the user is a member of a particular group. Something like this pseudocode:
If the information is not available in the JWT, then there is no way to have Vault provide this enforcement directly.
I had assumed that you had a more usual JWT of the kind a generic OIDC identity provider would produce - sorry, I’m not familiar with GitLab jobs.
Unless you can enforce restrictions at a different layer, such as limiting which users can trigger the jobs at all, I think it would probably be necessary to implement a custom Vault auth method plugin to get the behaviour you are looking for. (It would need to do its own LDAP lookup to get group information.)