diff --git a/src/miniconda/.devcontainer/Dockerfile b/src/miniconda/.devcontainer/Dockerfile index a3c50edb7..379848ef1 100644 --- a/src/miniconda/.devcontainer/Dockerfile +++ b/src/miniconda/.devcontainer/Dockerfile @@ -1,15 +1,9 @@ FROM continuumio/miniconda3 as upstream -# Temporary: Upgrade python packages due to mentioned CVEs -# They are installed by the base image (continuumio/miniconda3) which does not have the patch. -RUN conda install \ - # https://github.com/advisories/GHSA-jjg7-2v4v-x38h - idna==3.7 - -# Temporary: Upgrade python packages using pip package manager -# RUN python3 -m pip install --upgrade \ - # https://github.com/advisories/ - # package==version +# Temporary: Upgrade python packages +# COPY ./apply_security_patches.sh /tmp/apply_security_patches.sh +# RUN chmod +x /tmp/apply_security_patches.sh +# RUN /tmp/apply_security_patches.sh # Reset and copy updated files with updated privs to keep image size down FROM mcr.microsoft.com/devcontainers/base:1-bullseye diff --git a/src/miniconda/.devcontainer/apply_security_patches.sh b/src/miniconda/.devcontainer/apply_security_patches.sh new file mode 100644 index 000000000..abb8822bc --- /dev/null +++ b/src/miniconda/.devcontainer/apply_security_patches.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# define array of packages for pinning to the patched versions +# vulnerable_packages=( "package1=version1" "package2=version2" "package3=version3" ) +vulnerable_packages=( "" ) + +# Define the number of rows (based on the length of vulnerable_packages) +rows=${#vulnerable_packages[@]} + +# Define the number of columns +cols=2 + +# Define the 2D array +declare -A packages_array + +# Fill the 2D array +for ((i=0; i