# Security exception Shield

**URL:** https://discuss.elastic.co/t/security-exception-shield/69501
**Category:** Elasticsearch
**Tags:** elastic-stack-security
**Created:** [December 19, 2016, 10:02pm UTC](https://discuss.elastic.co/t/security-exception-shield/69501 "2016-12-19T22:02:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bishaka](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bishaka](https://discuss.elastic.co/u/bishaka)
#### Post date: [December 19, 2016, 10:02pm UTC](https://discuss.elastic.co/t/security-exception-shield/69501/1 "2016-12-19T22:02:28Z")

</div>

Hi,  
I have shield with ES and Kibana enabled. I am trying to analyze twitter data using elasticsearch. My config file looks like the following:

Twttter

> input {  
> twitter {  
> consumer\_key =\> "\<\>"  
> consumer\_secret =\> "\<\>"  
> oauth\_token =\> "\<\>"  
> oauth\_token\_secret =\> "\<\>"  
> keywords =\> ["#Amp"]  
> full\_tweet =\> "true"  
> }  
> }  
> filter {

> }

> output {  
> elasticsearch {  
> hosts =\> "10.10.20.111"  
> index =\> "twitter"  
> document\_type =\> "real"  
> }  
> #stdout { codec =\> rubydebug }

> }

When i run the twitter.conf file, I get the following error:

> [401] {"error":{"root\_cause":[{"type":"security\_exception","reason":"missing authentication token for REST request [/\_template/logstash]","header":{"WWW-Authenticate":"Basic realm="shield" charset="UTF-8""}}],"type":"security\_exception","reason":"missing authentication token for REST request [/\_template/logstash]","header":{"WWW-Authenticate":"Basic realm="shield" charset="UTF-8""}},"status":401} {:class=\>"Elasticsearch::Transport::Transport::Errors::Unauthorized", :level=\>:error}

---

<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: [December 19, 2016, 10:57pm UTC](https://discuss.elastic.co/t/security-exception-shield/69501/2 "2016-12-19T22:57:32Z")

</div>

> [@bishaka](#):
>
> I have shield with ES and Kibana enabled.

> [@bishaka](#):
>
> I get the following error: ...
> 
> > missing authentication token for REST request [/\_template/logstash]

When you install shield into elasticsearch, you require that all requests into elasticsearch provide a username+password (\*)

You need to update your logstash config to have appropriate security credentials:  
Please read [Using Logstash with Shield | Shield [2.4] | Elastic](https://www.elastic.co/guide/en/shield/2.4/logstash.html) (you should switch the version of the docs so that it matches your version of shield)

_(\*) There are options to disable that, but since the purpose of shield is to provide security, you probably don't want to turn it off._

---

<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: [January 16, 2017, 10:57pm UTC](https://discuss.elastic.co/t/security-exception-shield/69501/3 "2017-01-16T22:57:33Z")

</div>

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