Hi all,
I am on 6.5.4 and I am using AD for authentication.
Authentication works correctly, now I am trying to create some role_mapping.
Following this guide I understand that it should be possible to create mappings using user's metadata (AD attributes) in rules:
https://www.elastic.co/guide/en/elasticsearch/reference/6.5/role-mapping-resources.html#_user_fields
`metadata`
(object) Additional metadata for the user. For example, `"metadata": { "cn": "John Smith" }` .
This is what I am trying:
POST _xpack/security/role_mapping/mapping_test_user
{
"enabled": true,
"roles": [
"read_only_logs",
"kibana_dashboard_only_user"
],
"rules": {
"any": [
{
"field": {
"metadata":{"cn": "testuser"}
}
}
]
},
"metadata": {}
}
But I get this error:
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[11:22] [role-mapping] failed to parse field [rules]",
"line": 11,
"col": 22
}
],
"type": "parsing_exception",
"reason": "[11:22] [role-mapping] failed to parse field [rules]",
"line": 11,
"col": 22,
"caused_by": {
"type": "x_content_parse_exception",
"reason": "[11:22] [role-mapping] failed to parse field [rules]",
"caused_by": {
"type": "parse_exception",
"reason": "failed to parse rules expression. expected a field value but found [START_OBJECT] instead"
}
}
},
"status": 400
}
What am I doing wrong? Thanks in advance.