# Permissions issue for tenant X

**URL:** <https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301>\
**Category:** Search Guard\
**Created:** [March 31, 2022, 7:24am UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301 "2022-03-31T07:24:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![faxmodem](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/faxmodem/32/22_2.png) [@faxmodem](https://forum.search-guard.com/u/faxmodem)\
**Post date:** [March 31, 2022, 7:24am UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/1 "2022-03-31T07:24:38Z")

</div>

Hi again,

Using ES 7.10.2-53.0.0 and Kibana 7.10.2-51.0.0 I’m having a permissions issue.  
User has following role:

```auto
        X_admin:
          tenant_permissions:
            - tenant_patterns:
              - X
              allowed_actions:
              - SGS_KIBANA_ALL_WRITE
          cluster_permissions:
            - SGS_CLUSTER_COMPOSITE_OPS
          index_permissions:
            - index_patterns:
                - 'X-*'
              allowed_actions:
                - SGS_INDICES_ALL

```

User can save dashboards and visualisations, but not searches:

![image](https://us1.discourse-cdn.com/flex019/uploads/search_guard/original/2X/f/f0a1426ccca80e7f9d3340c5c9f91f3b510a399e.png)

And the corresponding server log entry:

```auto
No permissions for [cluster:admin:searchguard:authtoken/_own/search

```

```auto

```

---

<div class="post-metadata">

**Author:** ![faxmodem](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/faxmodem/32/22_2.png) [@faxmodem](https://forum.search-guard.com/u/faxmodem)\
**Post date:** [March 31, 2022, 7:27am UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/2 "2022-03-31T07:27:51Z")

</div>

I see there are these two static action\_groups that provide this permission: `SGS_CREATE_MANAGE_OWN_AUTH_TOKEN` and `SGS_MANAGE_ALL_AUTH_TOKEN`. I’m guessing saving a _search_ requires creating a token somehow under the hood ?

---

<div class="post-metadata">

**Author:** ![nils](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nils](https://forum.search-guard.com/u/nils)\
**Post date:** [March 31, 2022, 7:34am UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/3 "2022-03-31T07:34:57Z")

</div>

Actually, the auth token feature is completely unrelated to managing searches. I would think that the error message in the logs is just coincidentally logged. Can you check your logs for other items that might be related?

---

<div class="post-metadata">

**Author:** ![faxmodem](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/faxmodem/32/22_2.png) [@faxmodem](https://forum.search-guard.com/u/faxmodem)\
**Post date:** [March 31, 2022, 8:41am UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/4 "2022-03-31T08:41:29Z")

</div>

I guess you’re right, there is nothing server side, although I’m not sure on which node the error message ends up.

In the client log (kibana) I see:

```auto
GET /api/saved_objects/_find?fields=title&per_page=10&search=%22s%22&search_fields=title&type=search 200 25ms - 9.0B
[security_exception]: no permissions for [indices:admin/mapping/auto_put] and User faxmodem <openid> [requestedTenant=X]
POST /api/saved_objects/search?overwrite=true 403 40ms - 9.0B

```

---

<div class="post-metadata">

**Author:** ![nils](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nils](https://forum.search-guard.com/u/nils)\
**Post date:** [March 31, 2022, 10:47am UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/5 "2022-03-31T10:47:39Z")

</div>

The message regarding `indices:admin/mapping/auto_put` could be an important hint. It seems that Kibana is trying to create a new index here. Just wondering, what index that might be 🤔

Could you check the ES logs, whether there is more information?

If not, could you raise the log level for `com.floragunn.searchguard.privileges` to `DEBUG`? See here for details in that:

> **[Logging | Elasticsearch Guide \[8.4\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/logging.html#configuring-logging-levels)**

Just one general thought: Does the user have the role `SGS_KIBANA_USER`? If not, can you try to assign the role to the user?

---

<div class="post-metadata">

**Author:** ![faxmodem](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/faxmodem/32/22_2.png) [@faxmodem](https://forum.search-guard.com/u/faxmodem)\
**Post date:** [March 31, 2022, 11:32am UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/6 "2022-03-31T11:32:58Z")

</div>

The user _does_ have the `SGS_KIBANA_USER` role, as reported by the top-left icon

---

<div class="post-metadata">

**Author:** ![faxmodem](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/faxmodem/32/22_2.png) [@faxmodem](https://forum.search-guard.com/u/faxmodem)\
**Post date:** [March 31, 2022, 12:50pm UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/7 "2022-03-31T12:50:57Z")

</div>

In the ES logs, I get the initial error pasted above consistently. Here it is again:

```auto
{"type": "server", "timestamp": "2022-03-31T14:45:41,795+02:00", "level": "INFO", "component": "c.f.s.p.PrivilegesEvaluator", "cluster.name": "foo", "node.name": "node42", "message": "No index-level perm match for User faxmodem <openid> [requestedTenant=X] Resolved [aliases=[], indices=[.kibana_98832_X_3], allIndices=[.kibana_98832_X_3], types=[*], originalRequested=[.kibana_98832_X_3], remoteIndices=[], localAll=false, indicesOptions=IndicesOptions[ignore_unavailable=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, expand_wildcards_hidden=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=false, ignore_aliases=false, ignore_throttled=false]] [Action [indices:admin/mapping/auto_put]] [RolesChecked [long_list_of_roles, SGS_KIBANA_USER, X_admin]]", "cluster.uuid": "EfB5NmrLQWefQYzeb1_Zpg", "node.id": "Qi0Rbj7FQEaZWAEVIr604A" }
{"type": "server", "timestamp": "2022-03-31T14:45:41,797+02:00", "level": "INFO", "component": "c.f.s.p.PrivilegesEvaluator", "cluster.name": "foo", "node.name": "node42", "message": "No permissions for [indices:admin/mapping/auto_put]", "cluster.uuid": "EfB5NmrLQWefQYzeb1_Zpg", "node.id": "Qi0Rbj7FQEaZWAEVIr604A" }

```

---

<div class="post-metadata">

**Author:** ![faxmodem](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/faxmodem/32/22_2.png) [@faxmodem](https://forum.search-guard.com/u/faxmodem)\
**Post date:** [March 31, 2022, 12:52pm UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/8 "2022-03-31T12:52:00Z")

</div>

there isn’t much activity on the cluster, so I’m pretty sure this error message is indeed caused by trying to save a search in kibana

---

<div class="post-metadata">

**Author:** ![faxmodem](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/faxmodem/32/22_2.png) [@faxmodem](https://forum.search-guard.com/u/faxmodem)\
**Post date:** [March 31, 2022, 2:29pm UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/9 "2022-03-31T14:29:46Z")

</div>

BTW, saving in the “Global” tenant works as expected

---

<div class="post-metadata">

**Author:** ![faxmodem](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/faxmodem/32/22_2.png) [@faxmodem](https://forum.search-guard.com/u/faxmodem)\
**Post date:** [March 31, 2022, 2:51pm UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/10 "2022-03-31T14:51:34Z")

</div>

I switched on DEBUG and apart from seeing a _big_ haystack, I didn’t find the needle yet

---

<div class="post-metadata">

**Author:** ![nils](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nils](https://forum.search-guard.com/u/nils)\
**Post date:** [March 31, 2022, 3:05pm UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/11 "2022-03-31T15:05:08Z")

</div>

If you want and if you consider the haystack as not sensitive, please feel free to forward the whole haystack as a private message to me.

---

<div class="post-metadata">

**Author:** ![nils](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nils](https://forum.search-guard.com/u/nils)\
**Post date:** [April 4, 2022, 7:20am UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/12 "2022-04-04T07:20:08Z")

</div>

Quick update regarding this: I think, we have identified the issue. We are working on a fix and will update you as soon as possible.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/system/32/1870_2.png) [@system](https://forum.search-guard.com/u/system)\
**Post date:** [April 25, 2022, 7:20am UTC](https://forum.search-guard.com/t/permissions-issue-for-tenant-x/2301/13 "2022-04-25T07:20:46Z")

</div>

Closed on April 25, 2022, 7:20am UTC

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
