Skip to content

Commit

Permalink
Bump python version py3ews (#31338)
Browse files Browse the repository at this point in the history
* lock new version

* docker fix

* replace python versions

* fixes

* fixes

* tests

* add local time

* fixes
  • Loading branch information
YuvHayun authored Aug 27, 2024
1 parent 19d7f92 commit 3326873
Show file tree
Hide file tree
Showing 4 changed files with 357 additions and 313 deletions.
40 changes: 39 additions & 1 deletion docker/py3ews/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,45 @@
FROM demisto/crypto:1.0.0.107997
# Last modified: 2024-08-06T00:14:44.916067+00:00
FROM python:3.12.5-alpine3.19

# Upgrade all packages to latest
RUN apk --update --no-cache upgrade

COPY requirements.txt .

COPY localtime /etc/localtime

RUN apk --update add --no-cache --virtual .build-dependencies python3-dev build-base wget \
&& pip install --no-cache-dir -r requirements.txt \
&& apk del .build-dependencies \
&& pip install --upgrade setuptools

RUN addgroup -g 4000 demisto \
&& adduser -u 4000 -G demisto -D demisto -s /bin/sh

# Handling the issue described here https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000POJ0CAO&lang=en_US%E2%80%A9
# by enabling UnsafeLegacyRenegotiation
# We add to the openssl_init section after the last element "providers = provider_sect"
RUN cp /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf.org && \
echo -e 'ssl_conf = ssl_sect\n\
[ssl_sect]\n\
system_default = system_default_sect\n\
\n\
[system_default_sect]\n\
Options = UnsafeLegacyRenegotiation\n' > /tmp/ssl.cnf \
&& sed -i '/providers = provider_sect/r /tmp/ssl.cnf' /etc/ssl/openssl.cnf \
&& rm /tmp/ssl.cnf \
&& grep -C 10 'Options = UnsafeLegacyRenegotiation' /etc/ssl/openssl.cnf

# Crypto needs the latest pip
RUN pip3 install --no-cache-dir --upgrade pip

RUN apk --update add --no-cache --virtual .build-dependencies python3-dev build-base wget git \
rust cargo \
libffi-dev openssl-dev \
&& pip install --no-cache-dir -r requirements.txt \
&& apk del .build-dependencies \
&& rm -rf /root/.cargo

RUN apk --update add --no-cache libxslt-dev \
&& apk --update add --no-cache --virtual .build-dependencies python3-dev gcc build-base wget git libffi-dev openssl-dev python3-dev libxml2-dev \
&& pip install --no-cache-dir -r requirements.txt \
Expand Down
2 changes: 1 addition & 1 deletion docker/py3ews/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ requests-ntlm = "==1.1.0" # lock because of https://github.com/requests/requests
ntlm-auth = ">=1.5.0"

[requires]
python_version = "3.11"
python_version = "3.12"
Loading

0 comments on commit 3326873

Please sign in to comment.