Hi Nepolean,
I was testing the permissions configuration and I got it.
You could configure the permission based on the documentation to create a generic read-only user. See
https://documentation.wazuh.com/4.4/user-manual/user-administration/rbac.html#creating-and-setting-a-wazuh-read-only-user.
According to this documentation, it adds some permissions that maybe could be missing in your configuration and causing the errors. They are:
- Cluster permissions: cluster_composite_ops_ro
- Tenant permissions: global_tenant and select the Read only option.
So, you should ensure the user have these permissions that could be provided by the same rol that defines the document level security or another role that is mapped to the user too.
In my case, I did the following steps:
1. Create a new role with:
- Index permissions:
- Index: wazuh-alerts-*
- Index permissions: read
- Document level security:
{
"bool": {
"must": {
"match": {
"rule.groups": "syscheck"
}
}
}
}

2. Map the created role to the user

3. Map the kibanar_user role to the user. This should give the cluster permissions (cluster_composite_ops_ro) and permissions in the indices related to the tenants that is explained in the example of the read-only user in the Wazuh documentation
https://documentation.wazuh.com/4.4/user-manual/user-administration/rbac.html#creating-and-setting-a-wazuh-read-only-user.
> Tip: I mapped the user directly, but you could get this mapping through the backend role if the user is configurated to have a backend role that is used in this mapping. For example, regarding the role mapping for the kibana_user role, if the user wazuh_user_fim_ro has the kibanauser backend role, it would not be necessary to map the user directly, so you could control the mapped role through the backend role instead of the specific user. Choose the approach you like.

And the user should be able to login without problems.
For example, if the user goes to the Modules > Security events section, he only can be the alerts related to integrity monitoring because these are tagged with the rule.groups: syscheck that I used in the document level security.

I hope this can help you.