Skip to content

Commit fc81eb4

Browse files
committed
Various update: log4shell removal, testing-tools uid/gid
1 parent e93d8f3 commit fc81eb4

File tree

9 files changed

+46
-183
lines changed

9 files changed

+46
-183
lines changed

druid/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ COPY --chown=${STACKABLE_USER_UID}:0 druid/stackable/patches/${PRODUCT} /stackab
4141

4242
COPY --from=hadoop-builder --chown=${STACKABLE_USER_UID}:0 /stackable/patched-libs /stackable/patched-libs
4343
# Cache mounts are owned by root by default
44-
# We need to explicitly give the uid to use which is hardcoded to "1000" in stackable-base
44+
# We need to explicitly give the uid to use.
4545
# The cache id has to include the product version that we are building because otherwise
4646
# docker encounters race conditions when building multiple versions in parallel, as all
4747
# builder containers will share the same cache and the `rm -rf` commands will fail

java-devel/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ RUN microdnf update && \
5353
which \
5454
xz \
5555
zlib-devel \
56-
# Required for log4shell.sh
57-
unzip zip && \
5856
microdnf clean all && \
5957
rm -rf /var/cache/yum
6058

omid/Dockerfile

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,6 @@ if [ "${DELETE_CACHES}" = "true" ] ; then
4949
fi
5050
EOF
5151

52-
# ===
53-
# For earlier versions this script removes the .class file that contains the
54-
# vulnerable code.
55-
# TODO: This can be restricted to target only versions which do not honor the environment
56-
# varible that has been set above but this has not currently been implemented
57-
COPY shared/log4shell.sh /bin
58-
RUN /bin/log4shell.sh /stackable/omid-tso-server-${PRODUCT}-stackable${RELEASE}
59-
60-
# Ensure no vulnerable files are left over
61-
# This will currently report vulnerable files being present, as it also alerts on
62-
# SocketNode.class, which we do not remove with our scripts.
63-
# Further investigation will be needed whether this should also be removed.
64-
COPY shared/log4shell_1.6.1-log4shell_Linux_x86_64 /bin/log4shell_scanner_x86_64
65-
COPY shared/log4shell_1.6.1-log4shell_Linux_aarch64 /bin/log4shell_scanner_aarch64
66-
COPY shared/log4shell_scanner /bin/log4shell_scanner
67-
RUN /bin/log4shell_scanner s /stackable/omid-tso-server-${PRODUCT}-stackable${RELEASE}
68-
# ===
69-
7052
FROM stackable/image/java-base
7153

7254
ARG PRODUCT

shared/log4j.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

shared/log4shell.sh

Lines changed: 0 additions & 119 deletions
This file was deleted.
-10.2 MB
Binary file not shown.
-10.3 MB
Binary file not shown.

shared/log4shell_scanner

Lines changed: 0 additions & 3 deletions
This file was deleted.

testing-tools/Dockerfile

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ FROM python:3.12-slim-bullseye@sha256:229b2897e6b5c630d83a721e42dd1c96e3ec996323
1010
ARG PRODUCT
1111
ARG RELEASE
1212
ARG KEYCLOAK_VERSION
13+
ARG STACKABLE_USER_UID
14+
ARG STACKABLE_USER_GID
15+
ARG STACKABLE_USER_NAME
1316

1417
LABEL name="Stackable Testing Tools" \
1518
maintainer="[email protected]" \
@@ -25,49 +28,54 @@ SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
2528
# This is needed so that krb5-user installs without prompting for a realm.
2629
ENV DEBIAN_FRONTEND=noninteractive
2730

28-
# krb5-user/libkrb5-dev are needed for Kerberos support.
29-
RUN apt-get update && \
30-
apt-get install -y --no-install-recommends \
31-
build-essential \
32-
ca-certificates \
33-
curl \
34-
gzip \
35-
jq \
36-
krb5-user \
37-
kubernetes-client \
38-
libkrb5-dev \
39-
libssl-dev \
40-
libxml2-dev \
41-
libxslt1-dev \
42-
pkg-config \
43-
python3-certifi \
44-
python3-idna \
45-
python3-semver \
46-
python3-thrift \
47-
python3-toml \
48-
python3-urllib3 \
49-
tar \
50-
zip \
51-
unzip \
52-
# Java 11 seems like the best middle-ground for all tools
53-
openjdk-11-jdk-headless && \
54-
apt-get clean && \
55-
rm -rf /var/lib/apt/lists/*
5631

5732
COPY testing-tools/python /stackable/python
5833
COPY testing-tools/licenses /licenses
5934

60-
ENV PATH=/stackable/keycloak/bin:$PATH
61-
RUN curl --fail -L https://repo.stackable.tech/repository/packages/keycloak/keycloak-${KEYCLOAK_VERSION}.tar.gz | tar -xzC /stackable && \
62-
ln -s /stackable/keycloak-${KEYCLOAK_VERSION} /stackable/keycloak
35+
# krb5-user/libkrb5-dev are needed for Kerberos support.
36+
# Java 11 seems like the best middle-ground for all tools
37+
RUN <<EOF
38+
apt-get update
39+
apt-get install -y --no-install-recommends \
40+
build-essential \
41+
ca-certificates \
42+
curl \
43+
gzip \
44+
jq \
45+
krb5-user \
46+
kubernetes-client \
47+
libkrb5-dev \
48+
libssl-dev \
49+
libxml2-dev \
50+
libxslt1-dev \
51+
pkg-config \
52+
python3-certifi \
53+
python3-idna \
54+
python3-semver \
55+
python3-thrift \
56+
python3-toml \
57+
python3-urllib3 \
58+
tar \
59+
zip \
60+
unzip \
61+
openjdk-11-jdk-headless
62+
63+
apt-get clean
64+
rm -rf /var/lib/apt/lists/*
6365

64-
RUN pip install --no-cache-dir --upgrade pip && \
65-
pip install --no-cache-dir -r /stackable/python/requirements.txt && \
66-
groupadd -r stackable --gid=1000 && \
67-
useradd -r -g stackable --uid=1000 stackable && \
68-
chown -R stackable:stackable /stackable
66+
curl --fail -L https://repo.stackable.tech/repository/packages/keycloak/keycloak-${KEYCLOAK_VERSION}.tar.gz | tar -xzC /stackable
67+
ln -s /stackable/keycloak-${KEYCLOAK_VERSION} /stackable/keycloak
68+
69+
pip install --no-cache-dir --upgrade pip
70+
pip install --no-cache-dir -r /stackable/python/requirements.txt
71+
groupadd -r ${STACKABLE_USER_NAME} --gid=${STACKABLE_USER_GID}
72+
useradd -r -g ${STACKABLE_USER_NAME} --uid=${STACKABLE_USER_UID} ${STACKABLE_USER_NAME}
73+
chown -R ${STACKABLE_USER_UID}:0 /stackable
74+
EOF
75+
76+
ENV PATH=/stackable/keycloak/bin:$PATH
6977

70-
USER stackable
78+
USER ${STACKABLE_USER_UID}
7179

7280
ENV STACKABLE_PRODUCT_VERSION=${PRODUCT}
7381

0 commit comments

Comments
 (0)