Skip to content

Commit

Permalink
Merge pull request #559 from nabla-c0d3/dev-5.0.3
Browse files Browse the repository at this point in the history
Dev 5.0.3
  • Loading branch information
nabla-c0d3 authored Mar 13, 2022
2 parents 8255872 + 9af67ec commit 8bf376c
Show file tree
Hide file tree
Showing 34 changed files with 19,941 additions and 22,204 deletions.
2 changes: 1 addition & 1 deletion docs/documentation/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 19fb8738cc6ce55f6982987113abcb7b
config: 97b3451be6c04378175579402a82d6be
tags: 645f666f9bcd5a90fca523b33c5a78b7
3 changes: 2 additions & 1 deletion docs/documentation/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down Expand Up @@ -757,6 +757,7 @@ span.pre {
-ms-hyphens: none;
-webkit-hyphens: none;
hyphens: none;
white-space: nowrap;
}

div[class*="highlight-"] {
Expand Down
5 changes: 4 additions & 1 deletion docs/documentation/_static/doctools.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down Expand Up @@ -264,6 +264,9 @@ var Documentation = {
hideSearchWords : function() {
$('#searchbox .highlight-link').fadeOut(300);
$('span.highlighted').removeClass('highlighted');
var url = new URL(window.location);
url.searchParams.delete('highlight');
window.history.replaceState({}, '', url);
},

/**
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '5.0.1',
VERSION: '5.0.3',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/_static/language_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for the full-text search.
*
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/available-scan-commands.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<title>Appendix: Scan Commands &#8212; SSLyze 5.0.1 documentation</title>
<title>Appendix: Scan Commands &#8212; SSLyze 5.0.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
Expand Down Expand Up @@ -1444,7 +1444,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;Copyright 2021 Alban Diquet.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.3.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.4.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &#8212; SSLyze 5.0.1 documentation</title>
<title>Index &#8212; SSLyze 5.0.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
Expand Down Expand Up @@ -643,7 +643,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;Copyright 2021 Alban Diquet.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.3.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.4.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

</div>
Expand Down
6 changes: 3 additions & 3 deletions docs/documentation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<title>SSLyze &#8212; SSLyze 5.0.1 documentation</title>
<title>SSLyze &#8212; SSLyze 5.0.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
Expand Down Expand Up @@ -34,7 +34,7 @@

<section id="sslyze">
<h1><a class="toc-backref" href="#id1">SSLyze</a><a class="headerlink" href="#sslyze" title="Permalink to this headline"></a></h1>
<p>Release 5.0.1</p>
<p>Release 5.0.3</p>
<a class="reference external image-reference" href="https://pepy.tech/project/sslyze"><img alt="https://pepy.tech/badge/sslyze" src="https://pepy.tech/badge/sslyze" /></a>
<a class="reference external image-reference" href="https://pypi.org/project/sslyze/"><img alt="https://img.shields.io/pypi/l/sslyze.svg" src="https://img.shields.io/pypi/l/sslyze.svg" /></a>
<a class="reference external image-reference" href="https://pypi.org/project/sslyze/"><img alt="https://img.shields.io/pypi/pyversions/sslyze.svg" src="https://img.shields.io/pypi/pyversions/sslyze.svg" /></a>
Expand Down Expand Up @@ -184,7 +184,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;Copyright 2021 Alban Diquet.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.3.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.4.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/json-output.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<title>Exporting and processing scan results in JSON &#8212; SSLyze 5.0.1 documentation</title>
<title>Exporting and processing scan results in JSON &#8212; SSLyze 5.0.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
Expand Down Expand Up @@ -145,7 +145,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;Copyright 2021 Alban Diquet.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.3.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.4.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
Binary file modified docs/documentation/objects.inv
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/documentation/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Python Module Index &#8212; SSLyze 5.0.1 documentation</title>
<title>Python Module Index &#8212; SSLyze 5.0.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
Expand Down Expand Up @@ -115,7 +115,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;Copyright 2021 Alban Diquet.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.3.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.4.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

</div>
Expand Down
6 changes: 3 additions & 3 deletions docs/documentation/running-a-scan-in-python.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<title>Running a Scan in Python &#8212; SSLyze 5.0.1 documentation</title>
<title>Running a Scan in Python &#8212; SSLyze 5.0.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
Expand Down Expand Up @@ -714,7 +714,7 @@ <h2>Classes for Processing Scan Results<a class="headerlink" href="#classes-for-
<li><p><strong>status</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">ScanCommandAttemptStatusEnum</span></code>) – </p></li>
<li><p><strong>error_reason</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<a class="reference internal" href="#sslyze.ScanCommandErrorReasonEnum" title="sslyze.scanner.scan_command_attempt.ScanCommandErrorReasonEnum"><code class="xref py py-class docutils literal notranslate"><span class="pre">ScanCommandErrorReasonEnum</span></code></a>]) – </p></li>
<li><p><strong>error_trace</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">TracebackException</span></code>]) – </p></li>
<li><p><strong>result</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[~_ScanCommandResultTypeVar]) – </p></li>
<li><p><strong>result</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">TypeVar</span></code>(<code class="docutils literal notranslate"><span class="pre">_ScanCommandResultTypeVar</span></code>)]) – </p></li>
</ul>
</dd>
</dl>
Expand Down Expand Up @@ -817,7 +817,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;Copyright 2021 Alban Diquet.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.3.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.4.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Search &#8212; SSLyze 5.0.1 documentation</title>
<title>Search &#8212; SSLyze 5.0.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />

Expand Down Expand Up @@ -116,7 +116,7 @@ <h3>Related Topics</h3>
&copy;Copyright 2021 Alban Diquet.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.3.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.4.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/searchindex.js

Large diffs are not rendered by default.

30 changes: 29 additions & 1 deletion json_output_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"description": "The \"root\" dictionary of the JSON output when using the --json command line option.\n ",
"type": "object",
"properties": {
"invalid_server_strings": {
"title": "Invalid Server Strings",
"default": [],
"type": "array",
"items": {
"$ref": "#/definitions/InvalidServerStringAsJson"
}
},
"server_scan_results": {
"title": "Server Scan Results",
"type": "array",
Expand All @@ -22,7 +30,7 @@
},
"sslyze_version": {
"title": "Sslyze Version",
"default": "5.0.1",
"default": "5.0.3",
"type": "string"
},
"sslyze_url": {
Expand All @@ -37,6 +45,26 @@
"date_scans_completed"
],
"definitions": {
"InvalidServerStringAsJson": {
"title": "InvalidServerStringAsJson",
"description": "A hostname:port string supplied via the command line that SSLyze was unable to parse or resolve.\n ",
"type": "object",
"properties": {
"server_string": {
"title": "Server String",
"type": "string"
},
"error_message": {
"title": "Error Message",
"type": "string"
}
},
"required": [
"server_string",
"error_message"
],
"additionalProperties": false
},
"ConnectionTypeEnum": {
"title": "ConnectionTypeEnum",
"description": "An enumeration.",
Expand Down
21 changes: 15 additions & 6 deletions sslyze/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
SslyzeOutputAsJson,
ServerScanResultAsJson,
)
from sslyze.json.json_output import InvalidServerStringAsJson
from sslyze.mozilla_tls_profile.mozilla_config_checker import (
MozillaTlsConfigurationChecker,
ServerNotCompliantWithMozillaTlsConfiguration,
Expand Down Expand Up @@ -56,13 +57,14 @@ def main() -> None:
scan_commands_extra_arguments=parsed_command_line.scan_commands_extra_arguments,
)
all_server_scan_requests.append(scan_request)
assert all_server_scan_requests

sslyze_scanner.queue_scans(all_server_scan_requests)
# If there are servers that we were able to resolve, scan them
all_server_scan_results = []
for result in sslyze_scanner.get_results():
# Results are actually displayed by the observer; here we just store them
all_server_scan_results.append(result)
if all_server_scan_requests:
sslyze_scanner.queue_scans(all_server_scan_requests)
for result in sslyze_scanner.get_results():
# Results are actually displayed by the observer; here we just store them
all_server_scan_results.append(result)

# Write results to a JSON file if needed
json_file_out: Optional[TextIO] = None
Expand All @@ -74,6 +76,9 @@ def main() -> None:
if json_file_out:
json_output = SslyzeOutputAsJson(
server_scan_results=[ServerScanResultAsJson.from_orm(result) for result in all_server_scan_results],
invalid_server_strings=[
InvalidServerStringAsJson.from_orm(bad_server) for bad_server in parsed_command_line.invalid_servers
],
date_scans_started=date_scans_started,
date_scans_completed=datetime.utcnow(),
)
Expand All @@ -84,14 +89,18 @@ def main() -> None:
if parsed_command_line.should_print_json_to_console:
sys.exit(0)

if not all_server_scan_results:
# There are no results to present: all supplied server strings were invalid?
sys.exit(0)

# Check the results against the Mozilla config if needed
are_all_servers_compliant = True
# TODO(AD): Expose format_title method
title = ObserverToGenerateConsoleOutput._format_title("Compliance against Mozilla TLS configuration")
print()
print(title)
if not parsed_command_line.check_against_mozilla_config:
print(" Disabled; use --mozilla-config={old, intermediate, modern}.\n")
print(" Disabled; use --mozilla_config={old, intermediate, modern}.\n")
else:

print(
Expand Down
2 changes: 1 addition & 1 deletion sslyze/__version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = "SSLyze"
__version__ = "5.0.2"
__version__ = "5.0.3"
__description__ = "Fast and powerful SSL/TLS scanning library."
__author__ = "Alban Diquet"
__author_email__ = "nabla.c0d3@gmail.com"
Expand Down
11 changes: 8 additions & 3 deletions sslyze/cli/command_line_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ def __init__(self, sslyze_version: str) -> None:
"--mozilla_config",
action="store",
dest="mozilla_config",
choices=[config.value for config in MozillaTlsConfigurationEnum],
choices=[config.value for config in MozillaTlsConfigurationEnum] + ["disable"],
help="Shortcut to queue various scan commands needed to check the server's TLS configurations against one"
' of Mozilla\'s recommended TLS configuration. Set to "intermediate" by default.',
' of Mozilla\'s recommended TLS configuration. Set to "intermediate" by default. Use "disable" to disable'
" this check.",
)

self.aparser.add_argument(dest="target", default=[], nargs="*", help="The list of servers to scan.")
Expand Down Expand Up @@ -151,7 +152,11 @@ def parse_command_line(self) -> ParsedCommandLine:
# Enable the commands needed by --mozilla-config
check_against_mozilla_config: Optional[MozillaTlsConfigurationEnum] = None
if args_command_list.mozilla_config:
check_against_mozilla_config = MozillaTlsConfigurationEnum(args_command_list.mozilla_config)
if args_command_list.mozilla_config == "disable":
check_against_mozilla_config = None
else:
check_against_mozilla_config = MozillaTlsConfigurationEnum(args_command_list.mozilla_config)

for scan_cmd in SCAN_COMMANDS_NEEDED_BY_MOZILLA_CHECKER:
cli_connector_cls = ScanCommandsRepository.get_implementation_cls(scan_cmd).cli_connector_cls
setattr(args_command_list, cli_connector_cls._cli_option, True)
Expand Down
Loading

0 comments on commit 8bf376c

Please sign in to comment.