# Have Beats to include authentication token in header

**URL:** <https://discuss.elastic.co/t/have-beats-to-include-authentication-token-in-header/68341>\
**Category:** Beats\
**Created:** [December 7, 2016, 6:06pm UTC](https://discuss.elastic.co/t/have-beats-to-include-authentication-token-in-header/68341 "2016-12-07T18:06:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![susanhua](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@susanhua](https://discuss.elastic.co/u/susanhua)\
**Post date:** [December 7, 2016, 6:06pm UTC](https://discuss.elastic.co/t/have-beats-to-include-authentication-token-in-header/68341/1 "2016-12-07T18:06:27Z")

</div>

We want to have Beats installed on thousands of client machine and have Beats send data to Logstash. Can we have Beats make API call to get an authentication token and include in header? Then proxy on Logstash will process the token in header to authenticate each request. Is this something achievable?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 8, 2016, 7:53am UTC](https://discuss.elastic.co/t/have-beats-to-include-authentication-token-in-header/68341/2 "2016-12-08T07:53:29Z")

</div>

Not currently, but it's an interesting idea!

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [December 8, 2016, 1:30pm UTC](https://discuss.elastic.co/t/have-beats-to-include-authentication-token-in-header/68341/3 "2016-12-08T13:30:41Z")

</div>

what you mean by header? Beats-\>LS is not using HTTP.

Currently for authentication only SSL/TLS support with client authentication is available.

---

<div class="post-metadata">

**Author:** ![susanhua](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@susanhua](https://discuss.elastic.co/u/susanhua)\
**Post date:** [December 8, 2016, 5:58pm UTC](https://discuss.elastic.co/t/have-beats-to-include-authentication-token-in-header/68341/4 "2016-12-08T17:58:36Z")

</div>

Thanks for your response @warkolm and @steffens. What is the protocol for Beats to communicate to LS then?

To work around this problem, can we do the following:

Have a service running on client with Filebeat installed. That service will get request from Filebeat and add authentication token in request somehow and forward request to Logstash. Then we will have proxy running on Logstash. And the proxy will do nothing but validate the token. If token is valid it will pass the request to Logstash.

Do you think this is a feasible solution?

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [December 9, 2016, 12:56pm UTC](https://discuss.elastic.co/t/have-beats-to-include-authentication-token-in-header/68341/5 "2016-12-09T12:56:52Z")

</div>

beats uses lumberjack protocol, which uses a persistent TCP connection. The go implementation is provided by [go-lumber](https://github.com/elastic/go-lumber). The logstash input plugin is provided by [logstash-input-beats](https://github.com/logstash-plugins/logstash-input-beats).

With lumberjack using a persistent TCP connection some authentication scheme (e.g. kerberos) at connection time would make sense. But this is currently not supported by the protocol.

If your willing to write very custom code, you might consider a proxy faking the elasticsearch bulk request API and configure beats elasticsearch output to use elasticsearch pointing to your proxy. This API is based on HTTP. In the elasticsearch output you can configure additional HTTP parameters to be passed for example. But this requires you to fetch a token before starting filebeat. But then I still don't know how you want to validate the token from within logstash.

---

<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:** [December 28, 2016, 6:06pm UTC](https://discuss.elastic.co/t/have-beats-to-include-authentication-token-in-header/68341/6 "2016-12-28T18:06:47Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
