# READ ONLY access SEARCHGURAD

**URL:** <https://forum.search-guard.com/t/read-only-access-searchgurad/1173>\
**Category:** Search Guard\
**Created:** [October 26, 2018, 6:30pm UTC](https://forum.search-guard.com/t/read-only-access-searchgurad/1173 "2018-10-26T18:30:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rudra](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@Rudra](https://forum.search-guard.com/u/Rudra)\
**Post date:** [October 26, 2018, 6:30pm UTC](https://forum.search-guard.com/t/read-only-access-searchgurad/1173/1 "2018-10-26T18:30:22Z")

</div>

When asking questions, please provide the following information:

- Search Guard and Elasticsearch version 6.1

- Installed and used enterprise modules, if any kibana

- JVM version and operating system version

- Search Guard configuration files

- Elasticsearch log messages on debug level

- Other installed Elasticsearch or Kibana plugins, if any

How should i restrict Kibana READ ONLY user access (should be able to only query the index).

**role mapping:**

> **···**
>
> * * *
> 
> sg\_all\_access:
> 
> users:
> 
> - “bdmsys”
> 
> backendroles:
> 
> - “BDM-ES-ADMIN”
> 
> sg\_crud:
> 
> users:
> 
> - “dbdm100”
> 
> backendroles:
> 
> - “BDM-ES-WRITE”
> 
> sg\_readonly\_and\_monitor:
> 
> users:
> 
> - “bdmmon”
> 
> backendroles:
> 
> - “BDM-ES-USER”
> 
> sg\_kibana\_server:
> 
> users:
> 
> - “dddd”
> 
> sg\_kibana\_user:
> 
> backendroles:
> 
> - “BDM-ES-USER”
> 
> - “BDM-ES-ADMIN”
> 
> - “BDM-ES-WRITE”
> 
> sg\_monitor:
> 
> backendroles:
> 
> - “BDM-ES-USER”
> 
> sg\_alerting:
> 
> backendroles:
> 
> - “BDM-ES-USER”
> 
> sg\_own\_index:
> 
> users:
> 
> - “\*”
> 
> **roles:**
> 
> sg\_public:
> 
> cluster:
> 
> - “cluster:monitor/main”
> 
> - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> sg\_all\_access:
> 
> cluster:
> 
> - “UNLIMITED”
> 
> indices:
> 
> ‘\*’:
> 
> ‘\*’:
> 
> - “UNLIMITED”
> 
> tenants:
> 
> adm\_tenant: “RW”
> 
> test\_tenant\_ro: “RW”
> 
> sg\_readonly\_and\_monitor:
> 
> cluster:
> 
> - “CLUSTER\_MONITOR”
> 
> - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> indices:
> 
> ‘\*’:
> 
> ‘\*’:
> 
> - “INDICES\_ALL”
> 
> sg\_readall:
> 
> cluster:
> 
> - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> indices:
> 
> ‘\*’:
> 
> ‘\*’:
> 
> - “READ”
> 
> sg\_crud:
> 
> cluster:
> 
> - “CLUSTER\_MONITOR”
> 
> - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> indices:
> 
> ‘\*’:
> 
> ‘\*’:
> 
> - “DATA\_ACCESS”
> 
> - “CREATE\_INDEX”
> 
> sg\_kibana\_user:
> 
> readonly: true
> 
> cluster:
> 
> - “MONITOR”
> 
> - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> indices:
> 
> ?kibana\*:
> 
> ‘\*’:
> 
> - “MANAGE”
> 
> - “INDEX”
> 
> - “READ”
> 
> - “DELETE”
> 
> ‘\*’:
> 
> ‘\*’:
> 
> - “READ”
> 
> sg\_kibana\_server:
> 
> readonly: true
> 
> cluster:
> 
> - “CLUSTER\_MONITOR”
> 
> - “CLUSTER\_COMPOSITE\_OPS”
> 
> - “cluster:admin/xpack/monitoring\*”
> 
> - “indices:admin/template\*”
> 
> - “indices:admin/mappings/get”
> 
> indices:
> 
> ?kibana\*:
> 
> ‘\*’:
> 
> - “INDICES\_ALL”
> 
> ?reporting\*:
> 
> ‘\*’:
> 
> - “INDICES\_ALL”
> 
> ?monitoring\*:
> 
> ‘\*’:
> 
> - “INDICES\_ALL”
> 
> ‘\*’:
> 
> ‘\*’:
> 
> - “indices:data/read/field\_caps”
> 
> sg\_own\_index:
> 
> cluster:
> 
> - “CLUSTER\_COMPOSITE\_OPS”
> 
> indices:
> 
> ${user\_name}:
> 
> ‘\*’:
> 
> - “INDICES\_ALL”
> 
> sg\_manage\_snapshots:
> 
> cluster:
> 
> - “MANAGE\_SNAPSHOTS”
> 
> indices:
> 
> ‘\*’:
> 
> ‘\*’:
> 
> - “indices:data/write/index”
> 
> - “indices:admin/create”
> 
> sg\_monitor:
> 
> cluster:
> 
> - “cluster:admin/xpack/monitoring/\*”
> 
> - “cluster:admin/ingest/pipeline/put”
> 
> - “cluster:admin/ingest/pipeline/get”
> 
> - “indices:admin/template/get”
> 
> - “indices:admin/template/put”
> 
> - “CLUSTER\_MONITOR”
> 
> - “CLUSTER\_COMPOSITE\_OPS”
> 
> indices:
> 
> ?monitor\*:
> 
> ‘\*’:
> 
> - “INDICES\_ALL”
> 
> ?marvel\*:
> 
> ‘\*’:
> 
> - “INDICES\_ALL”
> 
> ?kibana\*:
> 
> ‘\*’:
> 
> - “READ”
> 
> ‘\*’:
> 
> ‘\*’:
> 
> - “indices:data/read/field\_caps”
> 
> sg\_alerting:
> 
> cluster:
> 
> - “indices:data/read/scroll”
> 
> - “cluster:admin/xpack/watcher/watch/put”
> 
> - “cluster:admin/xpack/watcher\*”
> 
> - “CLUSTER\_MONITOR”
> 
> - “CLUSTER\_COMPOSITE\_OPS”
> 
> indices:
> 
> ?kibana\*:
> 
> ‘\*’:
> 
> - “READ”
> 
> ?watches\*:
> 
> ‘\*’:
> 
> - “INDICES\_ALL”
> 
> ?watcher-history-\*:
> 
> ‘\*’:
> 
> - “INDICES\_ALL”
> 
> ?triggered\_watches:
> 
> ‘\*’:
> 
> - “INDICES\_ALL”
> 
> ‘\*’:
> 
> ‘\*’:
> 
> - “READ”
> 
> **Action groups:**
> 
> * * *
> 
> UNLIMITED:
> 
> - “\*”
> 
> INDICES\_ALL:
> 
> - “indices:\*”
> 
> ALL:
> 
> - “INDICES\_ALL”
> 
> MANAGE:
> 
> - “indices:monitor/\*”
> 
> - “indices:admin/\*”
> 
> CREATE\_INDEX:
> 
> - “indices:admin/create”
> 
> - “indices:admin/mapping/put”
> 
> MANAGE\_ALIASES:
> 
> - “indices:admin/aliases\*”
> 
> MONITOR:
> 
> - “INDICES\_MONITOR”
> 
> INDICES\_MONITOR:
> 
> - “indices:monitor/\*”
> 
> DATA\_ACCESS:
> 
> - “indices:data/\*”
> 
> - “CRUD”
> 
> WRITE:
> 
> - “indices:data/write\*”
> 
> - “indices:admin/mapping/put”
> 
> READ:
> 
> - “indices:data/read\*”
> 
> - “indices:admin/mappings/fields/get\*”
> 
> DELETE:
> 
> - “indices:data/write/delete\*”
> 
> CRUD:
> 
> - “READ”
> 
> - “WRITE”
> 
> SEARCH:
> 
> - “indices:data/read/search\*”
> 
> - “indices:data/read/msearch\*”
> 
> - “SUGGEST”
> 
> SUGGEST:
> 
> - “indices:data/read/suggest\*”
> 
> INDEX:
> 
> - “indices:data/write/index\*”
> 
> - “indices:data/write/update\*”
> 
> - “indices:admin/mapping/put”
> 
> - “indices:data/write/bulk\*”
> 
> GET:
> 
> - “indices:data/read/get\*”
> 
> - “indices:data/read/mget\*”
> 
> CLUSTER\_ALL:
> 
> - “cluster:\*”
> 
> CLUSTER\_MONITOR:
> 
> - “cluster:monitor/\*”
> 
> CLUSTER\_COMPOSITE\_OPS\_RO:
> 
> - “indices:data/read/mget”
> 
> - “indices:data/read/msearch”
> 
> - “indices:data/read/mtv”
> 
> - “indices:data/read/coordinate-msearch\*”
> 
> - “indices:admin/aliases/exists\*”
> 
> - “indices:admin/aliases/get\*”
> 
> CLUSTER\_COMPOSITE\_OPS:
> 
> - “indices:data/write/bulk”
> 
> - “indices:admin/aliases\*”
> 
> - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> MANAGE\_SNAPSHOTS:
> 
> - “cluster:admin/snapshot/\*”
> 
> - “cluster:admin/repository/\*”

---

<div class="post-metadata">

**Author:** ![jkressin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/jkressin/32/9_2.png) [@jkressin](https://forum.search-guard.com/u/jkressin)\
**Post date:** [November 6, 2018, 10:32pm UTC](https://forum.search-guard.com/t/read-only-access-searchgurad/1173/2 "2018-11-06T22:32:47Z")

</div>

Sorry, but I do not understand the question “How should i restrict Kibana READ ONLY user access (should be able to only query the index).”

What do you mean by query _the_ index? A particular index? All indices?

If you are looking for a role that has RO access, only there’s the sg\_readall role you can use:

sg\_readall:  
readonly: true  
cluster:  
- CLUSTER\_COMPOSITE\_OPS\_RO  
indices:  
‘_':  
'_’:  
- READ

``

> **···**
>
> On Friday, October 26, 2018 at 8:30:22 PM UTC+2, rud wrote:
> 
> > When asking questions, please provide the following information:
> 
> > - Search Guard and Elasticsearch version 6.1
> 
> > - Installed and used enterprise modules, if any kibana
> 
> > - JVM version and operating system version
> 
> > - Search Guard configuration files
> 
> > - Elasticsearch log messages on debug level
> 
> > - Other installed Elasticsearch or Kibana plugins, if any
> 
> > 
> 
> > How should i restrict Kibana READ ONLY user access (should be able to only query the index).
> 
> > 
> 
> > **role mapping:**
> 
> > 
> 
> > 
> 
> > * * *
> 
> > sg\_all\_access:
> 
> > users:
> 
> > - “bdmsys”
> 
> > backendroles:
> 
> > - “BDM-ES-ADMIN”
> 
> > sg\_crud:
> 
> > users:
> 
> > - “dbdm100”
> 
> > backendroles:
> 
> > - “BDM-ES-WRITE”
> 
> > sg\_readonly\_and\_monitor:
> 
> > users:
> 
> > - “bdmmon”
> 
> > backendroles:
> 
> > - “BDM-ES-USER”
> 
> > sg\_kibana\_server:
> 
> > users:
> 
> > - “dddd”
> 
> > sg\_kibana\_user:
> 
> > backendroles:
> 
> > - “BDM-ES-USER”
> 
> > - “BDM-ES-ADMIN”
> 
> > - “BDM-ES-WRITE”
> 
> > sg\_monitor:
> 
> > backendroles:
> 
> > - “BDM-ES-USER”
> 
> > sg\_alerting:
> 
> > backendroles:
> 
> > - “BDM-ES-USER”
> 
> > sg\_own\_index:
> 
> > users:
> 
> > - “\*”
> 
> > 
> 
> > 
> 
> > **roles:**
> 
> > 
> 
> > sg\_public:
> 
> > cluster:
> 
> > - “cluster:monitor/main”
> 
> > - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> > sg\_all\_access:
> 
> > cluster:
> 
> > - “UNLIMITED”
> 
> > indices:
> 
> > ‘\*’:
> 
> > ‘\*’:
> 
> > - “UNLIMITED”
> 
> > tenants:
> 
> > adm\_tenant: “RW”
> 
> > test\_tenant\_ro: “RW”
> 
> > sg\_readonly\_and\_monitor:
> 
> > cluster:
> 
> > - “CLUSTER\_MONITOR”
> 
> > - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> > indices:
> 
> > ‘\*’:
> 
> > ‘\*’:
> 
> > - “INDICES\_ALL”
> 
> > sg\_readall:
> 
> > cluster:
> 
> > - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> > indices:
> 
> > ‘\*’:
> 
> > ‘\*’:
> 
> > - “READ”
> 
> > sg\_crud:
> 
> > cluster:
> 
> > - “CLUSTER\_MONITOR”
> 
> > - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> > indices:
> 
> > ‘\*’:
> 
> > ‘\*’:
> 
> > - “DATA\_ACCESS”
> 
> > - “CREATE\_INDEX”
> 
> > sg\_kibana\_user:
> 
> > readonly: true
> 
> > cluster:
> 
> > - “MONITOR”
> 
> > - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> > indices:
> 
> > ?kibana\*:
> 
> > ‘\*’:
> 
> > - “MANAGE”
> 
> > - “INDEX”
> 
> > - “READ”
> 
> > - “DELETE”
> 
> > ‘\*’:
> 
> > ‘\*’:
> 
> > - “READ”
> 
> > sg\_kibana\_server:
> 
> > readonly: true
> 
> > cluster:
> 
> > - “CLUSTER\_MONITOR”
> 
> > - “CLUSTER\_COMPOSITE\_OPS”
> 
> > - “cluster:admin/xpack/monitoring\*”
> 
> > - “indices:admin/template\*”
> 
> > - “indices:admin/mappings/get”
> 
> > indices:
> 
> > ?kibana\*:
> 
> > ‘\*’:
> 
> > - “INDICES\_ALL”
> 
> > ?reporting\*:
> 
> > ‘\*’:
> 
> > - “INDICES\_ALL”
> 
> > ?monitoring\*:
> 
> > ‘\*’:
> 
> > - “INDICES\_ALL”
> 
> > ‘\*’:
> 
> > ‘\*’:
> 
> > - “indices:data/read/field\_caps”
> 
> > sg\_own\_index:
> 
> > cluster:
> 
> > - “CLUSTER\_COMPOSITE\_OPS”
> 
> > indices:
> 
> > ${user\_name}:
> 
> > ‘\*’:
> 
> > - “INDICES\_ALL”
> 
> > sg\_manage\_snapshots:
> 
> > cluster:
> 
> > - “MANAGE\_SNAPSHOTS”
> 
> > indices:
> 
> > ‘\*’:
> 
> > ‘\*’:
> 
> > - “indices:data/write/index”
> 
> > - “indices:admin/create”
> 
> > sg\_monitor:
> 
> > cluster:
> 
> > - “cluster:admin/xpack/monitoring/\*”
> 
> > - “cluster:admin/ingest/pipeline/put”
> 
> > - “cluster:admin/ingest/pipeline/get”
> 
> > - “indices:admin/template/get”
> 
> > - “indices:admin/template/put”
> 
> > - “CLUSTER\_MONITOR”
> 
> > - “CLUSTER\_COMPOSITE\_OPS”
> 
> > indices:
> 
> > ?monitor\*:
> 
> > ‘\*’:
> 
> > - “INDICES\_ALL”
> 
> > ?marvel\*:
> 
> > ‘\*’:
> 
> > - “INDICES\_ALL”
> 
> > ?kibana\*:
> 
> > ‘\*’:
> 
> > - “READ”
> 
> > ‘\*’:
> 
> > ‘\*’:
> 
> > - “indices:data/read/field\_caps”
> 
> > sg\_alerting:
> 
> > cluster:
> 
> > - “indices:data/read/scroll”
> 
> > - “cluster:admin/xpack/watcher/watch/put”
> 
> > - “cluster:admin/xpack/watcher\*”
> 
> > - “CLUSTER\_MONITOR”
> 
> > - “CLUSTER\_COMPOSITE\_OPS”
> 
> > indices:
> 
> > ?kibana\*:
> 
> > ‘\*’:
> 
> > - “READ”
> 
> > ?watches\*:
> 
> > ‘\*’:
> 
> > - “INDICES\_ALL”
> 
> > ?watcher-history-\*:
> 
> > ‘\*’:
> 
> > - “INDICES\_ALL”
> 
> > ?triggered\_watches:
> 
> > ‘\*’:
> 
> > - “INDICES\_ALL”
> 
> > ‘\*’:
> 
> > ‘\*’:
> 
> > - “READ”
> 
> > 
> 
> > 
> 
> > 
> 
> > **Action groups:**
> 
> > 
> 
> > 
> 
> > * * *
> 
> > UNLIMITED:
> 
> > - “\*”
> 
> > INDICES\_ALL:
> 
> > - “indices:\*”
> 
> > ALL:
> 
> > - “INDICES\_ALL”
> 
> > MANAGE:
> 
> > - “indices:monitor/\*”
> 
> > - “indices:admin/\*”
> 
> > CREATE\_INDEX:
> 
> > - “indices:admin/create”
> 
> > - “indices:admin/mapping/put”
> 
> > MANAGE\_ALIASES:
> 
> > - “indices:admin/aliases\*”
> 
> > MONITOR:
> 
> > - “INDICES\_MONITOR”
> 
> > INDICES\_MONITOR:
> 
> > - “indices:monitor/\*”
> 
> > DATA\_ACCESS:
> 
> > - “indices:data/\*”
> 
> > - “CRUD”
> 
> > WRITE:
> 
> > - “indices:data/write\*”
> 
> > - “indices:admin/mapping/put”
> 
> > READ:
> 
> > - “indices:data/read\*”
> 
> > - “indices:admin/mappings/fields/get\*”
> 
> > DELETE:
> 
> > - “indices:data/write/delete\*”
> 
> > CRUD:
> 
> > - “READ”
> 
> > - “WRITE”
> 
> > SEARCH:
> 
> > - “indices:data/read/search\*”
> 
> > - “indices:data/read/msearch\*”
> 
> > - “SUGGEST”
> 
> > SUGGEST:
> 
> > - “indices:data/read/suggest\*”
> 
> > INDEX:
> 
> > - “indices:data/write/index\*”
> 
> > - “indices:data/write/update\*”
> 
> > - “indices:admin/mapping/put”
> 
> > - “indices:data/write/bulk\*”
> 
> > GET:
> 
> > - “indices:data/read/get\*”
> 
> > - “indices:data/read/mget\*”
> 
> > CLUSTER\_ALL:
> 
> > - “cluster:\*”
> 
> > CLUSTER\_MONITOR:
> 
> > - “cluster:monitor/\*”
> 
> > CLUSTER\_COMPOSITE\_OPS\_RO:
> 
> > - “indices:data/read/mget”
> 
> > - “indices:data/read/msearch”
> 
> > - “indices:data/read/mtv”
> 
> > - “indices:data/read/coordinate-msearch\*”
> 
> > - “indices:admin/aliases/exists\*”
> 
> > - “indices:admin/aliases/get\*”
> 
> > CLUSTER\_COMPOSITE\_OPS:
> 
> > - “indices:data/write/bulk”
> 
> > - “indices:admin/aliases\*”
> 
> > - “CLUSTER\_COMPOSITE\_OPS\_RO”
> 
> > MANAGE\_SNAPSHOTS:
> 
> > - “cluster:admin/snapshot/\*”
> 
> > - “cluster:admin/repository/\*”
> 
> > 
> 
> >
