# Alias permissions on index\_pattern else than "\*" possible?

**URL:** <https://forum.search-guard.com/t/alias-permissions-on-index-pattern-else-than-possible/1973>\
**Category:** Search Guard\
**Created:** [September 28, 2020, 8:36am UTC](https://forum.search-guard.com/t/alias-permissions-on-index-pattern-else-than-possible/1973 "2020-09-28T08:36:01Z")\
**Posts on this page:** 4\
**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:** [September 28, 2020, 8:36am UTC](https://forum.search-guard.com/t/alias-permissions-on-index-pattern-else-than-possible/1973/1 "2020-09-28T08:36:01Z")

</div>

Hi,

I’m unable to restrict the permission `indices:admin/aliases/get` to `foo-*`.  
If I do this, I get an `no permissions for [indices:admin/aliases/get]` exception.

### sg\_role\_config:

If I only grant access to some indices, I get the exception:

```auto
        query_bot:
          tenant_permissions: []
          cluster_permissions:
            - SGS_CLUSTER_COMPOSITE_OPS_RO
            - SGS_CLUSTER_MONITOR
            - "indices:admin/aliases/get"
          index_permissions:
            - index_patterns:
                - 'foo-*'
              allowed_actions:
                - SGS_READ
                - SGS_SEARCH
                - "indices:admin/aliases/get"

```

If I grant permissions to all indices, it works:

```auto
        query_bot:
          tenant_permissions: []
          cluster_permissions:
            - SGS_CLUSTER_COMPOSITE_OPS_RO
            - SGS_CLUSTER_MONITOR
            - "indices:admin/aliases/get"
          index_permissions:
            - index_patterns:
                - 'foo-*'
              allowed_actions:
                - SGS_READ
                - SGS_SEARCH
            - index_patterns:
                - '*'
              allowed_actions:
                - "indices:admin/aliases/get"

```

---

<div class="post-metadata">

**Author:** ![cstaley](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/cstaley/32/463_2.png) [@cstaley](https://forum.search-guard.com/u/cstaley)\
**Post date:** [September 28, 2020, 9:50am UTC](https://forum.search-guard.com/t/alias-permissions-on-index-pattern-else-than-possible/1973/2 "2020-09-28T09:50:48Z")

</div>

I am assuming that you are trying to use the `indices:admin/aliases/get` action with a wildcard which also matches indexes the user does not have access to?

In the default configuration, Search Guard does only check whether users have all permissions to execute a given request. It does not modify the request to include only the resources the user has access to.

To a certain extent, such filtering is however done when `do_not_fail_on_forbidden` is enabled. Then, Search Guard will try to remove indexes a user has no access to from the request.

Unfortunately, the `do_not_fail_on_forbidden` feature is right now only supported for these actions:

- `indices:data/read/*`
- `indices:admin/mappings/fields/get`
- `indices:admin/shards/search_shards`
- `indices:admin/resolve/index`

For all other actions, the operation will fail if there are no permissions for **all** indices in the request.

We will look into supporting further actions. However, this often requires separate consideration for each action type; thus, this can take some time.

---

<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:** [September 28, 2020, 3:04pm UTC](https://forum.search-guard.com/t/alias-permissions-on-index-pattern-else-than-possible/1973/3 "2020-09-28T15:04:30Z")

</div>

Thanks for the detailed explanation.  
Please put this into the documentation, that would be awesome!

---

<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:** [October 19, 2020, 3:04pm UTC](https://forum.search-guard.com/t/alias-permissions-on-index-pattern-else-than-possible/1973/4 "2020-10-19T15:04:45Z")

</div>

Closed on October 19, 2020, 3:04pm UTC

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