# Migrating from access control to shield / Make deny the default

**URL:** <https://discuss.elastic.co/t/migrating-from-access-control-to-shield-make-deny-the-default/36903>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [December 10, 2015, 5:38pm UTC](https://discuss.elastic.co/t/migrating-from-access-control-to-shield-make-deny-the-default/36903 "2015-12-10T17:38:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xyz](https://avatars.discourse-cdn.com/v4/letter/x/b5a626/32.png) [@xyz](https://discuss.elastic.co/u/xyz)\
**Post date:** [December 10, 2015, 5:38pm UTC](https://discuss.elastic.co/t/migrating-from-access-control-to-shield-make-deny-the-default/36903/1 "2015-12-10T17:38:08Z")

</div>

I want to upgrade our elasticsearch instance from 1.6.x to 2.1. There is the new shield configuration.

We use 2 indices. One for search requests from the application with a lot of details and another where we have indexed only the name field for suggest.  
Until now we have used this configuration in the access control settings:

```
default: deny
rules:
  - paths:
      - '/suggest/_search/template'
    action: allow

```

So it’s possible to disallow all requests to [http://host:9200/](http://host:9200/) except the suggest index:  
[http://host:9200/suggest/\_search/template](http://host:9200/suggest/_search/template)

I don’t know how I can transform this behaviour to the new shield configuration.  
With the default shield configuration I can already access [http://host:9200/](http://host:9200/) because deny seems not to be the default behaviour.

---

<div class="post-metadata">

**Author:** ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)\
**Post date:** [December 15, 2015, 6:57pm UTC](https://discuss.elastic.co/t/migrating-from-access-control-to-shield-make-deny-the-default/36903/2 "2015-12-15T18:57:53Z")

</div>

Shield will deny by default. The `/` endpoint only requires authentication to work (or if anonymous access is enabled, everyone can access this endpoint). This is due to how Shield authorizes requests; it does so at the action level in elasticsearch and the `/` endpoint does not map to an action.

It looks like you only want to allow the users to search with a search template. Is the search template indexed? If so you need to grant access to the .scripts index. You may try using a role like:

```
role_name:
  indices:
    '.scripts': read
    'suggest': search
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:47pm UTC](https://discuss.elastic.co/t/migrating-from-access-control-to-shield-make-deny-the-default/36903/3 "2017-07-06T13:47:26Z")

</div>


