# Variables for production environment

**URL:** <https://forum.opensearch.org/t/variables-for-production-environment/3074>\
**Category:** Open Source Elasticsearch and Kibana\
**Created:** [June 15, 2020, 10:06am UTC](https://forum.opensearch.org/t/variables-for-production-environment/3074 "2020-06-15T10:06:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darrell](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@Darrell](https://forum.opensearch.org/u/Darrell)\
**Post date:** [June 15, 2020, 10:06am UTC](https://forum.opensearch.org/t/variables-for-production-environment/3074/1 "2020-06-15T10:06:39Z")

</div>

Hi all, I am trying to put together a kubernetes yaml file to deploy opendistro & kibana. The default login is admin/admin. Are there any environment variables that you can use to set the default admin to a hash of your own for security reasons on initial deploy?

Regards

---

<div class="post-metadata">

**Author:** ![Darrell](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@Darrell](https://forum.opensearch.org/u/Darrell)\
**Post date:** [June 15, 2020, 2:17pm UTC](https://forum.opensearch.org/t/variables-for-production-environment/3074/2 "2020-06-15T14:17:20Z")

</div>

So in the mean time until environment variables are available I created an initContainer to get around this. It’s a bit of a dirty fix but works for now. You can create your hash and then place the script in an s3 bucket or storage of your choice, just keep it secure though. the script is as follows:

#!/bin/bash

sed -i ‘/admin:/!b;n;c hash: “your-very-secure-hash”’ /usr/share/elasticsearch/plugins/opendistro\_security/securityconfig/internal\_users.yml  
sed -i ‘/logstash:/!b;n;c hash: “your-very-secure-hash”’ /usr/share/elasticsearch/plugins/opendistro\_security/securityconfig/internal\_users.yml

sh /usr/share/elasticsearch/plugins/opendistro\_security/tools/securityadmin.sh -cd /usr/share/elasticsearch/plugins/opendistro\_security/securityconfig/ -icl -nhnv -cacert /usr/share/elasticsearch/config/root-ca.pem -cert /usr/share/elasticsearch/config/kirk.pem -key /usr/share/elasticsearch/config/kirk-key.pem

then call it in the yaml as follows:  
initContainers:  
- name: fixauthadmin  
command: [“wget”, “[https://s3.mybucket.amazon.com/opendistro\_fix.sh](https://s3.mybucket.amazon.com/opendistro_fix.sh)”, “;”, “chmod”, “755”, “opendistro\_fix.sh”, “;”, “./opendistro\_fix.sh”]  
image: amazon/opendistro-for-elasticsearch:1.8.0  
volumeMounts:  
- mountPath: /usr/share/elasticsearch/data  
name: data  
subPath:
