File tree Expand file tree Collapse file tree 9 files changed +34
-0
lines changed
.devcontainer/local-features/setup-user Expand file tree Collapse file tree 9 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ RUN python3 -m pip install \
6666 numpy \
6767 # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23491
6868 certifi \
69+ # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40897
70+ setuptools \
6971 # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40899
7072 future \
7173 # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40898
Original file line number Diff line number Diff line change 3030 " mistune" ,
3131 " numpy" ,
3232 " certifi" ,
33+ " setuptools" ,
3334 " future" ,
3435 " wheel"
3536 ],
Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ check-version-ge "mistune-requirement" "${mistune_version}" "2.0.3"
4444numpy_version=$( python -c " import numpy; print(numpy.__version__)" )
4545check-version-ge " numpy-requirement" " ${numpy_version} " " 1.22"
4646
47+ setuptools_version=$( python -c " import setuptools; print(setuptools.__version__)" )
48+ check-version-ge " setuptools-requirement" " ${setuptools_version} " " 65.5.1"
49+
4750future_version=$( python -c " import future; print(future.__version__)" )
4851check-version-ge " future-requirement" " ${future_version} " " 0.18.3"
4952
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
66 # Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
77 && apt-get purge -y imagemagick imagemagick-6-common
88
9+ # Temporary: Upgrade python packages due to https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40897
10+ # They are installed by the base image (python) which does not have the patch.
11+ RUN python3 -m pip install --upgrade setuptools
12+
913# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
1014# COPY requirements.txt /tmp/pip-tmp/
1115# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
Original file line number Diff line number Diff line change 106106 " virtualenv" ,
107107 " pipx"
108108 ],
109+ "pip" : [
110+ " setuptools"
111+ ],
109112 "languages" : {
110113 "Python" : {
111114 "cgIgnore" : true ,
Original file line number Diff line number Diff line change @@ -39,5 +39,8 @@ check "gitconfig-contains-name" sh -c "cat /etc/gitconfig | grep 'name = devcont
3939
4040check " usr-local-etc-config-does-not-exist" test ! -f " /usr/local/etc/gitconfig"
4141
42+ setuptools_version=$( python -c " import setuptools; print(setuptools.__version__)" )
43+ check-version-ge " setuptools-requirement" " ${setuptools_version} " " 65.5.1"
44+
4245# Report result
4346reportResults
Original file line number Diff line number Diff line change @@ -39,6 +39,20 @@ rm -rf /usr/local/nvs/deps/node_modules/follow-redirects/*
3939curl -sSL https://github.com/follow-redirects/follow-redirects/archive/refs/tags/v1.15.2.tar.gz | tar -xzC /tmp 2>&1
4040mv /tmp/follow-redirects-1.15.2/* /usr/local/nvs/deps/node_modules/follow-redirects/
4141
42+ sudo_if () {
43+ COMMAND=" $* "
44+ if [ " $( id -u) " -eq 0 ] && [ " $USERNAME " != " root" ]; then
45+ su - " $USERNAME " -c " $COMMAND "
46+ else
47+ " $COMMAND "
48+ fi
49+ }
50+
51+ # Temporary: Upgrade python packages due to https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40897
52+ # They are installed by the base image (python) which does not have the patch.
53+ sudo_if /usr/local/python/current/bin/python -m pip uninstall --yes setuptools
54+ sudo_if /usr/local/python/current/bin/python -m pip install --user --upgrade --no-cache-dir setuptools
55+
4256# Enables the oryx tool to generate manifest-dir which is needed for running the postcreate tool
4357DEBIAN_FLAVOR=" focal-scm"
4458mkdir -p /opt/oryx && echo " vso-focal" > /opt/oryx/.imagetype
Original file line number Diff line number Diff line change 119119 " plotly" ,
120120 " jupyterlab-git" ,
121121 " certifi" ,
122+ " setuptools" ,
122123 " wheel"
123124 ],
124125 "other" : {
Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ check "torch" python -c "import torch; print(torch.__version__)"
5555check " requests" python -c " import requests; print(requests.__version__)"
5656check " jupyterlab-git" bash -c " python3 -m pip list | grep jupyterlab-git"
5757
58+ setuptools_version=$( python3 -c " import setuptools; print(setuptools.__version__)" )
59+ check-version-ge " setuptools-requirement" " ${setuptools_version} " " 65.5.1"
60+
5861# Check JupyterLab
5962check " jupyter-lab" jupyter-lab --version
6063check " jupyter-lab config" grep " .*.allow_origin = '*'" /home/codespace/.jupyter/jupyter_server_config.py
You can’t perform that action at this time.
0 commit comments