File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ RUN ${INSTALL_DIR}/bin/php /tmp/copy-dependencies.php /tmp/layer/ymir/bin /tmp/l
9797 PHP_EXT_DIR=$(${INSTALL_DIR}/bin/php-config --extension-dir) && ${INSTALL_DIR}/bin/php /tmp/copy-dependencies.php /tmp/layer/lib/php/extensions/$(basename ${PHP_EXT_DIR}) /tmp/layer/lib
9898RUN find /tmp/layer/ymir/bin -type f -exec strip --strip-all {} + || true && find /tmp/layer/lib -type f -name "*.so*" -exec strip --strip-unneeded {} + || true && find /tmp/layer/lib -type f -name "*.a" -delete && find /tmp/layer/lib -type f -name "*.la" -delete
9999COPY shared/php.ini /tmp/layer/ymir/etc/php/php.ini
100+ COPY shared/99-openssl-ca-legacy.ini /tmp/layer/ymir/etc/php/conf.d/99-openssl-ca-legacy.ini
100101COPY shared/php-fpm.conf /tmp/layer/ymir/etc/php-fpm.d/php-fpm.conf
101102RUN sed -i '/extension=msgpack.so/d' /tmp/layer/ymir/etc/php/php.ini && \
102103 sed -i 's/^decorate_workers_output = /;decorate_workers_output = /' /tmp/layer/ymir/etc/php-fpm.d/php-fpm.conf && \
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ RUN ${INSTALL_DIR}/bin/php /tmp/copy-dependencies.php /tmp/layer/ymir/bin /tmp/l
9797 PHP_EXT_DIR=$(${INSTALL_DIR}/bin/php-config --extension-dir) && ${INSTALL_DIR}/bin/php /tmp/copy-dependencies.php /tmp/layer/lib/php/extensions/$(basename ${PHP_EXT_DIR}) /tmp/layer/lib
9898RUN find /tmp/layer/ymir/bin -type f -exec strip --strip-all {} + || true && find /tmp/layer/lib -type f -name "*.so*" -exec strip --strip-unneeded {} + || true && find /tmp/layer/lib -type f -name "*.a" -delete && find /tmp/layer/lib -type f -name "*.la" -delete
9999COPY shared/php.ini /tmp/layer/ymir/etc/php/php.ini
100+ COPY shared/99-openssl-ca-legacy.ini /tmp/layer/ymir/etc/php/conf.d/99-openssl-ca-legacy.ini
100101COPY shared/php-fpm.conf /tmp/layer/ymir/etc/php-fpm.d/php-fpm.conf
101102RUN sed -i '/extension=msgpack.so/d' /tmp/layer/ymir/etc/php/php.ini
102103
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ COPY shared/copy-dependencies.php /tmp/copy-dependencies.php
9797RUN ${INSTALL_DIR}/bin/php /tmp/copy-dependencies.php /tmp/layer/ymir/bin /tmp/layer/lib && ${INSTALL_DIR}/bin/php /tmp/copy-dependencies.php /tmp/layer/lib/php/extensions /tmp/layer/lib
9898RUN find /tmp/layer/ymir/bin -type f -exec strip --strip-all {} + || true && find /tmp/layer/lib -type f -name "*.so*" -exec strip --strip-unneeded {} + || true && find /tmp/layer/lib -type f -name "*.a" -delete && find /tmp/layer/lib -type f -name "*.la" -delete
9999COPY shared/php.ini /tmp/layer/ymir/etc/php/php.ini
100+ COPY shared/99-openssl-ca-legacy.ini /tmp/layer/ymir/etc/php/conf.d/99-openssl-ca-legacy.ini
100101COPY shared/php-fpm.conf /tmp/layer/ymir/etc/php-fpm.d/php-fpm.conf
101102
102103FROM --platform=${DOCKER_PLATFORM} public.ecr.aws/lambda/provided:al2023-${CPU_ARCHITECTURE}
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ COPY shared/copy-dependencies.php /tmp/copy-dependencies.php
9797RUN ${INSTALL_DIR}/bin/php /tmp/copy-dependencies.php /tmp/layer/ymir/bin /tmp/layer/lib && ${INSTALL_DIR}/bin/php /tmp/copy-dependencies.php /tmp/layer/lib/php/extensions /tmp/layer/lib
9898RUN find /tmp/layer/ymir/bin -type f -exec strip --strip-all {} + || true && find /tmp/layer/lib -type f -name "*.so*" -exec strip --strip-unneeded {} + || true && find /tmp/layer/lib -type f -name "*.a" -delete && find /tmp/layer/lib -type f -name "*.la" -delete
9999COPY shared/php.ini /tmp/layer/ymir/etc/php/php.ini
100+ COPY shared/99-openssl-ca-legacy.ini /tmp/layer/ymir/etc/php/conf.d/99-openssl-ca-legacy.ini
100101COPY shared/php-fpm.conf /tmp/layer/ymir/etc/php-fpm.d/php-fpm.conf
101102
102103FROM --platform=${DOCKER_PLATFORM} public.ecr.aws/lambda/provided:al2023-${CPU_ARCHITECTURE}
Original file line number Diff line number Diff line change 1+ ; Compatibility for legacy PHP 7.2-8.0 runtime images.
2+ ; These builds can default to a custom OpenSSL CA path not present in the
3+ ; final image, which breaks outbound TLS verification (HTTPS/STARTTLS).
4+ openssl.cafile =/etc/pki/tls/cert.pem
5+ openssl.capath =/etc/pki/tls/certs
Original file line number Diff line number Diff line change @@ -152,7 +152,21 @@ else
152152 echo " [OK] No PHP startup warnings"
153153fi
154154
155- # 8. PHP-FPM
155+ # 8. Generic TLS Crypto Validation
156+ TLS_OUTPUT=$( docker run --rm --platform " $PLATFORM " --entrypoint /opt/ymir/bin/php " $IMAGE " -r ' $content=file_get_contents("https://www.google.com");if(false===$content){echo "tls_fetch_failed\n";exit(2);}echo "tls_fetch_ok\n";' 2>&1 )
157+ TLS_STATUS=$?
158+
159+ if [ " $TLS_STATUS " -eq 0 ] && echo " $TLS_OUTPUT " | grep -q " tls_fetch_ok" ; then
160+ echo " [OK] Outbound TLS crypto succeeded"
161+ else
162+ echo " [FAIL] Outbound TLS crypto failed"
163+ echo " --------------------------------------------------------------------------------"
164+ echo " $TLS_OUTPUT "
165+ echo " --------------------------------------------------------------------------------"
166+ FAILED=1
167+ fi
168+
169+ # 9. PHP-FPM
156170FPM_BIN=" /opt/ymir/bin/php-fpm"
157171FPM_CONF=" /opt/ymir/etc/php-fpm.d/php-fpm.conf"
158172
You can’t perform that action at this time.
0 commit comments