Skip to content

[hold] Fix #714 - Switch to (mainly) sslyze for TLS testing #1218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2ee0265
Switch TLS to sslyze/nassl based reimplementation
mxsasha May 2, 2023
086ebfc
Add CAMELLIA as sufficient, add CCM
mxsasha May 9, 2024
bbe2ec2
Update nassl to fe914c0+sigalgs
mxsasha Jul 1, 2024
6e9a62f
Fix incorrect order detection when mixing in TLS 1.3 ciphers and usin…
mxsasha Jul 2, 2024
8a3d672
Fix FFDHE generator detection
mxsasha Jul 3, 2024
0e43391
Fix detection of sufficient FFDHE primes
mxsasha Aug 13, 2024
4da6a85
Update to latest sslyze patch
mxsasha Aug 8, 2024
2ae8a83
Parallelise sslyze part of mail TLS scan
mxsasha Aug 22, 2024
0d55e2b
Precheck supported TLS versions to reduce sslyze scan scope
mxsasha Aug 27, 2024
b93337b
update sslyze fork, set correct ehlo name
mxsasha Aug 28, 2024
56f9e7c
error catching adj
mxsasha Sep 2, 2024
c1df4a9
Network timeout to 10s
mxsasha Sep 6, 2024
a9de1da
Fix handling of nxdomain mx hosts
mxsasha Sep 19, 2024
f17a01f
Do not terminate test for some obscure cipher ordering limitations
mxsasha Sep 20, 2024
dc5ed7c
little hack to selectively increase connlimit
mxsasha Sep 20, 2024
852a898
small cleanup
mxsasha Oct 7, 2024
830d109
improve TLS version precheck speed
mxsasha Oct 7, 2024
75cb248
docs, minor fixes
mxsasha Oct 16, 2024
20552aa
Only show IANA cipher names
mxsasha Nov 25, 2024
83fa8b2
Improve detection of missing SHA2 key exchange
mxsasha Dec 9, 2024
68e1110
Update for new resolver
mxsasha Mar 18, 2025
bcf5471
Update cert data after rebase
mxsasha Mar 18, 2025
85acf2b
fix imports
mxsasha Mar 18, 2025
b2d241e
update deps
mxsasha Mar 18, 2025
8e0923b
re-enable caa
mxsasha Mar 18, 2025
16fbbce
utf8, lint fixes
mxsasha Mar 18, 2025
7b9ba56
fix dane_cb
mxsasha Mar 18, 2025
4084c77
Revert back to pip for sslyze branch
mxsasha Mar 24, 2025
e57439a
Ref #1641 - Detect absence of OCSP in OCSP response evaluation
mxsasha Mar 24, 2025
5d597e5
Clean up DANE/resolver integration
mxsasha Mar 25, 2025
dbbfa18
Update resolver hostname for ldns call
mxsasha Mar 27, 2025
00f2b9b
Bump error log down to info
mxsasha Mar 31, 2025
dcf9d6f
Extra debug on precheck
mxsasha Apr 1, 2025
bb28078
Update categories.py
mxsasha Apr 9, 2025
9266297
Forward-port #1728 changes from tls.py
mxsasha Apr 9, 2025
2692200
lint
mxsasha Apr 9, 2025
e7f14cc
lint/rebase
mxsasha May 2, 2025
b2d228b
Fix INTERNETNL-2V4 - tuple inconsistency
mxsasha May 2, 2025
e4db013
merge
mxsasha Jun 2, 2025
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
13 changes: 4 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
[submodule "vendor/unbound"]
path = vendor/unbound
url = https://github.com/internetstandards/unbound.git
[submodule "vendor/nassl"]
path = vendor/nassl
url = https://github.com/internetstandards/nassl.git
[submodule "vendor/openssl-1.0.2e"]
path = vendor/openssl-1.0.2e
url = https://github.com/PeterMosmans/openssl.git
[submodule "vendor/openssl-master"]
path = vendor/openssl-master
url = https://github.com/openssl/openssl.git
[submodule "vendor/nassl6"]
path = vendor/nassl6
url = https://github.com/mxsasha/nassl
branch = sigalg
42 changes: 7 additions & 35 deletions checks/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,24 +1085,9 @@ def result_good(self):
self.verdict = "detail web tls cipher-order verdict good"
self.tech_data = ""

