# Removing pre-defined roles

**URL:** <https://forum.opensearch.org/t/removing-pre-defined-roles/4942>\
**Category:** Security\
**Created:** [February 10, 2021, 3:38pm UTC](https://forum.opensearch.org/t/removing-pre-defined-roles/4942 "2021-02-10T15:38:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robmartin](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@robmartin](https://forum.opensearch.org/u/robmartin)\
**Post date:** [February 10, 2021, 3:38pm UTC](https://forum.opensearch.org/t/removing-pre-defined-roles/4942/1 "2021-02-10T15:38:03Z")

</div>

Is there anyway to remove/disable the pre-defined reserved role? The `own_index` role is causing errors as some usernames contain an underscore: [Querying with username starting with underscore causes org.elasticsearch.indices.InvalidIndexNameException · Issue #245 · opendistro-for-elasticsearch/sample-code · GitHub](https://github.com/opendistro-for-elasticsearch/community/issues/245)  
Would be good if the roles could be removed in the configeration

---

<div class="post-metadata">

**Author:** ![Anthony](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/anthony/32/9939_2.png) [@Anthony](https://forum.opensearch.org/u/Anthony)\
**Post date:** [February 17, 2021, 4:13pm UTC](https://forum.opensearch.org/t/removing-pre-defined-roles/4942/2 "2021-02-17T16:13:07Z")

</div>

@robmartin I don’t know of a way to remove those roles, but the workaround could be to disable the mapping for that role (can be done via UI). The only downside is you will need to disable the private tenant, as this is what that role is used for. Hope this helps

---

<div class="post-metadata">

**Author:** ![robmartin](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@robmartin](https://forum.opensearch.org/u/robmartin)\
**Post date:** [February 19, 2021, 10:35am UTC](https://forum.opensearch.org/t/removing-pre-defined-roles/4942/3 "2021-02-19T10:35:01Z")

</div>

Does anyone know if there is any way to override `security/src/main/resources/static_config/static_roles.yml` in the security config?
