# ECK Kibana securityContext on kubernetes \>= 1.26

**URL:** https://discuss.elastic.co/t/eck-kibana-securitycontext-on-kubernetes-1-26/355789
**Category:** Kibana
**Tags:** elastic-stack-security
**Created:** [March 20, 2024, 7:22am UTC](https://discuss.elastic.co/t/eck-kibana-securitycontext-on-kubernetes-1-26/355789 "2024-03-20T07:22:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![codedoings](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/codedoings/32/123249_2.png) [@codedoings](https://discuss.elastic.co/u/codedoings)
#### Post date: [March 20, 2024, 7:22am UTC](https://discuss.elastic.co/t/eck-kibana-securitycontext-on-kubernetes-1-26/355789/1 "2024-03-20T07:22:37Z")

</div>

Im trying to get elasticsearch and kibana up and running using ECK on kubernetes 1.26. I´ve managed to modify the podtemplate for the elasticsearch resource so that it sets the seccompProfile in the securityContext but I'm struggling with the securityContext of the kibana customresourcedefinition. Initially I did not have a podTemplate in my kibana yaml, but then the kibana deployment got stuck on the podsecurity admission controller. I tried adding this pod template:

`containers:`  
` - name: kibana`  
` securityContext:`  
` allowPrivilegeEscalation: false`  
` privileged: false`  
` capabilities:`  
` drop:`  
` - ALL`  
` runAsNonRoot: true`  
` seccompProfile:`  
` type: RuntimeDefault`  
` initContainers:`  
` - name: elastic-internal-init-config`  
` securityContext:`  
` allowPrivilegeEscalation: false`  
` privileged: false`  
` capabilities:`  
` drop:`  
` - ALL`  
` runAsNonRoot: true`  
` seccompProfile:`  
` type: RuntimeDefault`

Now the kibana pod gets created but it gets stuck on the initcontainer with the following message: _Error: container has runAsNonRoot and image has non-numeric user (kibana), cannot verify user is non-root_ . Does anyone know the proper way to configure the kibana CRD when having pod security enabled?

---

<div class="post-metadata">

### Author: ![codedoings](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/codedoings/32/123249_2.png) [@codedoings](https://discuss.elastic.co/u/codedoings)
#### Post date: [March 20, 2024, 8:43am UTC](https://discuss.elastic.co/t/eck-kibana-securitycontext-on-kubernetes-1-26/355789/2 "2024-03-20T08:43:06Z")

</div>

This seems to be fixed in version 8.12. I was running 8.11.2 but the problem does not happen when using version 8.12.

---

<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: [April 17, 2024, 8:43am UTC](https://discuss.elastic.co/t/eck-kibana-securitycontext-on-kubernetes-1-26/355789/3 "2024-04-17T08:43:30Z")

</div>

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