def result_bad(self):
def result_bad(self, cipher_order_violation):
self._status(STATUS_FAIL)
self.verdict = "detail web tls cipher-order verdict bad"
self.tech_data = ""

def result_seclevel_bad(self, cipher_order_violation):
self._status(STATUS_FAIL)
self.verdict = "detail web tls cipher-order verdict seclevel-bad"
self.tech_data = cipher_order_violation

def result_score_warning(self, cipher_order_violation):
self._status(STATUS_NOTICE)
self.verdict = "detail web tls cipher-order verdict warning"
self.tech_data = cipher_order_violation

def result_score_info(self, cipher_order_violation):
self._status(STATUS_INFO)
self.verdict = "detail web tls cipher-order verdict warning"
self.tech_data = cipher_order_violation

def result_na(self):
Expand Down Expand Up @@ -1482,6 +1467,11 @@ def result_not_trusted(self):
self.verdict = "detail web tls ocsp-stapling verdict bad"
self.tech_data = "detail tech data no"

def result_not_in_cert(self):
self._status(STATUS_SUCCESS)
self.verdict = "detail web tls ocsp-stapling verdict not-in-cert"
self.tech_data = "detail tech data not-applicable"


class WebTlsKexHashFunc(Subtest):
def __init__(self):
Expand Down Expand Up @@ -1674,28 +1664,10 @@ def result_good(self):
self.verdict = "detail mail tls cipher-order verdict good"
self.tech_data = ""

def result_bad(self):
def result_bad(self, cipher_order_violation):
self.was_tested()
self._status(STATUS_FAIL)
self.verdict = "detail mail tls cipher-order verdict bad"
self.tech_data = ""

def result_seclevel_bad(self, cipher_order_violation):
self.was_tested()
self._status(STATUS_FAIL)
self.verdict = "detail mail tls cipher-order verdict seclevel-bad"
self.tech_data = cipher_order_violation

def result_warning(self, cipher_order_violation):
self.was_tested()
self._status(STATUS_NOTICE)
self.verdict = "detail mail tls cipher-order verdict warning"
self.tech_data = cipher_order_violation

def result_info(self, cipher_order_violation):
self.was_tested()
self._status(STATUS_INFO)
self.verdict = "detail mail tls cipher-order verdict warning"
self.tech_data = cipher_order_violation

def result_na(self):
Expand Down
9 changes: 7 additions & 2 deletions checks/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@
from forcediphttpsadapter.adapters import ForcedIPHTTPSAdapter

from checks.resolver import dns_resolve_aaaa, dns_resolve_a
from checks.tasks.tls_connection import DEFAULT_TIMEOUT
from checks.tasks.tls_connection_exceptions import NoIpError
from django.conf import settings
from internetnl import log

# Disable HTTPS warnings as we intentionally disable HTTPS verification
urllib3.disable_warnings()


DEFAULT_TIMEOUT = 10


class NoIpError(Exception):
pass


