Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[miniconda] Patch Python due to GHSA-5cpq-8wj7-hf2v
- Update Dockerfile to install the latest versions of pyopenssl and cryptography;
- Added tests to verify minimum version for pyopenssl and cryptography packages;
- Added tests to verify minimum package version via `conda list` command.
  • Loading branch information
alexander-smolyakov committed Jun 20, 2023
commit 93c29b1458e7492263d7c710d4fcf001a76222c5
7 changes: 5 additions & 2 deletions src/miniconda/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bi
# They are installed by the base image (continuumio/miniconda3) which does not have the patch.
RUN python3 -m pip install --upgrade \
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-32681
requests
requests \
# https://github.com/pyca/cryptography/security/advisories/GHSA-5cpq-8wj7-hf2v
pyopenssl \
cryptography

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# RUN apt-get updatcryptographye && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# Create conda group, update conda directory permissions,
Expand Down
8 changes: 8 additions & 0 deletions src/miniconda/test-project/test-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,11 @@ checkPythonPackageVersion()
current_version=$(python -c "import ${PACKAGE}; print(${PACKAGE}.__version__)")
check-version-ge "${PACKAGE}-requirement" "${current_version}" "${REQUIRED_VERSION}"
}

checkCondaPackageVersion()
{
PACKAGE=$1
REQUIRED_VERSION=$2
current_version=$(conda list "${PACKAGE}" | grep -w "${PACKAGE}" | awk '{print $2}')
check-version-ge "conda-${PACKAGE}-requirement" "${current_version}" "${REQUIRED_VERSION}"
}
9 changes: 8 additions & 1 deletion src/miniconda/test-project/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ check "gitconfig-contains-name" sh -c "cat /etc/gitconfig | grep 'name = devcont

check "usr-local-etc-config-does-not-exist" test ! -f "/usr/local/etc/gitconfig"

checkPythonPackageVersion "cryptography" "38.0.3"
checkPythonPackageVersion "cryptography" "41.0.0"
checkPythonPackageVersion "pyopenssl" "23.2.0"
checkPythonPackageVersion "setuptools" "65.5.1"
checkPythonPackageVersion "wheel" "0.38.1"
checkPythonPackageVersion "requests" "2.31.0"

checkCondaPackageVersion "cryptography" "41.0.0"
checkCondaPackageVersion "pyopenssl" "23.2.0"
checkCondaPackageVersion "setuptools" "65.5.1"
checkCondaPackageVersion "wheel" "0.38.1"
checkCondaPackageVersion "requests" "2.31.0"

check "conda-update-conda" bash -c "conda update -y conda"
check "conda-install" bash -c "conda install -c conda-forge --yes tensorflow"
check "conda-install" bash -c "conda install -c conda-forge --yes pytorch"
Expand Down