Hello Manuel,
Thanks you, yes you are right, the user wasnt wazuh-wui, but was another I have created, now are working fine the policies and roles.
But I have noticed a problem:
First test I did in White mode was using the role "agents_readonly" that belong to two policies "agents_read_agents" and "agents_read_groups".
its works fine and eveything was denied less what the Role allows.
I tired to do my own policy to allow a specific agents for the user test in kibana using:
curl -k -X POST "
https://localhost:55000/security/policies?pretty=true" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d "{\"name\":\"agent_read_mine\",\"policy\":{\"actions\":[\"agent:read\"],\"resources\":[\"agent:group:test\"],\"effect\":\"allow\"}}"
But I see that everyhting was denied, I did so many tests and nothing been accepted only "agent:group:*" or "agent:id:*"
So after so many tests I saw that in White mode will not be accepted applying policies to a specific agents (agent:id:any) or agents belong to a group (agent:group:any).
___________________________________
When setting RBAC in Black mode, and try to restrict the privileges on some agents or groups, it was working fine, I did same API request and insted of allow, I put Deny.
I could see the correct number and names of agents that are allowed, or the rest of Deny.
I thought to do the following:
1- Set RBAC in Black mode.
2- Create a policy (deny all) less the agent:read.
3- Creat another policy to Deny agent:read, and sepcify what want to elastic user.
4- It went fine, but its heavy working and more complicated, also what I did is what RBAC in white mode does.
So what would you recomend me Manuel?
Regards.