diff --git a/README.md b/README.md index 1ce6410..9dd9118 100644 --- a/README.md +++ b/README.md @@ -288,7 +288,7 @@ But note that: #### Security -Because environment variables can potentially contain sensitive information, `/etc/container_environment` and its Bash and JSON dumps are by default owned by root, and root-accessible only. If you are sure that your environment variables don't contain sensitive data, then you can relax the permissions on that directory and those files by making them world-readable: +Because environment variables can potentially contain sensitive information, `/etc/container_environment` and its Bash and JSON dumps are by default owned by root, and accessible only by docker_env group (so any user added this group will have these variables automatically loaded). If you are sure that your environment variables don't contain sensitive data, then you can relax the permissions on that directory and those files by making them world-readable: RUN chmod 755 /etc/container_environment RUN chmod 644 /etc/container_environment.sh /etc/container_environment.json diff --git a/image/system_services.sh b/image/system_services.sh index 7947ad4..8a8cb9f 100755 --- a/image/system_services.sh +++ b/image/system_services.sh @@ -10,7 +10,11 @@ mkdir -p /etc/container_environment touch /etc/container_environment.sh touch /etc/container_environment.json chmod 700 /etc/container_environment -chmod 600 /etc/container_environment.sh /etc/container_environment.json + +groupadd docker_env +chown :docker_env /etc/container_environment.sh /etc/container_environment.json +chmod 640 /etc/container_environment.sh /etc/container_environment.json +ln -s /etc/container_environment.sh /etc/profile.d/ ## Install runit. $minimal_apt_get_install runit