Skip to content

Commit 3dae94a

Browse files
authored
Merge pull request #59 from cron-eu/security
Do not expose certain internal ENV variables to processes
2 parents 2d796c6 + f280efe commit 3dae94a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

files/entrypoint-extras.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,17 @@ fi
8787
if [ ! -z "${PHP_INI_OVERRIDE}" ]; then
8888
echo "${PHP_INI_OVERRIDE}" | sed -e 's/\\n/\n/g' > /usr/local/etc/php/conf.d/zz-02-custom.ini
8989
fi
90+
unset PHP_INI_OVERRIDE
91+
92+
# Remove ENV variables that are meant only for the SSH container
93+
94+
unset SSH_PRIVATE_KEY
95+
unset IMPORT_GITLAB_PUB_KEYS
96+
unset IMPORT_GITHUB_PUB_KEYS
97+
unset IMPORT_PUB_KEYS
98+
unset SSH_CONFIG SSH_KNOWN_HOSTS
99+
100+
# Remove ENV variables that are meant only for the web container
101+
102+
unset HTTPD_EXTRA_CONF SSL_KEY SSL_CRT WEB_PORTS_HTTP WEB_PORTS_HTTPS
103+

files/entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ if [ ! -z "${PHP_FPM_OVERRIDE}" ]; then
3030
echo "; Customizations from PHP_FPM_OVERRIDE:" >> $PHP_FPM_POOL_CONF
3131
echo "${PHP_FPM_OVERRIDE}" | sed -e 's/\\n/\n/g' >> $PHP_FPM_POOL_CONF
3232
fi
33+
unset PHP_FPM_OVERRIDE
3334

3435
# Start the "real" entrypoint
3536
. /usr/local/bin/docker-php-entrypoint

0 commit comments

Comments
 (0)