# How to cofigure roles.yml and role-mapping.yml in pki

**URL:** <https://discuss.elastic.co/t/how-to-cofigure-roles-yml-and-role-mapping-yml-in-pki/184699>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [June 7, 2019, 6:53am UTC](https://discuss.elastic.co/t/how-to-cofigure-roles-yml-and-role-mapping-yml-in-pki/184699 "2019-06-07T06:53:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudak](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@sudak](https://discuss.elastic.co/u/sudak)\
**Post date:** [June 7, 2019, 6:53am UTC](https://discuss.elastic.co/t/how-to-cofigure-roles-yml-and-role-mapping-yml-in-pki/184699/1 "2019-06-07T06:53:46Z")

</div>

```
Hi I am new to elasticsearch . I have configured pki for authentication and have set roles.yml and role_mapping. But i am getting " failed to parse indices privileges for role [user]. missing required [privileges] field. skipping role.."

roles.yml 

user:
    cluster: ['monitor']
    indices:
        - names: ['bank']
        privileges: ['read','write']

role-mapping.yml looks like

user:
   - "cn=something, ou=Consulting Team, dc=mydomain, dc=com"

this is how elasticsearch.yml looks like

xpack.license.self_generated.type: trial
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: certs/elastic-certificates.p12
xpack.security.http.ssl.truststore.path: certs/elastic-certificates.p12
xpack.security.http.ssl.client_authentication: optional
xpack.security.authc.realms.pki1.type: pki

```

What is the problem here? can you please help

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [June 7, 2019, 7:38am UTC](https://discuss.elastic.co/t/how-to-cofigure-roles-yml-and-role-mapping-yml-in-pki/184699/2 "2019-06-07T07:38:53Z")

</div>

Hi @sudak  
Would you mind fixing up the formatting of your post?

It seems that you've included some of your description in the code blocks (surrounded by "```") so it's hard to follow what you're describing.

---

<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 5, 2019, 7:43am UTC](https://discuss.elastic.co/t/how-to-cofigure-roles-yml-and-role-mapping-yml-in-pki/184699/3 "2019-07-05T07:43:41Z")

</div>

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