How to create a read-only user for Wazuh GUI access

1,814 views
Skip to first unread message

mauro....@cmcc.it

unread,
Jun 30, 2021, 9:41:49 AM6/30/21
to Wazuh mailing list

Dear All,

is there a way to create a read-only user for Wazuh GUI access?
At this moment, I can only log into Wazuh GUI using admin user, but my colleagues need to take a look at the Wazuh (and Kibana) dashboards using a read-only user.

I already tried different solutions, but they didn't work.
My Wazuh version is the latest available one.

Thank you,
Mauro

Raul Del Pozo Moreno

unread,
Jun 30, 2021, 1:52:16 PM6/30/21
to Wazuh mailing list
Hello Mauro!

To create a user to access in read-only mode, you have to perform these steps:

First - Create User
    - Access: Menu -> Security -> Internal Users
    - Press the blue button "Create internal user" and in the window that will be displayed you have to specify:
        - Username
        - Password

1.png

Second - Create the role
    - Access: Menu -> Security -> Roles
    - Create new role
        - Give name
        - Cluster permissions -> "read", "kibana_all_read", "indices_all"
        - Index -> "wazuh-*"
        - Index permissions -> "read"

2_1.png

The custom role should look like this, also, note that the user added in the next step is specified.

2_2.png

Third - Map user
    - Access: Menu -> Security -> Roles -> (the role created in step 2)
        - Access the "Mapped Users" tab
        - Add the user created in step 1
    - Access: Menu -> Security -> Roles -> Kibana_user
        - Access the "Mapped Users" tab
        - Add the user created in step 1

3.png

Fourth - Modify rbac configuration
    - Modify the file /usr/share/kibana/data/wazuh/config/wazuh.yml
        - Change "run_as: false" to "run_as: true"
        - Restart kibana service -> systemctl restart kibana.service

4.png

Fifth - Create wazuh role
    - Access: Menu -> wazuh -> Security -> Roles
    - Create Role
        - Give name
        - Select all available "read" policies (13 in total)
    - You will see that this role has the same policies as "readonly" but it is necessary to create it for permission issues

6.png
Sixth - Create Wazuh Role Mapping
    - Access: Menu -> wazuh -> Security -> Role Mapping
        - Create a new Role Mapping
            - Assign name
            - Set role created in step five
            - Add the user created in step 1 to "Map internal users"

8.png

Now if you enter with the new user, you should be able to access and have limited creation/modification functions as you can see in these screenshots

err1.png
err2.png

And you cant see dashboards:

dashboard.png

Please tell me if you have any problem with the steps.
Greetings, Raul.

Raul Del Pozo Moreno

unread,
Jun 30, 2021, 1:54:23 PM6/30/21
to Wazuh mailing list
Sorry, I just found a typo right after submitting -> "And you can't see dashboards:" is "And you can see dashboards:"

mauro....@cmcc.it

unread,
Jul 1, 2021, 4:42:30 AM7/1/21
to Wazuh mailing list
Hi Raul,

thank you very much for your help.
It works a charm! And I'm very very happy!

You solved my issue with a single comment :)
I'm going to save your reply in my vault.

Kind Regards,
Mauro

Raul Del Pozo Moreno

unread,
Jul 1, 2021, 8:57:36 AM7/1/21
to Wazuh mailing list
Hi Mauro,

I'm glad to hear that it has been helpful to you! 
If you have any other questions or problems, either with this thread or with anything else, don't hesitate to ask!

Regards, Raul.
Reply all
Reply to author
Forward
0 new messages