Went through a crash course in Docker and Compose to learn how to deploy a small automated application with security in mind. Problem is, I needed to feed the script sensitive values and did not want to hardcode them in. After a lot of research, I settled on Compose and setting my env var's at runtime rather than using the standard Docker build. I also have some JSON files that contain web cookies as a form of login that are passed as volumes. My understanding was that the values would not be visible while inspecting the container. Yet, when I inspect it, they are clearly visible along with the contents of the JSON files. Unless I am the only one that knows how to access the specific container, I am pretty sure that this is NOT a safe option.
From the yaml:
services:
frontend:
image: SOME IMAGE
build: .
volumes:
- ./script.py:/app/script.py
- ./words.txt:/app/words.txt
- ./.some.json:/app/.some.json
- ./.another.json:/app/.another.json
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
env_file:
- ./some.env
container_name: name
volumes:
.:
external: true
Why are the values and files clearly visible? I do not want to go the Swarm direction and its SECRETS at this time.
EDIT: this is not being pushed to Hub or a repository, so I am not worried about security in that regard.