When the Elastic Agent reads the configuration file, it will replace ${OUTPUTS_DEFAULT_PASSWORD} with the value of the OUTPUTS_DEFAULT_PASSWORD environment variable.
Remember to restart the Elastic Agent after setting the environment variables for the changes to take effect.
What I liked about keystores for kibana, logstash, beats etc... was that it encodes the secrets so that they are not human readable.
I guess that won't be possible with elastic-agents then? Unless I find a way to encode the .env file through other 3rd party tools and decode them when the elastic agent starts up?
What I wanted to do was actually have this container also depends_on: elastic_agent_setup whereby elastic_agent_setup is a new container that runs a bash command to the effect of echo 'superuser-password' | ./elastic-agent keystore add outputs.default.password --stdin. Then I copy that the keystore to a volume that can be accessed by my fleet-server container such that my fleet-server container can avoid the environment variable KIBANA_FLEET_PASSWORD=${ELASTIC_PASSWORD}.
Am I correct in saying that the fleet-server container is a fleet managed agent, and there is some way idiomatic way to encrypt the ELASTIC_PASSWORD that's used to set the KIBANA_FLEET_PASSWORD when using docker-compose?
I see. I think the main issue is that $ELASTIC_PASSWORD mentioned in the containers environment variable KIBANA_FLEET_PASSWORD=${ELASTIC_PASSWORD} is stored in the .env file in the same directory as the docker-compose.yml file. And the .env has all values that are not encrypted , they are in plain human read-able text. What's the best way to make secrets used by fleet-server container not human readable?
That's correct. Because I wasn't using swarm, i assumed i was only left with 2 options:
a) create a setup container that will run the ./elastic-agent keystore add ... prior to starting the fleet-server container, as described in the main question at the top
or
b) use a completely different 3rd party tool to encrypt the .env file , which would have nothing to do with elasticsearch
The original question in this post was to see if a) is a possibility, or if there are other idiomatic ways in elasticsearch to handle the situation.
And i believe everyone is saying a) is not possible.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.