# How to provide own API key in ELK version 8.0.0

**URL:** https://discuss.elastic.co/t/how-to-provide-own-api-key-in-elk-version-8-0-0/330939
**Category:** Elasticsearch
**Tags:** elastic-stack-security, docker
**Created:** [April 27, 2023, 10:40am UTC](https://discuss.elastic.co/t/how-to-provide-own-api-key-in-elk-version-8-0-0/330939 "2023-04-27T10:40:02Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Gaurav\_kr](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@Gaurav\_kr](https://discuss.elastic.co/u/Gaurav_kr)
#### Post date: [April 27, 2023, 10:40am UTC](https://discuss.elastic.co/t/how-to-provide-own-api-key-in-elk-version-8-0-0/330939/1 "2023-04-27T10:40:02Z")

</div>

Hi Team,

I want to know how i can provide my own API key in ELK version 8.0.0  
I did try - "xpack.security.authc.api\_key.enabled=true"  
- "xpack.security.authc.api\_key.key="

but no luck getting xpack.security.authc.api\_key.key unknow setting in docker logs.

So wanted to know can we provide our own API key or not.

We want to implement this as we are monitoring a large number of machines and if ELK is completely destroyed, we can make it up from start and use the same old API key so that we do not need to rechange the API key in each beat's setup in machine for monitoring.

---

<div class="post-metadata">

### Author: ![Yang\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yang_wang/32/48857_2.png) [@Yang\_Wang](https://discuss.elastic.co/u/Yang_Wang)
#### Post date: [April 28, 2023, 1:30am UTC](https://discuss.elastic.co/t/how-to-provide-own-api-key-in-elk-version-8-0-0/330939/2 "2023-04-28T01:30:24Z")

</div>

There is no such setting `xpack.security.authc.api_key.key`.

Since you are using version 8.0, API key is enabled automatically. So you don't need to configure anything. In earlier versions, you need to enable it with `xpack.security.authc.api_key.enabled`.

---

<div class="post-metadata">

### Author: ![Gaurav\_kr](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@Gaurav\_kr](https://discuss.elastic.co/u/Gaurav_kr)
#### Post date: [April 28, 2023, 8:34am UTC](https://discuss.elastic.co/t/how-to-provide-own-api-key-in-elk-version-8-0-0/330939/3 "2023-04-28T08:34:12Z")

</div>

Thank you @Yang_Wang ,so do we have any other ways to setup a own API Key instead getting a random API Key ?

---

<div class="post-metadata">

### Author: ![Yang\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yang_wang/32/48857_2.png) [@Yang\_Wang](https://discuss.elastic.co/u/Yang_Wang)
#### Post date: [April 28, 2023, 8:58am UTC](https://discuss.elastic.co/t/how-to-provide-own-api-key-in-elk-version-8-0-0/330939/4 "2023-04-28T08:58:21Z")

</div>

What do you mean by "a own API key"? If this is about reuse the same API key in a brand new cluster, it is not possible.

---

<div class="post-metadata">

### Author: ![Gaurav\_kr](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@Gaurav\_kr](https://discuss.elastic.co/u/Gaurav_kr)
#### Post date: [April 28, 2023, 11:11am UTC](https://discuss.elastic.co/t/how-to-provide-own-api-key-in-elk-version-8-0-0/330939/5 "2023-04-28T11:11:26Z")

</div>

Yes I was thinking to use a old API key for a same cluster UID if we can do this it would help us a lot.

e.g if we have an ELK cluster running in docker, but we remove the entire container and recreated a container. so instead of creating a new API key we would love to use old API key so that we only do changes in ELK not in beats like changing API key in yml files. I hope this help

---

<div class="post-metadata">

### Author: ![Yang\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yang_wang/32/48857_2.png) [@Yang\_Wang](https://discuss.elastic.co/u/Yang_Wang)
#### Post date: [May 1, 2023, 12:50am UTC](https://discuss.elastic.co/t/how-to-provide-own-api-key-in-elk-version-8-0-0/330939/6 "2023-05-01T00:50:31Z")

</div>

The only supported way to achieve what you are after is [snapshot and restore the security feature state](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/create-snapshot-api.html).

---

<div class="post-metadata">

### Author: ![Gaurav\_kr](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@Gaurav\_kr](https://discuss.elastic.co/u/Gaurav_kr)
#### Post date: [May 1, 2023, 9:49am UTC](https://discuss.elastic.co/t/how-to-provide-own-api-key-in-elk-version-8-0-0/330939/7 "2023-05-01T09:49:29Z")

</div>

Thank You @Yang_Wang this really helps. 🙂

---

<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: [May 29, 2023, 9:49am UTC](https://discuss.elastic.co/t/how-to-provide-own-api-key-in-elk-version-8-0-0/330939/8 "2023-05-29T09:49:45Z")

</div>

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