Skip to content

Commit 23a05f6

Browse files
committed
Switch to latest pypi nassl/sslyze
1 parent 1b8a48f commit 23a05f6

File tree

6 files changed

+15
-39
lines changed

6 files changed

+15
-39
lines changed

checks/tasks/tls/scans.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePublicKey
1616
from cryptography.x509 import Certificate
1717
from django.conf import settings
18-
from dns.exception import ValidationFailure
1918
from dns.name import EmptyLabel
2019
from dns.resolver import NXDOMAIN, NoAnswer, NoNameservers, LifetimeTimeout
2120
from nassl._nassl import OpenSSLError
@@ -145,13 +144,13 @@ def dane(
145144
dane_data = None
146145
dnssec_status = None
147146
try:
148-
rrset, dnssec_status = dns_resolve_tlsa(dane_qname, allow_bogus=False)
147+
rrset, dnssec_status = dns_resolve_tlsa(dane_qname)
149148
dane_data = [(rr.usage, rr.selector, rr.mtype, binascii.hexlify(rr.cert).decode("ascii")) for rr in rrset]
149+
if dnssec_status == DNSSECStatus.BOGUS:
150+
status = DaneStatus.none_bogus
151+
score = score_none_bogus
150152
except (NXDOMAIN, NoAnswer, NoNameservers, LifetimeTimeout, EmptyLabel):
151153
pass
152-
except ValidationFailure:
153-
status = DaneStatus.none_bogus
154-
score = score_none_bogus
155154

156155
if not dane_data or dnssec_status != DNSSECStatus.SECURE:
157156
return dict(
@@ -860,7 +859,7 @@ def test_key_exchange_hash(
860859
There are few or no hosts that do not meet this requirement.
861860
"""
862861
ssl_connection = server_connectivity_info.get_preconfigured_tls_connection(should_use_legacy_openssl=False)
863-
ssl_connection.ssl_client.set_sigalgs(SIGNATURE_ALGORITHMS_SHA2)
862+
ssl_connection.ssl_client.set_signature_algorithms(SIGNATURE_ALGORITHMS_SHA2)
864863

865864
try:
866865
ssl_connection.connect()

docker/Dockerfile

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,6 @@ RUN ./configure \
5353
RUN make
5454
RUN make install
5555

56-
FROM build-deps AS build-nassl
57-
58-
COPY vendor/nassl6 /src/vendor/nassl
59-
WORKDIR /src/vendor/nassl
60-
61-
RUN ln -s /usr/bin/python3 /usr/bin/python
62-
63-
RUN pip3 install -r requirements-dev.txt
64-
RUN invoke build.all
65-
RUN python3 setup.py install
66-
6756
# intermediate stage with apt and python dependencies
6857
FROM build-deps AS build-app-deps
6958

@@ -74,10 +63,6 @@ WORKDIR /src
7463
ENV UV_LINK_MODE=copy
7564
RUN --mount=type=cache,target=/root/.cache/uv \
7665
uv pip install --system -r requirements.txt
77-
# sslyze is installed from our own fork, and installed
78-
# without deps to avoid it trying to install nassl, when
79-
# we have our custom nassl
80-
RUN pip3 install --no-deps https://github.com/mxsasha/sslyze/archive/refs/tags/6.0.0+internetnl6.tar.gz
8166

8267
# stage with app dependencies and lint/test depencencies
8368
FROM build-app-deps AS linttest-deps
@@ -166,9 +151,6 @@ RUN apt update && \
166151
COPY --from=build-unbound /opt/unbound /opt/unbound
167152
COPY --from=build-unbound /usr/lib/python3/dist-packages/*unbound* /usr/lib/python3/dist-packages/
168153

169-
# copy nassl Python module into image
170-
COPY --from=build-nassl /usr/local/lib/python${PYTHON_VERSION}/dist-packages/nassl-*.egg /usr/local/lib/python${PYTHON_VERSION}/dist-packages/
171-
172154
# copy application dependencies into image
173155
COPY --from=build-app-deps /usr/local/lib/python${PYTHON_VERSION}/dist-packages/ /usr/local/lib/python${PYTHON_VERSION}/dist-packages/
174156
COPY --from=build-app-deps /usr/local/bin/* /usr/local/bin/

documentation/images/dockerfiles.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
with Cluster("Stages"):
8383
build_deps = Stage("build-deps")
8484
build_unbound = Stage("build-unbound")
85-
build_nassl = Stage("build-nassl")
8685
build_app_deps = Stage("build-app-deps")
8786
build_linttest_deps = Stage("build-linttest-deps")
8887
build_app = Stage("build-app")
@@ -97,9 +96,6 @@
9796
build_deps >> build_unbound
9897
vendor_unbound >> build_unbound
9998

100-
build_deps >> build_nassl
101-
vendor_openssl >> build_nassl
102-
10399
build_deps >> build_app_deps
104100
requirements >> build_app_deps
105101

requirements.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ pyopenssl
4747
dnspython
4848

4949
# sslyze dependencies, which is installed from outside this file
50-
tls-parser>=2,<3
51-
pydantic>=2.2,<2.7
50+
sslyze
5251

5352
# https://stackoverflow.com/questions/73933432/django-celery-cannot-import-name-celery-from-celery-after-rebuilding-dockerf
5453
importlib-metadata<5

requirements.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ asgiref==3.8.1
2020
# django-browser-reload
2121
async-timeout==5.0.1
2222
# via redis
23-
attrs==25.3.0
24-
# via pytest
2523
beautifulsoup4==4.13.3
2624
# via -r requirements.in
2725
billiard==4.2.1
@@ -65,6 +63,7 @@ cryptography==44.0.2
6563
# -r requirements.in
6664
# pgpy-dtc
6765
# pyopenssl
66+
# sslyze
6867
django==4.2.24
6968
# via
7069
# -r requirements.in
@@ -131,6 +130,8 @@ markdown==3.7
131130
# via -r requirements.in
132131
markdown2==2.5.3
133132
# via django-markdown-deux
133+
nassl==5.3.0
134+
# via sslyze
134135
packaging==24.2
135136
# via
136137
# forcediphttpsadapter
@@ -153,7 +154,7 @@ pyasn1==0.6.1
153154
pycparser==2.22
154155
# via cffi
155156
pydantic==2.6.4
156-
# via -r requirements.in
157+
# via sslyze
157158
pydantic-core==2.16.3
158159
# via pydantic
159160
pyopenssl==25.0.0
@@ -214,6 +215,8 @@ soupsieve==2.6
214215
# via beautifulsoup4
215216
sqlparse==0.5.3
216217
# via django
218+
sslyze==6.1.0
219+
# via -r requirements.in
217220
statsd==4.0.0
218221
# via
219222
# celery-statsd
@@ -223,19 +226,16 @@ statshog==1.0.6
223226
tinycss2==1.1.1
224227
# via bleach
225228
tls-parser==2.0.1
226-
# via -r requirements.in
227229
# via sslyze
228-
tinycss2==1.1.1
229-
# via bleach
230-
toml==0.10.2
231-
# via pytest
232230
tomli==2.2.1
233231
# via
234232
# pytest
235233
# setuptools-scm
236234
typing-extensions==4.12.2
237235
# via
238236
# asgiref
237+
# beautifulsoup4
238+
# exceptiongroup
239239
# kombu
240240
# pydantic
241241
# pydantic-core

0 commit comments

Comments
 (0)