def _do_request(args, headers, kwargs, session, url):
"""
This small wrapper helps with handling of redirects.
Expand Down
1 change: 1 addition & 0 deletions checks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class OcspStatus(Enum):
ok = 0
good = 1
not_trusted = 2
not_in_cert = 3


class ZeroRttStatus(Enum):
Expand Down
12 changes: 7 additions & 5 deletions checks/probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from checks.tasks import mail

if settings.INTERNET_NL_CHECK_SUPPORT_TLS:
from checks.tasks import tls
from checks.tasks.tls import tasks_reports as tls_tasks

if settings.INTERNET_NL_CHECK_SUPPORT_APPSECPRIV:
from checks.tasks import appsecpriv
Expand Down Expand Up @@ -413,7 +413,7 @@ def get_max_score(self, modelobj, maxscore):
)

if settings.INTERNET_NL_CHECK_SUPPORT_TLS:
web_probe_tls = Probe("tls", "site", model=WebTestTls, category=categories.WebTls, taskset=tls.web_registered)
web_probe_tls = Probe("tls", "site", model=WebTestTls, category=categories.WebTls, taskset=tls_tasks.web_registered)

if settings.INTERNET_NL_CHECK_SUPPORT_APPSECPRIV:
web_probe_appsecpriv = Probe(
Expand Down Expand Up @@ -445,7 +445,7 @@ def get_max_score(self, modelobj, maxscore):

if settings.INTERNET_NL_CHECK_SUPPORT_TLS:
batch_web_probe_tls = Probe(
"tls", "site", model=WebTestTls, category=categories.WebTls, taskset=tls.batch_web_registered
"tls", "site", model=WebTestTls, category=categories.WebTls, taskset=tls_tasks.batch_web_registered
)

if settings.INTERNET_NL_CHECK_SUPPORT_APPSECPRIV:
Expand Down Expand Up @@ -518,7 +518,9 @@ def get_max_score(self, modelobj, maxscore):
)

if settings.INTERNET_NL_CHECK_SUPPORT_TLS:
mail_probe_tls = Probe("tls", "mail", model=MailTestTls, category=categories.MailTls, taskset=tls.mail_registered)
mail_probe_tls = Probe(
"tls", "mail", model=MailTestTls, category=categories.MailTls, taskset=tls_tasks.mail_registered
)

if settings.INTERNET_NL_CHECK_SUPPORT_RPKI:
mail_probe_rpki = Probe(
Expand All @@ -542,7 +544,7 @@ def get_max_score(self, modelobj, maxscore):

if settings.INTERNET_NL_CHECK_SUPPORT_TLS:
batch_mail_probe_tls = Probe(
"tls", "mail", model=MailTestTls, category=categories.MailTls, taskset=tls.batch_mail_registered
"tls", "mail", model=MailTestTls, category=categories.MailTls, taskset=tls_tasks.batch_mail_registered
)

if settings.INTERNET_NL_CHECK_SUPPORT_RPKI:
Expand Down
27 changes: 16 additions & 11 deletions checks/scoring.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# Copyright: 2022, ECP, NLnet Labs and the Internet.nl contributors
# SPDX-License-Identifier: Apache-2.0
from typing import NewType

Status = NewType("Status", int)
Score = NewType("Score", int)

# --- STATUSES
#
# Do not change these values.
# You can append statuses and then change the ORDERED_STATUSES below.
STATUS_FAIL = 0
STATUS_SUCCESS = 1
STATUS_NOTICE = 2
STATUS_GOOD_NOT_TESTED = 3
STATUS_NOT_TESTED = 4
STATUS_INFO = 5
STATUS_ERROR = 6

STATUS_FAIL = Status(0)
STATUS_SUCCESS = Status(1)
STATUS_NOTICE = Status(2)
STATUS_GOOD_NOT_TESTED = Status(3)
STATUS_NOT_TESTED = Status(4)
STATUS_INFO = Status(5)
STATUS_ERROR = Status(6)

STATUS_MAX = STATUS_SUCCESS

Expand Down Expand Up @@ -42,10 +47,10 @@

# --- SCORES
#
FULL_WEIGHT_POINTS = 10 # These are three levels of weighing results.
HALF_WEIGHT_POINTS = 5 # All three can be used for passed tests, the
LESS_WEIGHT_POINTS = 2 # difference is the effect on the overall score.
NO_POINTS = 0
FULL_WEIGHT_POINTS = Score(10) # These are three levels of weighing results.
HALF_WEIGHT_POINTS = Score(5) # All three can be used for passed tests, the
LESS_WEIGHT_POINTS = Score(2) # difference is the effect on the overall score.
NO_POINTS = Score(0)


# You can edit the below values to change the scoring for the subtests.
Expand Down
Loading