Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 12d6184

Browse files
authored
Explicitly upgrade openssl in docker file and enforce new version of cryptography (#9697)
1 parent e2904f7 commit 12d6184

File tree

4 files changed

+28
-20
lines changed

4 files changed

+28
-20
lines changed

changelog.d/9697.docker

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure that the docker container has up to date versions of openssl.

changelog.d/9697.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enforce that `cryptography` dependency is up to date to ensure it has the most recent openssl patches.

docker/Dockerfile

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,18 @@ FROM docker.io/python:${PYTHON_VERSION}-slim as builder
2020

2121
# install the OS build deps
2222
RUN apt-get update && apt-get install -y \
23-
build-essential \
24-
libffi-dev \
25-
libjpeg-dev \
26-
libpq-dev \
27-
libssl-dev \
28-
libwebp-dev \
29-
libxml++2.6-dev \
30-
libxslt1-dev \
31-
rustc \
32-
zlib1g-dev \
33-
&& rm -rf /var/lib/apt/lists/*
23+
build-essential \
24+
libffi-dev \
25+
libjpeg-dev \
26+
libpq-dev \
27+
libssl-dev \
28+
libwebp-dev \
29+
libxml++2.6-dev \
30+
libxslt1-dev \
31+
openssl \
32+
rustc \
33+
zlib1g-dev \
34+
&& rm -rf /var/lib/apt/lists/*
3435

3536
# Build dependencies that are not available as wheels, to speed up rebuilds
3637
RUN pip install --prefix="/install" --no-warn-script-location \
@@ -63,14 +64,16 @@ RUN pip install --prefix="/install" --no-warn-script-location \
6364
FROM docker.io/python:${PYTHON_VERSION}-slim
6465

6566
RUN apt-get update && apt-get install -y \
66-
curl \
67-
gosu \
68-
libjpeg62-turbo \
69-
libpq5 \
70-
libwebp6 \
71-
xmlsec1 \
72-
libjemalloc2 \
73-
&& rm -rf /var/lib/apt/lists/*
67+
curl \
68+
gosu \
69+
libjpeg62-turbo \
70+
libpq5 \
71+
libwebp6 \
72+
xmlsec1 \
73+
libjemalloc2 \
74+
libssl-dev \
75+
openssl \
76+
&& rm -rf /var/lib/apt/lists/*
7477

7578
COPY --from=builder /install /usr/local
7679
COPY ./docker/start.py /start.py
@@ -83,4 +86,4 @@ EXPOSE 8008/tcp 8009/tcp 8448/tcp
8386
ENTRYPOINT ["/start.py"]
8487

8588
HEALTHCHECK --interval=1m --timeout=5s \
86-
CMD curl -fSs http://localhost:8008/health || exit 1
89+
CMD curl -fSs http://localhost:8008/health || exit 1

synapse/python_dependencies.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
"Jinja2>=2.9",
8383
"bleach>=1.4.3",
8484
"typing-extensions>=3.7.4",
85+
# We enforce that we have a `cryptography` version that bundles an `openssl`
86+
# with the latest security patches.
87+
"cryptography>=3.4.7;python_version>='3.6'",
8588
]
8689

8790
CONDITIONAL_REQUIREMENTS = {

0 commit comments

Comments
 (0)