Hi
We're using Elastic Cloud hosted version of the Elastic stack and attempting to integration Google SSO with OIDC.
I have the authentication working and can use role mapping with usernames to map specific users onto Roles in Kibana.
To make this more manageable and consistent with our other systems using Google OIDC, I want to manage role assignment with Google Groups e.g. assign people to 'engineers' group in Google Workplace and have them pick up the equivalent Engineers role in Kibana.
In Google Cloud Console we have the permissions set up correctly to allow the OIDC integration to pull through the groups (and this is working with Pritunl/Hashicorp Vault OK) but I'm struggling to map the groups.
I can find instructions for mapping Azure AD groups but not Google.
In elasticsearch.yml I have this:
xpack:
security:
authc:
realms:
oidc:
oidc1:
order: 2
rp.client_id: "REDACTED.apps.googleusercontent.com"
rp.response_type: "code"
rp.requested_scopes: ["openid", "email", "https://www.googleapis.com/auth/admin.directory.group.readonly"]
rp.redirect_uri: "https://REDACTED.eu-west-1.aws.found.io:9243/api/security/v1/oidc"
op.issuer: "https://accounts.google.com"
op.authorization_endpoint: "https://accounts.google.com/o/oauth2/v2/auth"
op.token_endpoint: "https://oauth2.googleapis.com/token"
op.userinfo_endpoint: "https://openidconnect.googleapis.com/v1/userinfo"
op.jwkset_path: "https://www.googleapis.com/oauth2/v3/certs"
claims.principal: email
claims.groups: groups
claim_patterns.principal: "^([^@]+)@ourdomain\\.tld$"
I've then tried mapping the groups onto roles with this:
PUT /_xpack/security/role_mapping/oidc_kibana
{
"enabled": true,
"roles": [ "engineers" ],
"rules" : {
"all" : [
{"field" : { "realm.name" : "oidc1" }},
{"field": { "groups": ["engineers"] } }
]
},
"metadata": { "version": 1 }
}
However the role doesn't appear to be assigned.
If I swap out the groups line to a list of explicit users it works as expected and assigns the Role:
{"field": { "username": ["user1","user2"] } }
Any ideas? Is there a change I need to make in elasticsearch.yml to map the groups returned by Google in the JWT?