# Curator with Shield: How to pass credentials securely?

**URL:** <https://discuss.elastic.co/t/curator-with-shield-how-to-pass-credentials-securely/52555>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [June 13, 2016, 2:34am UTC](https://discuss.elastic.co/t/curator-with-shield-how-to-pass-credentials-securely/52555 "2016-06-13T02:34:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave\_G](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@Dave\_G](https://discuss.elastic.co/u/Dave_G)\
**Post date:** [June 13, 2016, 2:34am UTC](https://discuss.elastic.co/t/curator-with-shield-how-to-pass-credentials-securely/52555/1 "2016-06-13T02:34:06Z")

</div>

I'm trying to run Curator 3.5 with Shield with SSL. I'm using the following options to curator:  
--certificate (pem-encoded CA)  
--client-cert (public key file)  
--client-key (private key file)  
--use\_ssl

and then the usual options to specify the host, indices to delete, age to delete, etc.

This command fails with:

{"error":{"root\_cause":[{"type":"security\_exception","reason":"missing authentication token for REST request [/]","header":{"WWW-Authenticate":"Basic realm="shield""}}],"type":"security\_exception","reason":"missing authentication token for REST request [/]","header":{"WWW-Authenticate":"Basic realm="shield""}},"status":401}

I've seen this before -- it wants credentials. So I add the option:  
--http\_auth (username):(password), and now it works.

But the only way I can make it work is to enter the password in the command, which makes me all kinds of uneasy. Is there an alternative that I'm missing?

Thanks,  
Dave

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [June 13, 2016, 3:39am UTC](https://discuss.elastic.co/t/curator-with-shield-how-to-pass-credentials-securely/52555/2 "2016-06-13T03:39:39Z")

</div>

Curator should allow certificate based authentication, rather than requiring username and password. You may need to associate a certificate with a user for this to work.

Otherwise, the soon to be released Curator v4 uses configuration files, preventing the password from being on the command line.

---

<div class="post-metadata">

**Author:** ![Dave\_G](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@Dave\_G](https://discuss.elastic.co/u/Dave_G)\
**Post date:** [June 13, 2016, 12:34pm UTC](https://discuss.elastic.co/t/curator-with-shield-how-to-pass-credentials-securely/52555/3 "2016-06-13T12:34:48Z")

</div>

Thanks. Please forgive the basic question, but how would I associate a certificate with a user?

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [June 13, 2016, 3:58pm UTC](https://discuss.elastic.co/t/curator-with-shield-how-to-pass-credentials-securely/52555/4 "2016-06-13T15:58:04Z")

</div>

[This is the Shield documentation on user PKI authentication](https://www.elastic.co/guide/en/shield/current/pki-realm.html).

---

<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 6, 2017, 1:44pm UTC](https://discuss.elastic.co/t/curator-with-shield-how-to-pass-credentials-securely/52555/5 "2017-07-06T13:44:06Z")

</div>


