# X-Pack run\_as

**URL:** https://discuss.elastic.co/t/x-pack-run-as/93399
**Category:** Elasticsearch
**Created:** [July 17, 2017, 1:17pm UTC](https://discuss.elastic.co/t/x-pack-run-as/93399 "2017-07-17T13:17:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![francula](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@francula](https://discuss.elastic.co/u/francula)
#### Post date: [July 17, 2017, 1:17pm UTC](https://discuss.elastic.co/t/x-pack-run-as/93399/1 "2017-07-17T13:17:05Z")

</div>

Hi,  
I'm trying to use the run\_as feature of x-pack. But I cannot hand over the user that should be taken. I'm using elasticsearch 5.3 with x-pack and the nodejs api.

I tried to enrich the constructor with the header attribute "es-security-runas-user", but it seems not to be working.

var client = new elasticsearch.Client({  
host: {  
protocol: 'http',  
host : "localhost",  
port : "9200",  
auth : "user:pwd",  
headers: {  
"es-security-runas-user" : "bob"  
}  
},  
log: [{  
type: 'stdio',  
levels: ['error', 'warning']  
}]  
});

Any idea?  
Thanks for your 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: [July 21, 2017, 7:05am UTC](https://discuss.elastic.co/t/x-pack-run-as/93399/2 "2017-07-21T07:05:56Z")

</div>

I have moved your question to the X-Pack forum.

Can you provide more detail?

- What roles does "user" have?
- What `run_as` privileges do those roles have?
- What does "it seems not to be working" mean? Are there any errors reported?
- Have you tried using curl or the kibana console instead of the nodejs API to check that you have configured everything correctly?

---

<div class="post-metadata">

### Author: ![francula](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@francula](https://discuss.elastic.co/u/francula)
#### Post date: [July 21, 2017, 11:57am UTC](https://discuss.elastic.co/t/x-pack-run-as/93399/3 "2017-07-21T11:57:39Z")

</div>

Hi TimV,  
thanks for your response. I just found the solution. It is a bug in 5.3 and solved with 5.5.0  
Regards Christian

---

<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: [August 18, 2017, 11:57am UTC](https://discuss.elastic.co/t/x-pack-run-as/93399/4 "2017-08-18T11:57:48Z")

</div>

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