From cc9f2051b1672f553e0c28bdc3c4ad3db06712af Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Thu, 17 Aug 2023 14:58:53 -0700 Subject: [PATCH] Fix CVEs in UBI NAP images (#4257) (cherry picked from commit 17f0950657d60ca9cac046264c9b0b1d7c6ad62d) --- build/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index fb6c879b9d..f010dda8cf 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -180,8 +180,6 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode && curl -fsSL "https://cs.nginx.com/static/files/nginx-plus-$(grep -E -o '[0-9]+\.[0-9]+' /etc/redhat-release | cut -d"." -f1).repo" | tr 0 1 > /etc/yum.repos.d/nginx-plus.repo \ && sed -i "0,/centos/s;;${NGINX_PLUS_VERSION}/centos;" /etc/yum.repos.d/nginx-plus.repo \ && dnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-fips-check \ - # temp fix for CVE-2023-24329 - && dnf upgrade -y platform-python \ ## end of duplicated code && sed -i 's/\(def in_container():\)/\1\n return False/g' /usr/lib64/python*/*-packages/rhsm/config.py \ && subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} || true \ @@ -198,6 +196,8 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode sed -i "0,/centos/s;;${NGINX_PLUS_VERSION}/centos;" /etc/yum.repos.d/app-protect-dos-8.repo; \ dnf --nodocs install -y app-protect-dos; \ fi \ + # fix for CVEs + && dnf upgrade -y curl dbus libcap libssh platform-python python3-requests libxml2 systemd sqlite-libs \ && rm /etc/yum.repos.d/app-protect*.repo \ && subscription-manager unregister \ && dnf clean all && rm -rf /var/cache/dnf