Skip to content

Commit ca070fc

Browse files
authored
Fix the latest CVES (#2834)
1 parent df022b8 commit ca070fc

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

build/Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ FROM nginx:1.23.0 AS debian
1616
RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
1717
apt-get update \
1818
&& apt-get install --no-install-recommends --no-install-suggests -y libcap2-bin \
19-
# temp fix for CVE-2022-2068
20-
&& apt-get install --no-install-recommends --no-install-suggests -y libssl1.1 openssl \
19+
# temp fix for CVE-2022-2068, CVE-2021-4209, CVE-2022-34903, CVE-2022-27404
20+
&& apt-get install --no-install-recommends --no-install-suggests -y libssl1.1 openssl libgnutls30 gpgv libfreetype6 \
2121
&& rm -rf /var/lib/apt/lists/* \
2222
&& cp -av /tmp/ot/usr/local/lib/libopentracing.so* /tmp/ot/usr/local/lib/libjaegertracing*so* /tmp/ot/usr/local/lib/libzipkin*so* /tmp/ot/usr/local/lib/libdd*so* /tmp/ot/usr/local/lib/libyaml*so* /usr/local/lib/ \
2323
&& cp -av /tmp/ot/usr/lib/nginx/modules/ngx_http_opentracing_module.so /usr/lib/nginx/modules/ \
@@ -31,8 +31,8 @@ FROM docker.io/library/nginx:1.23.0-alpine AS alpine
3131

3232
RUN --mount=type=bind,from=alpine-opentracing-lib,target=/tmp/ot/ \
3333
apk add --no-cache libcap libstdc++ \
34-
# temp fix for CVE-2022-27405, CVE-2022-1586
35-
&& apk upgrade --no-cache freetype pcre2 \
34+
# temp fix for CVE-2022-27405, CVE-2022-1586, CVE-2022-32205, CVE-2022-2097, CVE-2022-32205, CVE-2022-2097
35+
&& apk upgrade --no-cache freetype pcre2 curl libcrypto1.1 libcurl libssl1.1 \
3636
&& cp -av /tmp/ot/usr/local/lib/libopentracing.so* /tmp/ot/usr/local/lib/libjaegertracing*so* /tmp/ot/usr/local/lib/libzipkin*so* /tmp/ot/usr/local/lib/libdd*so* /tmp/ot/usr/local/lib/libyaml*so* /usr/local/lib/ \
3737
&& cp -av /tmp/ot/usr/lib/nginx/modules/ngx_http_opentracing_module.so /usr/lib/nginx/modules/ \
3838
&& ldconfig /usr/local/lib/
@@ -45,7 +45,9 @@ ARG NGINX_PLUS_VERSION
4545
RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/apk/cert.pem,mode=0644 \
4646
--mount=type=secret,id=nginx-repo.key,dst=/etc/apk/cert.key,mode=0644 \
4747
--mount=type=bind,from=alpine-opentracing-lib,target=/tmp/ot/ \
48-
wget -nv -O /etc/apk/keys/nginx_signing.rsa.pub https://cs.nginx.com/static/keys/nginx_signing.rsa.pub \
48+
# temp fix for CVE-2022-2097
49+
apk upgrade --no-cache libcrypto1.1 libssl1.1 \
50+
&& wget -nv -O /etc/apk/keys/nginx_signing.rsa.pub https://cs.nginx.com/static/keys/nginx_signing.rsa.pub \
4951
&& printf "%s\n" "https://pkgs.nginx.com/plus/${NGINX_PLUS_VERSION}/alpine/v$(grep -E -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
5052
&& apk add --no-cache libcap nginx-plus nginx-plus-module-njs nginx-plus-module-opentracing libcurl \
5153
&& cp -av /tmp/ot/usr/local/lib/libjaegertracing*so* /tmp/ot/usr/local/lib/libzipkin*so* /tmp/ot/usr/local/lib/libdd*so* /tmp/ot/usr/local/lib/libyaml*so* /usr/local/lib/ \
@@ -64,8 +66,8 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
6466
--mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
6567
apt-get update \
6668
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates gnupg curl apt-transport-https libcap2-bin \
67-
# temp fix for CVE-2022-2068
68-
&& apt-get install --no-install-recommends --no-install-suggests -y libssl1.1 openssl \
69+
# temp fix for CVE-2022-2068, CVE-2021-4209
70+
&& apt-get install --no-install-recommends --no-install-suggests -y libssl1.1 openssl libgnutls30 \
6971
&& curl -fsSL https://cs.nginx.com/static/keys/nginx_signing.key | gpg --dearmor > /etc/apt/trusted.gpg.d/nginx_signing.gpg \
7072
&& curl -fsSL -o /etc/apt/apt.conf.d/90pkgs-nginx https://cs.nginx.com/static/files/90pkgs-nginx \
7173
&& DEBIAN_VERSION=$(awk -F '=' '/^VERSION_CODENAME=/ {print $2}' /etc/os-release) \
@@ -127,8 +129,8 @@ LABEL name="NGINX Ingress Controller" \
127129
io.openshift.tags="nginx,ingress-controller,ingress,controller,kubernetes,openshift"
128130

129131
RUN dnf --nodocs install -y shadow-utils ca-certificates \
130-
# temp fix for CVE-2022-1271
131-
&& dnf --nodocs upgrade -y xz-libs \
132+
# temp fix for CVE-2022-1271, CVE-2022-22576, CVE-2022-25313, CVE-2022-22576, CVE-2021-40528, CVE-2021-3634, CVE-2022-29824, CVE-2021-4189, CVE-2021-4189, CVE-2022-29824, CVE-2022-1621
133+
&& dnf --nodocs upgrade -y xz-libs curl expat libcurl libgcrypt libssh libssh-config libxml2 platform-python python3-libs python3-libxml2 vim-minimal \
132134
&& groupadd --system --gid 101 nginx \
133135
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx
134136

0 commit comments

Comments
 (0)