diff --git a/bitnami/drupal/11/debian-12/Dockerfile b/bitnami/drupal/11/debian-12/Dockerfile index 6dbb49912a1b..be8183ea8edb 100644 --- a/bitnami/drupal/11/debian-12/Dockerfile +++ b/bitnami/drupal/11/debian-12/Dockerfile @@ -7,13 +7,13 @@ ARG DOWNLOADS_URL="downloads.bitnami.com/files/stacksmith" ARG TARGETARCH LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \ - org.opencontainers.image.created="2026-05-23T07:19:46Z" \ + org.opencontainers.image.created="2026-05-28T15:05:57Z" \ org.opencontainers.image.description="Application packaged by Broadcom, Inc." \ org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/drupal/README.md" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/drupal" \ org.opencontainers.image.title="drupal" \ org.opencontainers.image.vendor="Broadcom, Inc." \ - org.opencontainers.image.version="11.3.10" + org.opencontainers.image.version="11.3.11" ENV HOME="/" \ OS_ARCH="${TARGETARCH:-amd64}" \ @@ -29,22 +29,22 @@ RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \ mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ || exit 1 ; \ COMPONENTS=( \ "render-template-1.0.9-165-linux-${OS_ARCH}-debian-12" \ - "php-8.4.21-3-linux-${OS_ARCH}-debian-12" \ + "php-8.4.21-5-linux-${OS_ARCH}-debian-12" \ "mysql-client-12.2.2-0-linux-${OS_ARCH}-debian-12" \ "libphp-8.4.21-0-linux-${OS_ARCH}-debian-12" \ "postgresql-lib-18.4.0-0-linux-${OS_ARCH}-debian-12" \ "apache-2.4.67-1-linux-${OS_ARCH}-debian-12" \ - "drupal-11.3.10-0-linux-${OS_ARCH}-debian-12" \ + "drupal-11.3.11-0-linux-${OS_ARCH}-debian-12" \ ) ; \ for COMPONENT in "${COMPONENTS[@]}"; do \ if [ ! -f "${COMPONENT}.tar.gz" ]; then \ curl -SsLf "https://${DOWNLOADS_URL}/${COMPONENT}.tar.gz" -O ; \ - curl -SsLf "https://${DOWNLOADS_URL}/${COMPONENT}.tar.gz.sha256" -O ; \ fi ; \ - sha256sum -c "${COMPONENT}.tar.gz.sha256" ; \ + sha256sum -c "/opt/bitnami/checksums/${COMPONENT}.tar.gz.sha256" ; \ tar -zxf "${COMPONENT}.tar.gz" -C /opt/bitnami --strip-components=2 --no-same-owner ; \ - rm -rf "${COMPONENT}".tar.gz{,.sha256} ; \ - done + rm -rf "${COMPONENT}".tar.gz ; \ + done ; \ + rm -rf /opt/bitnami/checksums ; RUN apt-get update && apt-get upgrade -y && \ apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives RUN chmod g+rwX /opt/bitnami @@ -59,9 +59,9 @@ RUN /opt/bitnami/scripts/drupal/postunpack.sh RUN /opt/bitnami/scripts/mysql-client/postunpack.sh ENV APACHE_HTTPS_PORT_NUMBER="" \ APACHE_HTTP_PORT_NUMBER="" \ - APP_VERSION="11.3.10" \ + APP_VERSION="11.3.11" \ BITNAMI_APP_NAME="drupal" \ - IMAGE_REVISION="2" \ + IMAGE_REVISION="0" \ LD_LIBRARY_PATH="/opt/bitnami/postgresql/lib:$LD_LIBRARY_PATH" \ PATH="/opt/bitnami/common/bin:/opt/bitnami/php/bin:/opt/bitnami/php/sbin:/opt/bitnami/mysql/bin:/opt/bitnami/apache/bin:/opt/bitnami/drupal/vendor/bin:$PATH" diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/apache-2.4.67-1-linux-amd64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/apache-2.4.67-1-linux-amd64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..ffe4d71f0d07 --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/apache-2.4.67-1-linux-amd64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +cc9ec4ed758ad8502b7057aa3527cc003261038cd75f0a5fa8aa885bfea46ff1 apache-2.4.67-1-linux-amd64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/apache-2.4.67-1-linux-arm64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/apache-2.4.67-1-linux-arm64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..06e58dbe1e02 --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/apache-2.4.67-1-linux-arm64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +01aa3fe1d54b7ecde2e19098de2fe93205c1c105ff31391f98f5afc3274aa99e apache-2.4.67-1-linux-arm64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/drupal-11.3.11-0-linux-amd64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/drupal-11.3.11-0-linux-amd64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..fe4d040ebd64 --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/drupal-11.3.11-0-linux-amd64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +5e9fdcfb294dfc33c0df522ce3368c7a056be249b558b2c6bf454b4d7e0b30e8 drupal-11.3.11-0-linux-amd64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/drupal-11.3.11-0-linux-arm64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/drupal-11.3.11-0-linux-arm64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..8afc26b983be --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/drupal-11.3.11-0-linux-arm64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +d5f8214eb1fbba61b066ac4f1ccae5007971c7ba2155882a35bcc67769043b60 drupal-11.3.11-0-linux-arm64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/libphp-8.4.21-0-linux-amd64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/libphp-8.4.21-0-linux-amd64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..9e20f02d08b0 --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/libphp-8.4.21-0-linux-amd64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +1c0534f33b21dc6b1754967226d002345b0461f94601a55006b91441136c240f libphp-8.4.21-0-linux-amd64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/libphp-8.4.21-0-linux-arm64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/libphp-8.4.21-0-linux-arm64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..3645c6b66d95 --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/libphp-8.4.21-0-linux-arm64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +949e96622f83b03c9abfdd23c4d45fefb96cbecde83a6315d8d556806a2d3e4a libphp-8.4.21-0-linux-arm64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/mysql-client-12.2.2-0-linux-amd64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/mysql-client-12.2.2-0-linux-amd64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..d30c327a19c5 --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/mysql-client-12.2.2-0-linux-amd64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +774176309ecff1cb425ea9f4d887a4280404c017da7ddef06c6568345abb434e mysql-client-12.2.2-0-linux-amd64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/mysql-client-12.2.2-0-linux-arm64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/mysql-client-12.2.2-0-linux-arm64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..02edc10429de --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/mysql-client-12.2.2-0-linux-arm64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +f3cb04c8b0781e306ef47be8b97409b6b19bd3f7bc6b7dcabddc242b6a9ab6c2 mysql-client-12.2.2-0-linux-arm64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/php-8.4.21-5-linux-amd64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/php-8.4.21-5-linux-amd64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..e6b37c12a0ea --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/php-8.4.21-5-linux-amd64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +101267a9e206d18be90a2bd1fc383a168359c96e1db7f7383d31a7366f1137fd php-8.4.21-5-linux-amd64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/php-8.4.21-5-linux-arm64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/php-8.4.21-5-linux-arm64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..f18b6e839e8d --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/php-8.4.21-5-linux-arm64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +73d961f31f79364d8c10385e3f2a918fc5b7e8bb4150cbdf11063a1ed60fde9a php-8.4.21-5-linux-arm64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/postgresql-lib-18.4.0-0-linux-amd64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/postgresql-lib-18.4.0-0-linux-amd64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..e709b318aded --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/postgresql-lib-18.4.0-0-linux-amd64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +e3a4e54345bbb5106076d25282c09391fb37035f9132cf2df482f0a854939810 postgresql-lib-18.4.0-0-linux-amd64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/postgresql-lib-18.4.0-0-linux-arm64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/postgresql-lib-18.4.0-0-linux-arm64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..a5c0df159cbb --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/postgresql-lib-18.4.0-0-linux-arm64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +06994f7557096a92e9c75472b0336b1f90c0c854b6590583ff62738b98767c63 postgresql-lib-18.4.0-0-linux-arm64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/render-template-1.0.9-165-linux-amd64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/render-template-1.0.9-165-linux-amd64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..ecf216f2789c --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/render-template-1.0.9-165-linux-amd64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +374910c7361f00d393eca79a749d29f389b4522057902c7655f0a3a5ae3d1b32 render-template-1.0.9-165-linux-amd64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/render-template-1.0.9-165-linux-arm64-debian-12.tar.gz.sha256 b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/render-template-1.0.9-165-linux-arm64-debian-12.tar.gz.sha256 new file mode 100644 index 000000000000..e15b6bdd7577 --- /dev/null +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/checksums/render-template-1.0.9-165-linux-arm64-debian-12.tar.gz.sha256 @@ -0,0 +1 @@ +d492024d2d8261cfb147e7b508d341b91349fd41cf41aecd0706046be8cb108b render-template-1.0.9-165-linux-arm64-debian-12.tar.gz diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/scripts/libfile.sh b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/scripts/libfile.sh index 1c69e0e48a5d..335c1c7c9ef7 100644 --- a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/scripts/libfile.sh +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/scripts/libfile.sh @@ -139,3 +139,40 @@ wait_for_log_entry() { return 1 fi } + +######################## +# Creates a secure temporary file containing the provided secret +# Arguments: +# $1 - secret to write to the temporary file +# Returns: +# String +######################### +credential_to_temp_file() { + local secret="$1" + local tmp_file + + # Use mktemp with a specific prefix for easier debugging if something lingers + if ! tmp_file=$(mktemp "${TMPDIR:-/tmp}/at.cred.XXXXXXXX"); then + echo "Error: Failed to create temp file" >&2 + return 1 + fi + + # Restrict permissions before writing the secret + chmod 0600 "$tmp_file" + # Write secret and ensure it's flushed to disk + printf "%s" "$secret" > "$tmp_file" + # Output the filename so the caller can capture it + echo "$tmp_file" +} + +######################## +# Cleans up temporary files created by credential_to_temp_file +# Arguments: +# None +# Returns: +# None +######################### +cleanup_credentials() { + debug "Cleaning up temporary files containing credentials" + rm -rf "${TMPDIR:-/tmp}"/at.cred.* +} diff --git a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/scripts/libfs.sh b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/scripts/libfs.sh index 1337f6c2dd59..b16efabd3230 100644 --- a/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/scripts/libfs.sh +++ b/bitnami/drupal/11/debian-12/prebuildfs/opt/bitnami/scripts/libfs.sh @@ -131,6 +131,7 @@ relativize() { # -d|--dir-mode - mode for files. # -u|--user - user # -g|--group - group +# -n|--no-dereference - do not follow symlinks (use for runtime root chown of daemon-writable dirs) # Returns: # None ######################### @@ -140,6 +141,7 @@ configure_permissions_ownership() { local file_mode="" local user="" local group="" + local follow_symlinks="yes" # Validate arguments shift 1 @@ -161,6 +163,9 @@ configure_permissions_ownership() { shift group="${1:?missing group}" ;; + -n | --no-dereference) + follow_symlinks="no" + ;; *) echo "Invalid command line flag $1" >&2 return 1 @@ -169,22 +174,29 @@ configure_permissions_ownership() { shift done + # -L: follow symlinks and emits the target path + # This is dangerous at runtime, given a co-located lower-privileged process with write access + # to the target path can redirect the chown/chmod to arbitrary paths. Example: + # Lower-privileged process run: ln -s /etc /tmp/etc + # Then, setup.sh runs: configure_permissions_ownership --dir-mode 775 /tmp + local find_L_flag=(); [[ "$follow_symlinks" == "yes" ]] && find_L_flag=("-L") + # -h: changes symlink inode ownership without touching the target. + local chown_flags=(); [[ "$follow_symlinks" == "no" ]] && chown_flags=("-h") read -r -a filepaths <<<"$paths" for p in "${filepaths[@]}"; do if [[ -e "$p" ]]; then - find -L "$p" -printf "" if [[ -n $dir_mode ]]; then - find -L "$p" -type d ! -perm "$dir_mode" -print0 | xargs -r -0 chmod "$dir_mode" + find "${find_L_flag[@]}" "$p" -not -type l -type d ! -perm "$dir_mode" -print0 | xargs -r -0 chmod "$dir_mode" fi if [[ -n $file_mode ]]; then - find -L "$p" -type f ! -perm "$file_mode" -print0 | xargs -r -0 chmod "$file_mode" + find "${find_L_flag[@]}" "$p" -not -type l -type f ! -perm "$file_mode" -print0 | xargs -r -0 chmod "$file_mode" fi if [[ -n $user ]] && [[ -n $group ]]; then - find -L "$p" -print0 | xargs -r -0 chown "${user}:${group}" + find "${find_L_flag[@]}" "$p" -print0 | xargs -r -0 chown "${chown_flags[@]}" "${user}:${group}" elif [[ -n $user ]] && [[ -z $group ]]; then - find -L "$p" -print0 | xargs -r -0 chown "${user}" + find "${find_L_flag[@]}" "$p" -print0 | xargs -r -0 chown "${chown_flags[@]}" "${user}" elif [[ -z $user ]] && [[ -n $group ]]; then - find -L "$p" -print0 | xargs -r -0 chgrp "${group}" + find "${find_L_flag[@]}" "$p" -print0 | xargs -r -0 chgrp "${chown_flags[@]}" "${group}" fi else stderr_print "$p does not exist" diff --git a/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/apache/bitnami-templates/bitnami-ssl.conf.tpl b/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/apache/bitnami-templates/bitnami-ssl.conf.tpl index ff6de13a321e..a830382f2dd3 100644 --- a/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/apache/bitnami-templates/bitnami-ssl.conf.tpl +++ b/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/apache/bitnami-templates/bitnami-ssl.conf.tpl @@ -5,9 +5,11 @@ Listen 443 -SSLProtocol all -SSLv2 -SSLv3 -SSLHonorCipherOrder on -SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !EDH !RC4" +SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 +# Ciphers for TLS 1.2, see https://wiki.mozilla.org/Security/Server_Side_TLS +SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 +SSLHonorCipherOrder off +SSLSessionTickets off SSLPassPhraseDialog builtin SSLSessionCache "shmcb:{{APACHE_LOGS_DIR}}/ssl_scache(512000)" SSLSessionCacheTimeout 300 diff --git a/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/drupal/setup.sh b/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/drupal/setup.sh index acab8a61a0fc..bbd1ffce028b 100755 --- a/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/drupal/setup.sh +++ b/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/drupal/setup.sh @@ -34,5 +34,7 @@ drupal_validate # Update web server configuration with runtime environment (needs to happen before the initialization) web_server_update_app_configuration "drupal" +# Ensure we clean up temporary files when this script ends +trap cleanup_credentials EXIT # Ensure Drupal is initialized drupal_initialize diff --git a/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/libdrupal.sh b/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/libdrupal.sh index 117fbbb9a54e..4c4fea245cf9 100644 --- a/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/libdrupal.sh +++ b/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/libdrupal.sh @@ -8,6 +8,7 @@ # Load Generic Libraries . /opt/bitnami/scripts/libphp.sh +. /opt/bitnami/scripts/libfile.sh . /opt/bitnami/scripts/libfs.sh . /opt/bitnami/scripts/libos.sh . /opt/bitnami/scripts/libnet.sh @@ -144,7 +145,7 @@ drupal_initialize() { info "Configuring file permissions for Drupal" ensure_dir_exists "$DRUPAL_VOLUME_DIR" # Use daemon:root ownership for compatibility when running as a non-root user - am_i_root && configure_permissions_ownership "$DRUPAL_VOLUME_DIR" -d "775" -f "664" -u "$WEB_SERVER_DAEMON_USER" -g "root" + am_i_root && configure_permissions_ownership "$DRUPAL_VOLUME_DIR" -d "775" -f "664" -u "$WEB_SERVER_DAEMON_USER" -g "root" -n if ! is_boolean_yes "$DRUPAL_SKIP_BOOTSTRAP"; then # Perform initial bootstrapping for Drupal @@ -288,18 +289,11 @@ drupal_site_install() { PHP_OPTIONS="-d sendmail_path=$(which true)" export PHP_OPTIONS - # Avoid passing Drupal & database password as arguments to drush, to avoid leaking them given + # Avoid passing Drupal & database password as arguments to drush, to avoid leaking them # given a local observer with /proc read access can read them - # Instead, we can read them from temporary files local drush_password_file database_url_file - drush_password_file="$(mktemp)" - database_url_file="$(mktemp)" - chmod 0600 "$drush_password_file" "$database_url_file" - echo "$DRUPAL_PASSWORD" > "$drush_password_file" - echo "mysql://${DRUPAL_DATABASE_USER}:${DRUPAL_DATABASE_PASSWORD}@${DRUPAL_DATABASE_HOST}:${DRUPAL_DATABASE_PORT_NUMBER}/${DRUPAL_DATABASE_NAME}" > "$database_url_file" - # shellcheck disable=SC2064 - trap "rm -f $drush_password_file $database_url_file" RETURN ERR INT TERM - + drush_password_file="$(credential_to_temp_file "$DRUPAL_PASSWORD")" + database_url_file="$(credential_to_temp_file "mysql://${DRUPAL_DATABASE_USER}:${DRUPAL_DATABASE_PASSWORD}@${DRUPAL_DATABASE_HOST}:${DRUPAL_DATABASE_PORT_NUMBER}/${DRUPAL_DATABASE_NAME}")" drush_execute "site:install" \ "--db-url=$(<"$database_url_file")" \ "--account-name=${DRUPAL_USERNAME}" \ diff --git a/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/libmysqlclient.sh b/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/libmysqlclient.sh index c096f4d1e1c1..1a3ae0d0dc67 100644 --- a/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/libmysqlclient.sh +++ b/bitnami/drupal/11/debian-12/rootfs/opt/bitnami/scripts/libmysqlclient.sh @@ -263,7 +263,12 @@ mysql_execute_print_output() { fi args+=("-N" "-u" "$user") [[ -n "$db" ]] && args+=("$db") - [[ -n "$pass" ]] && args+=("-p$pass") + # Avoid passing credentials as arguments to mysql, to avoid leaking them given a local observer with /proc read access can read them + if [[ -n "$pass" ]]; then + local pass_file + pass_file="$(credential_to_temp_file "$pass")" + args+=("-p$(<"$pass_file")") + fi [[ "${#opts[@]}" -gt 0 ]] && args+=("${opts[@]}") [[ "${#extra_opts[@]}" -gt 0 ]] && args+=("${extra_opts[@]}") @@ -271,7 +276,6 @@ mysql_execute_print_output() { if [[ "${BITNAMI_DEBUG:-false}" = true ]]; then local mysql_cmd mysql_cmd="$(