# Privileged containers should be avoided

**URL:** <https://discuss.elastic.co/t/privileged-containers-should-be-avoided/323382>\
**Category:** Elasticsearch\
**Created:** [January 18, 2023, 6:34am UTC](https://discuss.elastic.co/t/privileged-containers-should-be-avoided/323382 "2023-01-18T06:34:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddhote](https://avatars.discourse-cdn.com/v4/letter/d/bc79bd/32.png) [@ddhote](https://discuss.elastic.co/u/ddhote)\
**Post date:** [January 18, 2023, 6:34am UTC](https://discuss.elastic.co/t/privileged-containers-should-be-avoided/323382/1 "2023-01-18T06:34:41Z")

</div>

Hello Team,

We have Elasticsearch containers in AKS where initial container has "Privileged= True" which is against our security policy. But, init container is failing with "Privileged=False", can someone please help how can we resolve this? Can Init container work with "Privileged= False" security context?

---

<div class="post-metadata">

**Author:** ![nicolas.mathieu](https://avatars.discourse-cdn.com/v4/letter/n/8edcca/32.png) [@nicolas.mathieu](https://discuss.elastic.co/u/nicolas.mathieu)\
**Post date:** [January 20, 2023, 1:57am UTC](https://discuss.elastic.co/t/privileged-containers-should-be-avoided/323382/2 "2023-01-20T01:57:07Z")

</div>

Hi, I just faced exactly same problem.  
I am looking forward to a solution!

---

<div class="post-metadata">

**Author:** ![BenB196](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benb196/32/83401_2.png) [@BenB196](https://discuss.elastic.co/u/BenB196)\
**Post date:** [January 20, 2023, 11:52am UTC](https://discuss.elastic.co/t/privileged-containers-should-be-avoided/323382/3 "2023-01-20T11:52:44Z")

</div>

If the init container in question is the sysctl which sets the [Virtual Memory](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-virtual-memory.html). You should be able to set the virtual memory at the AKS host/node level then disable/remove this init container entirely.

---

<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:** [February 17, 2023, 11:53am UTC](https://discuss.elastic.co/t/privileged-containers-should-be-avoided/323382/4 "2023-02-17T11:53:25Z")

</div>

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