Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 3.2.0
Describe the issue:
My JWTs contain a nested claim that contains the tenant ID of the user:
{
...
"active_tenant": {
"tenant_id": "<tenant-id>",
...
},
...
}
I would like to use this nested claim in a role DLS (document level security), e.g. something like this:
"dls": "{\"bool\":{\"must\":{\"term\":{\"owner\":\"${attr.jwt.active_tenant.tenant_id\"}}}}"
However, this doesn’t seem to be working, the filter always filters everything away. How can I make this nested attribute available in a way so that I can use it in a DLS filter? The filter works fine if I use a constant value instead of a variable. I guess it also works if a top-level claim is used.
Accessing /_plugins/_security/authinfo, I can see that indeed the nested attribute is not listed among the attr.jwt.* attributes, only top-level attributes are listed. I see “attr.jwt.active_tenant” listed, but not “attr.jwt.active_tenant.tenant_id”. Can I somehow map the nested attribute to a top-level attribute and then access it?